debug keller licht
This commit is contained in:
2
dist/HomematicSwitchItem.js
vendored
2
dist/HomematicSwitchItem.js
vendored
@ -32,7 +32,6 @@ class HomematicSwitchItem extends AHomegearItem_1.AHomegearItem {
|
|||||||
return Export_1.SwitchExport(this.itemId, this.label, this.stateTopic, this.stateFeedbackTopic, this.type);
|
return Export_1.SwitchExport(this.itemId, this.label, this.stateTopic, this.stateFeedbackTopic, this.type);
|
||||||
}
|
}
|
||||||
processMessage(topic, payload) {
|
processMessage(topic, payload) {
|
||||||
this.emit('somethingChanged');
|
|
||||||
switch (topic) {
|
switch (topic) {
|
||||||
case this.stateTopic:
|
case this.stateTopic:
|
||||||
this.state = payload;
|
this.state = payload;
|
||||||
@ -58,6 +57,7 @@ class HomematicSwitchItem extends AHomegearItem_1.AHomegearItem {
|
|||||||
MqttDispatcher_1.mqttHandler.send(this.stateFeedbackTopic, this.state);
|
MqttDispatcher_1.mqttHandler.send(this.stateFeedbackTopic, this.state);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
this.emit('somethingChanged');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
exports.HomematicSwitchItem = HomematicSwitchItem;
|
exports.HomematicSwitchItem = HomematicSwitchItem;
|
||||||
|
12
dist/main.js
vendored
12
dist/main.js
vendored
@ -367,11 +367,21 @@ let basementSmallLight = new HomematicSwitchItem_1.HomematicSwitchItem('Base', '
|
|||||||
basementSmallLight.start();
|
basementSmallLight.start();
|
||||||
allLabeledItems.push(basementSmallLight);
|
allLabeledItems.push(basementSmallLight);
|
||||||
allRelevantLights.push(basementSmallLight);
|
allRelevantLights.push(basementSmallLight);
|
||||||
|
basementSmallLight.on('somethingChanged', () => {
|
||||||
|
if ((basementLargeLight.getState() == 'OFF') && (basementSmallLight.getState() == 'ON')) {
|
||||||
|
setTimeout(() => {
|
||||||
|
MqttDispatcher_1.mqttHandler.send(basementSmallLight.getStateTopic(), 'OFF');
|
||||||
|
}, (3 * 1000));
|
||||||
|
}
|
||||||
|
else if ((basementLargeLight.getState() == 'ON') && (basementSmallLight.getState() == 'OFF')) {
|
||||||
|
MqttDispatcher_1.mqttHandler.send(basementLargeLight.getStateTopic(), 'OFF');
|
||||||
|
}
|
||||||
|
});
|
||||||
let basementLargeLight = new HomematicSwitchItem_1.HomematicSwitchItem('Base', 'Hallway', 'LargeLight', 'Licht Keller hell', 35, 2);
|
let basementLargeLight = new HomematicSwitchItem_1.HomematicSwitchItem('Base', 'Hallway', 'LargeLight', 'Licht Keller hell', 35, 2);
|
||||||
basementLargeLight.start();
|
basementLargeLight.start();
|
||||||
allLabeledItems.push(basementLargeLight);
|
allLabeledItems.push(basementLargeLight);
|
||||||
allRelevantLights.push(basementLargeLight);
|
allRelevantLights.push(basementLargeLight);
|
||||||
basementLargeLight.on('somethingChange', () => {
|
basementLargeLight.on('somethingChanged', () => {
|
||||||
if (basementLargeLight.getState() == 'ON') {
|
if (basementLargeLight.getState() == 'ON') {
|
||||||
MqttDispatcher_1.mqttHandler.send(basementSmallLight.getStateTopic(), 'ON');
|
MqttDispatcher_1.mqttHandler.send(basementSmallLight.getStateTopic(), 'ON');
|
||||||
}
|
}
|
||||||
|
53
homekit.json
53
homekit.json
@ -742,5 +742,56 @@
|
|||||||
"onContactDetected": "CLOSED"
|
"onContactDetected": "CLOSED"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"": {}
|
"": {},
|
||||||
|
"Base_Workshop_Light": {
|
||||||
|
"id": "Base_Workshop_Light",
|
||||||
|
"name": "Licht Werkstatt",
|
||||||
|
"service": "Lightbulb",
|
||||||
|
"topic": {
|
||||||
|
"setOn": "dispatcher_ng/items/Base/Workshop/Light/state",
|
||||||
|
"statusOn": "dispatcher_ng/items/Base/Workshop/Light/state/feedback"
|
||||||
|
},
|
||||||
|
"payload": {
|
||||||
|
"onTrue": "ON",
|
||||||
|
"onFalse": "OFF",
|
||||||
|
"brightnessFactor": "",
|
||||||
|
"hueFactor": "",
|
||||||
|
"saturationFactor": ""
|
||||||
|
},
|
||||||
|
"config": {}
|
||||||
|
},
|
||||||
|
"Base_Hallway_SmallLight": {
|
||||||
|
"id": "Base_Hallway_SmallLight",
|
||||||
|
"name": "Licht Keller einfach",
|
||||||
|
"service": "Lightbulb",
|
||||||
|
"topic": {
|
||||||
|
"setOn": "dispatcher_ng/items/Base/Hallway/SmallLight/state",
|
||||||
|
"statusOn": "dispatcher_ng/items/Base/Hallway/SmallLight/state/feedback"
|
||||||
|
},
|
||||||
|
"payload": {
|
||||||
|
"onTrue": "ON",
|
||||||
|
"onFalse": "OFF",
|
||||||
|
"brightnessFactor": "",
|
||||||
|
"hueFactor": "",
|
||||||
|
"saturationFactor": ""
|
||||||
|
},
|
||||||
|
"config": {}
|
||||||
|
},
|
||||||
|
"Base_Hallway_LargeLight": {
|
||||||
|
"id": "Base_Hallway_LargeLight",
|
||||||
|
"name": "Licht Keller hell",
|
||||||
|
"service": "Lightbulb",
|
||||||
|
"topic": {
|
||||||
|
"setOn": "dispatcher_ng/items/Base/Hallway/LargeLight/state",
|
||||||
|
"statusOn": "dispatcher_ng/items/Base/Hallway/LargeLight/state/feedback"
|
||||||
|
},
|
||||||
|
"payload": {
|
||||||
|
"onTrue": "ON",
|
||||||
|
"onFalse": "OFF",
|
||||||
|
"brightnessFactor": "",
|
||||||
|
"hueFactor": "",
|
||||||
|
"saturationFactor": ""
|
||||||
|
},
|
||||||
|
"config": {}
|
||||||
|
}
|
||||||
}
|
}
|
@ -65,4 +65,7 @@ Switch base_labor_relaybox1 "Herd" {mqtt=">[localbroker:dispatcher_ng/items/base
|
|||||||
String base_labor_relaybox1Conflict "Herd [%s]" {mqtt="<[localbroker:dispatcher_ng/items/base/labor/relaybox/conflict/1:state:default]"}
|
String base_labor_relaybox1Conflict "Herd [%s]" {mqtt="<[localbroker:dispatcher_ng/items/base/labor/relaybox/conflict/1:state:default]"}
|
||||||
Switch base_labor_relaybox2 "Waschküche" {mqtt=">[localbroker:dispatcher_ng/items/base/labor/relaybox/state/2:command:*:default],<[localbroker:dispatcher_ng/items/base/labor/relaybox/feedback/2:state:default]"}
|
Switch base_labor_relaybox2 "Waschküche" {mqtt=">[localbroker:dispatcher_ng/items/base/labor/relaybox/state/2:command:*:default],<[localbroker:dispatcher_ng/items/base/labor/relaybox/feedback/2:state:default]"}
|
||||||
String base_labor_relaybox2Conflict "Waschküche [%s]" {mqtt="<[localbroker:dispatcher_ng/items/base/labor/relaybox/conflict/2:state:default]"}
|
String base_labor_relaybox2Conflict "Waschküche [%s]" {mqtt="<[localbroker:dispatcher_ng/items/base/labor/relaybox/conflict/2:state:default]"}
|
||||||
|
Switch Base_Workshop_Light "Licht Werkstatt"{mqtt=">[localbroker:dispatcher_ng/items/Base/Workshop/Light/state:command:*:default],<[localbroker:dispatcher_ng/items/Base/Workshop/Light/state/feedback:state:default]"}
|
||||||
|
Switch Base_Hallway_SmallLight "Licht Keller einfach"{mqtt=">[localbroker:dispatcher_ng/items/Base/Hallway/SmallLight/state:command:*:default],<[localbroker:dispatcher_ng/items/Base/Hallway/SmallLight/state/feedback:state:default]"}
|
||||||
|
Switch Base_Hallway_LargeLight "Licht Keller hell"{mqtt=">[localbroker:dispatcher_ng/items/Base/Hallway/LargeLight/state:command:*:default],<[localbroker:dispatcher_ng/items/Base/Hallway/LargeLight/state/feedback:state:default]"}
|
||||||
Switch HeatingMainSwitch "Heizung Hauptschalter" {mqtt=">[localbroker:dispatcher_ng/items/heatingMainSwitch:command:*:default],<[localbroker:dispatcher_ng/items/heatingMainSwitch:state:default]"}
|
Switch HeatingMainSwitch "Heizung Hauptschalter" {mqtt=">[localbroker:dispatcher_ng/items/heatingMainSwitch:command:*:default],<[localbroker:dispatcher_ng/items/heatingMainSwitch:state:default]"}
|
@ -47,7 +47,6 @@ export class HomematicSwitchItem extends AHomegearItem implements HasStateAndFee
|
|||||||
}
|
}
|
||||||
|
|
||||||
processMessage(topic: string, payload: string) : void {
|
processMessage(topic: string, payload: string) : void {
|
||||||
this.emit('somethingChanged')
|
|
||||||
switch (topic) {
|
switch (topic) {
|
||||||
case this.stateTopic:
|
case this.stateTopic:
|
||||||
this.state = payload
|
this.state = payload
|
||||||
@ -71,5 +70,6 @@ export class HomematicSwitchItem extends AHomegearItem implements HasStateAndFee
|
|||||||
mqttHandler.send(this.stateFeedbackTopic, this.state)
|
mqttHandler.send(this.stateFeedbackTopic, this.state)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
this.emit('somethingChanged')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
11
src/main.ts
11
src/main.ts
@ -458,12 +458,21 @@ let basementSmallLight = new HomematicSwitchItem('Base', 'Hallway', 'SmallLight'
|
|||||||
basementSmallLight.start()
|
basementSmallLight.start()
|
||||||
allLabeledItems.push(basementSmallLight)
|
allLabeledItems.push(basementSmallLight)
|
||||||
allRelevantLights.push(basementSmallLight)
|
allRelevantLights.push(basementSmallLight)
|
||||||
|
basementSmallLight.on('somethingChanged', () => {
|
||||||
|
if ((basementLargeLight.getState() == 'OFF') && (basementSmallLight.getState() == 'ON')) {
|
||||||
|
setTimeout(() => {
|
||||||
|
mqttHandler.send(basementSmallLight.getStateTopic(), 'OFF')
|
||||||
|
}, (3 * 1000))
|
||||||
|
} else if ((basementLargeLight.getState() == 'ON') && (basementSmallLight.getState() == 'OFF')) {
|
||||||
|
mqttHandler.send(basementLargeLight.getStateTopic(), 'OFF')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
let basementLargeLight = new HomematicSwitchItem('Base', 'Hallway', 'LargeLight', 'Licht Keller hell', 35, 2)
|
let basementLargeLight = new HomematicSwitchItem('Base', 'Hallway', 'LargeLight', 'Licht Keller hell', 35, 2)
|
||||||
basementLargeLight.start()
|
basementLargeLight.start()
|
||||||
allLabeledItems.push(basementLargeLight)
|
allLabeledItems.push(basementLargeLight)
|
||||||
allRelevantLights.push(basementLargeLight)
|
allRelevantLights.push(basementLargeLight)
|
||||||
basementLargeLight.on('somethingChange', () => {
|
basementLargeLight.on('somethingChanged', () => {
|
||||||
if (basementLargeLight.getState() == 'ON') {
|
if (basementLargeLight.getState() == 'ON') {
|
||||||
mqttHandler.send(basementSmallLight.getStateTopic(), 'ON')
|
mqttHandler.send(basementSmallLight.getStateTopic(), 'ON')
|
||||||
} else if (basementLargeLight.getState() == 'OFF') {
|
} else if (basementLargeLight.getState() == 'OFF') {
|
||||||
|
Reference in New Issue
Block a user