Compare commits
4 Commits
thermostat
...
HeatingSce
Author | SHA1 | Date | |
---|---|---|---|
a8761a68b6
|
|||
c77f5b9096 | |||
eb90199d97 | |||
62303cf27e |
14
dist/HeatingScene.js
vendored
Normal file
14
dist/HeatingScene.js
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const Forwarder_1 = require("./Forwarder");
|
||||
class HeatingScene extends Forwarder_1.Forwarder {
|
||||
constructor(floor, room, item, label, targetItems) {
|
||||
let inTopics = [];
|
||||
targetItems.forEach((item) => {
|
||||
inTopics.push(item.getInTopic());
|
||||
});
|
||||
super(floor, room, item, "command", label, inTopics);
|
||||
}
|
||||
}
|
||||
exports.HeatingScene = HeatingScene;
|
||||
//# sourceMappingURL=HeatingScene.js.map
|
22
dist/MaxThermostat.js
vendored
22
dist/MaxThermostat.js
vendored
@ -54,13 +54,16 @@ class MaxThermostat extends AHomegearItem_1.AHomegearItem {
|
||||
setTemperature = true;
|
||||
}
|
||||
else if (topic == this.commandTopic) {
|
||||
if (this.heatingMainFlag) {
|
||||
if (payload == 'ON') {
|
||||
this.temperature = this.presetTemperature;
|
||||
}
|
||||
else if (payload == 'OFF') {
|
||||
this.temperature = DISABLED_TEMPERATURE;
|
||||
}
|
||||
if ((payload == 'ON') && this.heatingMainFlag) {
|
||||
this.temperature = this.presetTemperature;
|
||||
setTemperature = true;
|
||||
}
|
||||
else if (payload == 'OFF') {
|
||||
this.temperature = DISABLED_TEMPERATURE;
|
||||
setTemperature = true;
|
||||
}
|
||||
else if (payload == 'FORCE_ON') {
|
||||
this.temperature = this.presetTemperature;
|
||||
setTemperature = true;
|
||||
}
|
||||
}
|
||||
@ -68,8 +71,9 @@ class MaxThermostat extends AHomegearItem_1.AHomegearItem {
|
||||
this.heatingMainFlag = (payload == 'ON');
|
||||
logger.info(`${this.itemId} heating main: ${this.heatingMainFlag}`);
|
||||
if (!this.heatingMainFlag) {
|
||||
MqttDispatcher_1.mqttHandler.send(this.temperatureFeedbackTopic, `${DISABLED_TEMPERATURE}`);
|
||||
MqttDispatcher_1.mqttHandler.send(this.actionTopic, `${DISABLED_TEMPERATURE}`);
|
||||
this.temperature = DISABLED_TEMPERATURE;
|
||||
MqttDispatcher_1.mqttHandler.send(this.temperatureFeedbackTopic, `${this.temperature}`);
|
||||
MqttDispatcher_1.mqttHandler.send(this.actionTopic, `${this.temperature}`);
|
||||
}
|
||||
}
|
||||
else if (topic == this.presetTemperatureTopic) {
|
||||
|
13
dist/main.js
vendored
13
dist/main.js
vendored
@ -20,8 +20,10 @@ const Cron_1 = require("./Cron");
|
||||
const HueColorBulbItem_1 = require("./HueColorBulbItem");
|
||||
const TouchSwitchMultiButtonThing_1 = require("./TouchSwitchMultiButtonThing");
|
||||
const RelayBox_1 = require("./RelayBox");
|
||||
const HeatingScene_1 = require("./HeatingScene");
|
||||
logger.info("Dispatcher starting");
|
||||
let allLabeledItems = new Array();
|
||||
let allThermostatItems = new Array();
|
||||
// Anna -----------------------------------------------------------------------------------------------------
|
||||
// Anna Aquarium 14665044 24 1 14665041 24 1
|
||||
let aquariumLight = new M433SwitchItem_1.M433SwitchItem('1st', 'Anna', 'AquariumLight', 'Aquariumlicht', '14665044 24 1', '14665041 24 1');
|
||||
@ -46,6 +48,7 @@ let thermostatAnna1st = new MaxThermostat_1.MaxThermostat('1st', 'Anna', 'Thermo
|
||||
thermostatAnna1st.start();
|
||||
thermostatAnna1st.setPresetTemperature(21.0);
|
||||
allLabeledItems.push(thermostatAnna1st);
|
||||
allThermostatItems.push(thermostatAnna1st);
|
||||
let thermostatAnna1stCron = new Cron_1.Cron('thermostatAnna1stCron', thermostatAnna1st, [
|
||||
{ cronTime: '00 05 06 * * *', output: 'ON' },
|
||||
{ cronTime: '00 05 08 * * 1-5', output: 'OFF' },
|
||||
@ -70,6 +73,9 @@ allLabeledItems.push(matthiasBedLight);
|
||||
let matthiasSpeaker = new M433SwitchItem_1.M433SwitchItem('1st', 'Matthias', 'Speaker', 'Lautsprecher Matthias', '11 24 1', '10 24 1', 'outlet');
|
||||
matthiasSpeaker.start();
|
||||
allLabeledItems.push(matthiasSpeaker);
|
||||
let windowContactMatthias = new MaxWindowContact_1.MaxWindowContact('1st', 'Matthias', 'WindowContact', 'Fenster', 24);
|
||||
windowContactMatthias.start();
|
||||
allLabeledItems.push(windowContactMatthias);
|
||||
// Esszimmer ------------------------------------------------------------------------------------------------
|
||||
// Esszimmer kleine Lampe 69653 24 1 69652 24 1
|
||||
let diningRoomSmallLight = new M433SwitchItem_1.M433SwitchItem('Gnd', 'DiningRoom', 'SmallLight', 'kleine Lampe Esszimmer', '69653 24 1', '69652 24 1');
|
||||
@ -162,6 +168,7 @@ let thermostatBedroom1st = new MaxThermostat_1.MaxThermostat('1st', 'Bedroom', '
|
||||
thermostatBedroom1st.start();
|
||||
thermostatBedroom1st.setPresetTemperature(20.0);
|
||||
allLabeledItems.push(thermostatBedroom1st);
|
||||
allThermostatItems.push(thermostatBedroom1st);
|
||||
let thermostatBedroom1stCron = new Cron_1.Cron('thermostatBedroom1stCron', thermostatBedroom1st, [
|
||||
{ cronTime: '00 01 06 * * 1-5', output: 'ON' },
|
||||
{ cronTime: '00 01 09 * * 1-5', output: 'OFF' },
|
||||
@ -208,6 +215,7 @@ let thermostatBathroomGnd = new MaxThermostat_1.MaxThermostat('Gnd', 'Bathroom',
|
||||
thermostatBathroomGnd.start();
|
||||
thermostatBathroomGnd.setPresetTemperature(20.0);
|
||||
allLabeledItems.push(thermostatBathroomGnd);
|
||||
allThermostatItems.push(thermostatBathroomGnd);
|
||||
let thermostatBathroomGndCron = new Cron_1.Cron('thermostatBathroomGndCron', thermostatBathroomGnd, [
|
||||
{ cronTime: '00 02 06 * * 1-5', output: 'ON' },
|
||||
{ cronTime: '00 02 08 * * 6,0', output: 'ON' },
|
||||
@ -223,6 +231,7 @@ let thermostatBathroom1st = new MaxThermostat_1.MaxThermostat('1st', 'Bathroom',
|
||||
thermostatBathroom1st.start();
|
||||
thermostatBathroom1st.setPresetTemperature(20.0);
|
||||
allLabeledItems.push(thermostatBathroom1st);
|
||||
allThermostatItems.push(thermostatBathroom1st);
|
||||
let thermostatBathroom1stCron = new Cron_1.Cron('thermostatBathroom1stCron', thermostatBathroom1st, [
|
||||
{ cronTime: '00 00 06 * * 1-5', output: 'ON' },
|
||||
{ cronTime: '00 00 08 * * 6,0', output: 'ON' },
|
||||
@ -249,6 +258,7 @@ let thermostatKitchen = new MaxThermostat_1.MaxThermostat('Gnd', 'Kitchen', 'The
|
||||
thermostatKitchen.start();
|
||||
thermostatKitchen.setPresetTemperature(20.0);
|
||||
allLabeledItems.push(thermostatKitchen);
|
||||
allThermostatItems.push(thermostatKitchen);
|
||||
let thermostatKitchenCron = new Cron_1.Cron('thermostatKitchenCron', thermostatKitchen, [
|
||||
{ cronTime: '00 00 06 * * 1-5', output: 'ON' },
|
||||
{ cronTime: '00 00 08 * * 6,0', output: 'ON' },
|
||||
@ -268,6 +278,9 @@ let relayBox = new RelayBox_1.RelayBoxThing('base', 'labor', 'relaybox', 'IoT/Co
|
||||
relayBox.start();
|
||||
allLabeledItems.push(relayBox);
|
||||
// ----------------------------------------------------------------------------------------------------------
|
||||
let heatingSceneAll = new HeatingScene_1.HeatingScene('Gnd', 'House', 'Heatings', 'Alle Heizungen', allThermostatItems);
|
||||
heatingSceneAll.start();
|
||||
// ----------------------------------------------------------------------------------------------------------
|
||||
let testFourButton = new HomematicFourButtonThing_1.HomematicFourButtonThing('Gnd', 'Hallway', 'TestButton', 9, [
|
||||
new HomematicFourButtonThing_1.HomematicFourButtonSingleItem('dispatcher_ng/items/Gnd/Hallway/Testlight/dimmerIn'),
|
||||
new HomematicFourButtonThing_1.HomematicFourButtonSingleItem('dispatcher_ng/items/Gnd/Hallway/DeskLight/timerIn'),
|
||||
|
22
homekit.json
22
homekit.json
@ -103,6 +103,17 @@
|
||||
},
|
||||
"config": {}
|
||||
},
|
||||
"1st_Matthias_WindowContact": {
|
||||
"id": "1st_Matthias_WindowContact",
|
||||
"name": "Fenster",
|
||||
"service": "ContactSensor",
|
||||
"topic": {
|
||||
"statusContactSensorState": "dispatcher_ng/items/1st/Matthias/WindowContact/state/feedback"
|
||||
},
|
||||
"payload": {
|
||||
"onContactDetected": "CLOSED"
|
||||
}
|
||||
},
|
||||
"Gnd_DiningRoom_SmallLight": {
|
||||
"id": "Gnd_DiningRoom_SmallLight",
|
||||
"name": "kleine Lampe Esszimmer",
|
||||
@ -621,5 +632,16 @@
|
||||
},
|
||||
"payload": {}
|
||||
},
|
||||
"Gnd_Hallway_FrontdoorContact": {
|
||||
"id": "Gnd_Hallway_FrontdoorContact",
|
||||
"name": "Haustür",
|
||||
"service": "ContactSensor",
|
||||
"topic": {
|
||||
"statusContactSensorState": "dispatcher_ng/items/Gnd/Hallway/FrontdoorContact/state/feedback"
|
||||
},
|
||||
"payload": {
|
||||
"onContactDetected": "CLOSED"
|
||||
}
|
||||
},
|
||||
"": {}
|
||||
}
|
@ -6,6 +6,7 @@ Number Preset_1st_Anna_Thermostat "Preset_Thermostat Anna [%.1f °C]" {mqtt=">[l
|
||||
Switch 1st_Matthias_StandLight "Stehlampen Matthias"{mqtt=">[localbroker:dispatcher_ng/items/1st/Matthias/StandLight/state:command:*:default],<[localbroker:dispatcher_ng/items/1st/Matthias/StandLight/state/feedback:state:default]"}
|
||||
Switch 1st_Matthias_BedLight "Bettlicht Matthias"{mqtt=">[localbroker:dispatcher_ng/items/1st/Matthias/BedLight/state:command:*:default],<[localbroker:dispatcher_ng/items/1st/Matthias/BedLight/state/feedback:state:default]"}
|
||||
Switch 1st_Matthias_Speaker "Lautsprecher Matthias"{mqtt=">[localbroker:dispatcher_ng/items/1st/Matthias/Speaker/state:command:*:default],<[localbroker:dispatcher_ng/items/1st/Matthias/Speaker/state/feedback:state:default]"}
|
||||
Contact 1st_Matthias_WindowContact "Fenster" {mqtt="<[localbroker:dispatcher_ng/items/1st/Matthias/WindowContact/state/feedback:state:default]"}
|
||||
Switch Gnd_DiningRoom_SmallLight "kleine Lampe Esszimmer"{mqtt=">[localbroker:dispatcher_ng/items/Gnd/DiningRoom/SmallLight/state:command:*:default],<[localbroker:dispatcher_ng/items/Gnd/DiningRoom/SmallLight/state/feedback:state:default]"}
|
||||
Switch Gnd_DiningRoom_StandLight "Stehlampe Esszimmer"{mqtt=">[localbroker:dispatcher_ng/items/Gnd/DiningRoom/StandLight/state:command:*:default],<[localbroker:dispatcher_ng/items/Gnd/DiningRoom/StandLight/state/feedback:state:default]"}
|
||||
Switch Gnd_DiningRoom_CupboardLight "Schranklicht Esszimmer"{mqtt=">[localbroker:dispatcher_ng/items/Gnd/DiningRoom/CupboardLight/state:command:*:default],<[localbroker:dispatcher_ng/items/Gnd/DiningRoom/CupboardLight/state/feedback:state:default]"}
|
||||
@ -44,6 +45,7 @@ Contact Gnd_Kitchen_WindowContact3 "Fenster Küche Straße 1" {mqtt="<[localbrok
|
||||
Contact Gnd_Kitchen_WindowContact4 "Fenster Küche Straße 2" {mqtt="<[localbroker:dispatcher_ng/items/Gnd/Kitchen/WindowContact4/state/feedback:state:default]"}
|
||||
Number Gnd_Kitchen_Thermostat "Thermostat Küche [%.1f °C]" {mqtt=">[localbroker:dispatcher_ng/items/Gnd/Kitchen/Thermostat/temperature:command:*:default],<[localbroker:dispatcher_ng/items/Gnd/Kitchen/Thermostat/temperature/feedback:state:default]"}
|
||||
Number Preset_Gnd_Kitchen_Thermostat "Preset_Thermostat Küche [%.1f °C]" {mqtt=">[localbroker:dispatcher_ng/items/Gnd/Kitchen/Thermostat/presetTemperature:command:*:default],<[localbroker:dispatcher_ng/items/Gnd/Kitchen/Thermostat/presetTemperature/feedback:state:default]"}
|
||||
Contact Gnd_Hallway_FrontdoorContact "Haustür" {mqtt="<[localbroker:dispatcher_ng/items/Gnd/Hallway/FrontdoorContact/state/feedback:state:default]"}
|
||||
Switch base_labor_relaybox0 "Küche" {mqtt=">[localbroker:dispatcher_ng/items/base/labor/relaybox/state/0:command:*:default],<[localbroker:dispatcher_ng/items/base/labor/relaybox/feedback/0:state:default]"}
|
||||
String base_labor_relaybox0Conflict "Küche [%s]" {mqtt="<[localbroker:dispatcher_ng/items/base/labor/relaybox/conflict/0:state:default]"}
|
||||
Switch base_labor_relaybox1 "Herd" {mqtt=">[localbroker:dispatcher_ng/items/base/labor/relaybox/state/1:command:*:default],<[localbroker:dispatcher_ng/items/base/labor/relaybox/feedback/1:state:default]"}
|
||||
|
16
src/HeatingScene.ts
Normal file
16
src/HeatingScene.ts
Normal file
@ -0,0 +1,16 @@
|
||||
import { Forwarder } from './Forwarder'
|
||||
import { HasInTopic } from './AItem'
|
||||
|
||||
export class HeatingScene extends Forwarder {
|
||||
constructor(floor: string, room: string, item: string, label: string,
|
||||
targetItems: HasInTopic[]) {
|
||||
|
||||
let inTopics: string[] = []
|
||||
targetItems.forEach((item: HasInTopic) => {
|
||||
inTopics.push(item.getInTopic())
|
||||
})
|
||||
|
||||
super(floor, room, item, "command", label, inTopics)
|
||||
}
|
||||
|
||||
}
|
@ -81,20 +81,23 @@ export class MaxThermostat extends AHomegearItem implements HasInTopic {
|
||||
this.temperature = parseFloat(payload)
|
||||
setTemperature = true
|
||||
} else if (topic == this.commandTopic) {
|
||||
if (this.heatingMainFlag) {
|
||||
if (payload == 'ON') {
|
||||
this.temperature = this.presetTemperature
|
||||
} else if (payload == 'OFF') {
|
||||
this.temperature = DISABLED_TEMPERATURE
|
||||
}
|
||||
if ((payload == 'ON') && this.heatingMainFlag) {
|
||||
this.temperature = this.presetTemperature
|
||||
setTemperature = true
|
||||
} else if (payload == 'OFF') {
|
||||
this.temperature = DISABLED_TEMPERATURE
|
||||
setTemperature = true
|
||||
} else if (payload == 'FORCE_ON') {
|
||||
this.temperature = this.presetTemperature
|
||||
setTemperature = true
|
||||
}
|
||||
} else if (topic == MaxThermostat.heatingMainSwitchTopic) {
|
||||
this.heatingMainFlag = (payload == 'ON')
|
||||
logger.info(`${this.itemId} heating main: ${this.heatingMainFlag}`)
|
||||
if (! this.heatingMainFlag) {
|
||||
mqttHandler.send(this.temperatureFeedbackTopic, `${DISABLED_TEMPERATURE}`)
|
||||
mqttHandler.send(this.actionTopic, `${DISABLED_TEMPERATURE}`)
|
||||
this.temperature = DISABLED_TEMPERATURE
|
||||
mqttHandler.send(this.temperatureFeedbackTopic, `${this.temperature}`)
|
||||
mqttHandler.send(this.actionTopic, `${this.temperature}`)
|
||||
}
|
||||
} else if (topic == this.presetTemperatureTopic) {
|
||||
this.presetTemperature = parseFloat(payload)
|
||||
|
18
src/main.ts
18
src/main.ts
@ -4,7 +4,7 @@ import * as config from './config'
|
||||
import * as logger from './log'
|
||||
import { mqttHandler } from './MqttDispatcher'
|
||||
|
||||
import { AItem } from './AItem'
|
||||
import { AItem, HasInTopic } from './AItem'
|
||||
import { HomekitExportType, ExportType } from './Export'
|
||||
import { M433SwitchItem } from './M433SwitchItem'
|
||||
import { HomematicFourButtonThing, HomematicFourButtonSingleItem } from './HomematicFourButtonThing'
|
||||
@ -22,12 +22,13 @@ import { Cron } from './Cron'
|
||||
import { HueColorBulbItem } from './HueColorBulbItem'
|
||||
import { TouchSwitchMultiButtonThing, TouchSwitchButtonSingleItem } from './TouchSwitchMultiButtonThing'
|
||||
import { RelayBoxThing } from './RelayBox'
|
||||
import { HeatingScene } from './HeatingScene'
|
||||
|
||||
|
||||
logger.info("Dispatcher starting")
|
||||
|
||||
let allLabeledItems : Array<AItem> = new Array()
|
||||
|
||||
let allThermostatItems : Array<HasInTopic> = new Array()
|
||||
|
||||
// Anna -----------------------------------------------------------------------------------------------------
|
||||
// Anna Aquarium 14665044 24 1 14665041 24 1
|
||||
@ -60,6 +61,8 @@ let thermostatAnna1st = new MaxThermostat('1st', 'Anna', 'Thermostat', 'Thermost
|
||||
thermostatAnna1st.start()
|
||||
thermostatAnna1st.setPresetTemperature(21.0)
|
||||
allLabeledItems.push(thermostatAnna1st)
|
||||
allThermostatItems.push(thermostatAnna1st)
|
||||
|
||||
|
||||
let thermostatAnna1stCron = new Cron('thermostatAnna1stCron', thermostatAnna1st, [
|
||||
{cronTime: '00 05 06 * * *', output: 'ON'},
|
||||
@ -89,6 +92,10 @@ let matthiasSpeaker = new M433SwitchItem('1st', 'Matthias', 'Speaker', 'Lautspre
|
||||
matthiasSpeaker.start()
|
||||
allLabeledItems.push(matthiasSpeaker)
|
||||
|
||||
let windowContactMatthias = new MaxWindowContact('1st', 'Matthias', 'WindowContact', 'Fenster', 24)
|
||||
windowContactMatthias.start()
|
||||
allLabeledItems.push(windowContactMatthias)
|
||||
|
||||
// Esszimmer ------------------------------------------------------------------------------------------------
|
||||
// Esszimmer kleine Lampe 69653 24 1 69652 24 1
|
||||
let diningRoomSmallLight = new M433SwitchItem('Gnd', 'DiningRoom', 'SmallLight', 'kleine Lampe Esszimmer', '69653 24 1', '69652 24 1')
|
||||
@ -208,6 +215,7 @@ let thermostatBedroom1st = new MaxThermostat('1st', 'Bedroom', 'Thermostat', 'Th
|
||||
thermostatBedroom1st.start()
|
||||
thermostatBedroom1st.setPresetTemperature(20.0)
|
||||
allLabeledItems.push(thermostatBedroom1st)
|
||||
allThermostatItems.push(thermostatBedroom1st)
|
||||
|
||||
let thermostatBedroom1stCron = new Cron('thermostatBedroom1stCron', thermostatBedroom1st, [
|
||||
{cronTime: '00 01 06 * * 1-5', output: 'ON'},
|
||||
@ -271,6 +279,7 @@ let thermostatBathroomGnd = new MaxThermostat('Gnd', 'Bathroom', 'Thermostat', '
|
||||
thermostatBathroomGnd.start()
|
||||
thermostatBathroomGnd.setPresetTemperature(20.0)
|
||||
allLabeledItems.push(thermostatBathroomGnd)
|
||||
allThermostatItems.push(thermostatBathroomGnd)
|
||||
|
||||
let thermostatBathroomGndCron = new Cron('thermostatBathroomGndCron', thermostatBathroomGnd, [
|
||||
{cronTime: '00 02 06 * * 1-5', output: 'ON'},
|
||||
@ -290,6 +299,7 @@ let thermostatBathroom1st = new MaxThermostat('1st', 'Bathroom', 'Thermostat', '
|
||||
thermostatBathroom1st.start()
|
||||
thermostatBathroom1st.setPresetTemperature(20.0)
|
||||
allLabeledItems.push(thermostatBathroom1st)
|
||||
allThermostatItems.push(thermostatBathroom1st)
|
||||
|
||||
let thermostatBathroom1stCron = new Cron('thermostatBathroom1stCron', thermostatBathroom1st, [
|
||||
{cronTime: '00 00 06 * * 1-5', output: 'ON'},
|
||||
@ -320,6 +330,7 @@ let thermostatKitchen = new MaxThermostat('Gnd', 'Kitchen', 'Thermostat', 'Therm
|
||||
thermostatKitchen.start()
|
||||
thermostatKitchen.setPresetTemperature(20.0)
|
||||
allLabeledItems.push(thermostatKitchen)
|
||||
allThermostatItems.push(thermostatKitchen)
|
||||
|
||||
let thermostatKitchenCron = new Cron('thermostatKitchenCron', thermostatKitchen, [
|
||||
{cronTime: '00 00 06 * * 1-5', output: 'ON'},
|
||||
@ -345,6 +356,9 @@ relayBox.start()
|
||||
allLabeledItems.push(relayBox)
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------------------------------------------
|
||||
let heatingSceneAll = new HeatingScene('Gnd', 'House', 'Heatings', 'Alle Heizungen', allThermostatItems)
|
||||
heatingSceneAll.start()
|
||||
|
||||
// ----------------------------------------------------------------------------------------------------------
|
||||
let testFourButton = new HomematicFourButtonThing('Gnd', 'Hallway', 'TestButton', 9, [
|
||||
|
Reference in New Issue
Block a user