export stuff

This commit is contained in:
Wolfgang Hottgenroth
2018-04-02 23:03:10 +02:00
parent d586ab6860
commit e883c9a791
6 changed files with 81 additions and 63 deletions

6
dist/Export.js vendored
View File

@ -106,14 +106,14 @@ function ContactHomekitExport(id, label, status) {
} }
function SwitchOpenHABExport(id, label, setOn, statusOn) { function SwitchOpenHABExport(id, label, setOn, statusOn) {
// Switch windowLightKitchen {mqtt=">[localbroker:nodered/items/windowLightKitchen:command:*:default]", mqtt="<[localbroker:nodered/items/windowLightKitchen/feedback:state:default]"} // Switch windowLightKitchen {mqtt=">[localbroker:nodered/items/windowLightKitchen:command:*:default]", mqtt="<[localbroker:nodered/items/windowLightKitchen/feedback:state:default]"}
return `Switch ${id} {mqtt=">[localbroker:${setOn}:command:*:default],<[localbroker:${statusOn}:state:default]"}`; return `Switch ${id} "${label}"{mqtt=">[localbroker:${setOn}:command:*:default],<[localbroker:${statusOn}:state:default]"}`;
} }
function ContactOpenHABExport(id, label, status) { function ContactOpenHABExport(id, label, status) {
// Switch windowLightKitchen {mqtt=">[localbroker:nodered/items/windowLightKitchen:command:*:default]", mqtt="<[localbroker:nodered/items/windowLightKitchen/feedback:state:default]"} // Switch windowLightKitchen {mqtt=">[localbroker:nodered/items/windowLightKitchen:command:*:default]", mqtt="<[localbroker:nodered/items/windowLightKitchen/feedback:state:default]"}
return `Switch ${id} {mqtt="<[localbroker:${status}:state:default]"}`; return `Contact ${id} "${label}" {mqtt="<[localbroker:${status}:state:default]"}`;
} }
function ThermostatOpenHAPExport(id, label, setTemperature, statusTemperature) { function ThermostatOpenHAPExport(id, label, setTemperature, statusTemperature) {
return `Number ${id} {mqtt=">[localbroker:${setTemperature}:command:*:default],<[localbroker:${statusTemperature}:state:default]"}`; return `Number ${id} "${label}" {mqtt=">[localbroker:${setTemperature}:command:*:default],<[localbroker:${statusTemperature}:state:default]"}`;
} }
function HueColorLightHomekitExport(id, label, stateTopic, stateFeedbackTopic, brightnessTopic, brightnessFeedbackTopic, hueTopic, hueFeedbackTopic, saturationTopic, saturationFeedbackTopic, colorTemperatureTopic, colorTemperatureFeedbackTopic) { function HueColorLightHomekitExport(id, label, stateTopic, stateFeedbackTopic, brightnessTopic, brightnessFeedbackTopic, hueTopic, hueFeedbackTopic, saturationTopic, saturationFeedbackTopic, colorTemperatureTopic, colorTemperatureFeedbackTopic) {
let o = { let o = {

17
dist/main.js vendored
View File

@ -151,18 +151,21 @@ allLabeledItems.push(bedRoomWindowLight);
let windowContactBedroomStreet1st = new MaxWindowContact_1.MaxWindowContact('1st', 'Bedroom', 'WindowContactStreet', 'Fenster Schlafzimmer Strasse', 17); let windowContactBedroomStreet1st = new MaxWindowContact_1.MaxWindowContact('1st', 'Bedroom', 'WindowContactStreet', 'Fenster Schlafzimmer Strasse', 17);
windowContactBedroomStreet1st.start(); windowContactBedroomStreet1st.start();
allLabeledItems.push(windowContactBedroomStreet1st); allLabeledItems.push(windowContactBedroomStreet1st);
let windowContactBedroomGarden1st = new MaxWindowContact_1.MaxWindowContact('1st', 'Bedroom', 'WindowContactGarden', 'Fenster Schlafzimmer Garten', 18); let windowContact1BedroomGarden1st = new MaxWindowContact_1.MaxWindowContact('1st', 'Bedroom', 'WindowContact1Garden', 'Fenster Schlafzimmer 1 Garten', 18);
windowContactBedroomGarden1st.start(); windowContact1BedroomGarden1st.start();
allLabeledItems.push(windowContactBedroomGarden1st); allLabeledItems.push(windowContact1BedroomGarden1st);
let thermostatBedroom1st = new MaxThermostat_1.MaxThermostat('1st', 'Bedroom', 'Thermostat', 'Thermostat Schlafzimmer', 19, [windowContactBedroomGarden1st, windowContactBedroomStreet1st]); let windowContact2BedroomGarden1st = new MaxWindowContact_1.MaxWindowContact('1st', 'Bedroom', 'WindowContact2Garden', 'Fenster Schlafzimmer 2 Garten', 22);
windowContact2BedroomGarden1st.start();
allLabeledItems.push(windowContact2BedroomGarden1st);
let thermostatBedroom1st = new MaxThermostat_1.MaxThermostat('1st', 'Bedroom', 'Thermostat', 'Thermostat Schlafzimmer', 19, [windowContact1BedroomGarden1st, windowContact2BedroomGarden1st, windowContactBedroomStreet1st]);
thermostatBedroom1st.start(); thermostatBedroom1st.start();
allLabeledItems.push(thermostatBedroom1st); allLabeledItems.push(thermostatBedroom1st);
let thermostatBedroom1stCron = new Cron_1.Cron('thermostatBedroom1stCron', thermostatBedroom1st, [ let thermostatBedroom1stCron = new Cron_1.Cron('thermostatBedroom1stCron', thermostatBedroom1st, [
{ cronTime: '00 01 06 * * 1-5', output: '21.0' }, { cronTime: '00 01 06 * * 1-5', output: '19.0' },
{ cronTime: '00 01 09 * * 1-5', output: '5.0' }, { cronTime: '00 01 09 * * 1-5', output: '5.0' },
{ cronTime: '00 01 08 * * 6,0', output: '21.0' }, { cronTime: '00 01 08 * * 6,0', output: '19.0' },
{ cronTime: '00 01 11 * * 6,0', output: '5.0' }, { cronTime: '00 01 11 * * 6,0', output: '5.0' },
{ cronTime: '00 00 17 * * *', output: '23.0' }, { cronTime: '00 00 17 * * *', output: '20.0' },
{ cronTime: '00 59 23 * * *', output: '5.0' } { cronTime: '00 59 23 * * *', output: '5.0' }
]); ]);
thermostatBedroom1stCron.start(); thermostatBedroom1stCron.start();

View File

@ -438,12 +438,23 @@
"onContactDetected": "CLOSED" "onContactDetected": "CLOSED"
} }
}, },
"1st_Bedroom_WindowContactGarden": { "1st_Bedroom_WindowContact1Garden": {
"id": "1st_Bedroom_WindowContactGarden", "id": "1st_Bedroom_WindowContact1Garden",
"name": "Fenster Schlafzimmer Garten", "name": "Fenster Schlafzimmer 1 Garten",
"service": "ContactSensor", "service": "ContactSensor",
"topic": { "topic": {
"statusContactSensorState": "dispatcher_ng/items/1st/Bedroom/WindowContactGarden/state/feedback" "statusContactSensorState": "dispatcher_ng/items/1st/Bedroom/WindowContact1Garden/state/feedback"
},
"payload": {
"onContactDetected": "CLOSED"
}
},
"1st_Bedroom_WindowContact2Garden": {
"id": "1st_Bedroom_WindowContact2Garden",
"name": "Fenster Schlafzimmer 2 Garten",
"service": "ContactSensor",
"topic": {
"statusContactSensorState": "dispatcher_ng/items/1st/Bedroom/WindowContact2Garden/state/feedback"
}, },
"payload": { "payload": {
"onContactDetected": "CLOSED" "onContactDetected": "CLOSED"

View File

@ -1,40 +1,41 @@
Switch 1st_Anna_AquariumLight {mqtt=">[localbroker:dispatcher_ng/items/1st/Anna/AquariumLight/state:command:*:default],<[localbroker:dispatcher_ng/items/1st/Anna/AquariumLight/state/feedback:state:default]"} Switch 1st_Anna_AquariumLight "Aquariumlicht"{mqtt=">[localbroker:dispatcher_ng/items/1st/Anna/AquariumLight/state:command:*:default],<[localbroker:dispatcher_ng/items/1st/Anna/AquariumLight/state/feedback:state:default]"}
Switch 1st_Anna_BedLight {mqtt=">[localbroker:dispatcher_ng/items/1st/Anna/BedLight/state:command:*:default],<[localbroker:dispatcher_ng/items/1st/Anna/BedLight/state/feedback:state:default]"} Switch 1st_Anna_BedLight "Bettlicht Anna"{mqtt=">[localbroker:dispatcher_ng/items/1st/Anna/BedLight/state:command:*:default],<[localbroker:dispatcher_ng/items/1st/Anna/BedLight/state/feedback:state:default]"}
Switch 1st_Anna_WindowContact {mqtt="<[localbroker:dispatcher_ng/items/1st/Anna/WindowContact/state/feedback:state:default]"} Contact 1st_Anna_WindowContact "Fenster Anna" {mqtt="<[localbroker:dispatcher_ng/items/1st/Anna/WindowContact/state/feedback:state:default]"}
Number 1st_Anna_Thermostat {mqtt=">[localbroker:dispatcher_ng/items/1st/Anna/Thermostat/temperature:command:*:default],<[localbroker:dispatcher_ng/items/1st/Anna/Thermostat/temperature/feedback:state:default]"} Number 1st_Anna_Thermostat "Thermostat Anna" {mqtt=">[localbroker:dispatcher_ng/items/1st/Anna/Thermostat/temperature:command:*:default],<[localbroker:dispatcher_ng/items/1st/Anna/Thermostat/temperature/feedback:state:default]"}
Switch 1st_Matthias_StandLight {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_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 {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_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 {mqtt=">[localbroker:dispatcher_ng/items/1st/Matthias/Speaker/state:command:*:default],<[localbroker:dispatcher_ng/items/1st/Matthias/Speaker/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]"}
Switch Gnd_DiningRoom_SmallLight {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_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 {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_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 {mqtt=">[localbroker:dispatcher_ng/items/Gnd/DiningRoom/CupboardLight/state:command:*:default],<[localbroker:dispatcher_ng/items/Gnd/DiningRoom/CupboardLight/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]"}
Switch Gnd_DiningRoom_ShelfLight {mqtt=">[localbroker:dispatcher_ng/items/Gnd/DiningRoom/ShelfLight/state:command:*:default],<[localbroker:dispatcher_ng/items/Gnd/DiningRoom/ShelfLight/state/feedback:state:default]"} Switch Gnd_DiningRoom_ShelfLight "Regallicht Esszimmer"{mqtt=">[localbroker:dispatcher_ng/items/Gnd/DiningRoom/ShelfLight/state:command:*:default],<[localbroker:dispatcher_ng/items/Gnd/DiningRoom/ShelfLight/state/feedback:state:default]"}
Switch Gnd_LivingRoom_LargeLight {mqtt=">[localbroker:dispatcher_ng/items/Gnd/LivingRoom/LargeLight/state:command:*:default],<[localbroker:dispatcher_ng/items/Gnd/LivingRoom/LargeLight/state/feedback:state:default]"} Switch Gnd_LivingRoom_LargeLight "große Lampe Wohnzimmer"{mqtt=">[localbroker:dispatcher_ng/items/Gnd/LivingRoom/LargeLight/state:command:*:default],<[localbroker:dispatcher_ng/items/Gnd/LivingRoom/LargeLight/state/feedback:state:default]"}
Switch Gnd_LivingRoom_SmallLight {mqtt=">[localbroker:dispatcher_ng/items/Gnd/LivingRoom/SmallLight/state:command:*:default],<[localbroker:dispatcher_ng/items/Gnd/LivingRoom/SmallLight/state/feedback:state:default]"} Switch Gnd_LivingRoom_SmallLight "kleine Lampe Wohnzimmer"{mqtt=">[localbroker:dispatcher_ng/items/Gnd/LivingRoom/SmallLight/state:command:*:default],<[localbroker:dispatcher_ng/items/Gnd/LivingRoom/SmallLight/state/feedback:state:default]"}
Switch Gnd_LivingRoom_Stars {mqtt=">[localbroker:dispatcher_ng/items/Gnd/LivingRoom/Stars/state:command:*:default],<[localbroker:dispatcher_ng/items/Gnd/LivingRoom/Stars/state/feedback:state:default]"} Switch Gnd_LivingRoom_Stars "Sterne Wohnzimmer"{mqtt=">[localbroker:dispatcher_ng/items/Gnd/LivingRoom/Stars/state:command:*:default],<[localbroker:dispatcher_ng/items/Gnd/LivingRoom/Stars/state/feedback:state:default]"}
Switch Gnd_LivingRoom_StandLight {mqtt=">[localbroker:dispatcher_ng/items/Gnd/LivingRoom/StandLight/state:command:*:default],<[localbroker:dispatcher_ng/items/Gnd/LivingRoom/StandLight/state/feedback:state:default]"} Switch Gnd_LivingRoom_StandLight "Stehlampe Wohnzimmer"{mqtt=">[localbroker:dispatcher_ng/items/Gnd/LivingRoom/StandLight/state:command:*:default],<[localbroker:dispatcher_ng/items/Gnd/LivingRoom/StandLight/state/feedback:state:default]"}
Switch Gnd_Hallway_DeskLight {mqtt=">[localbroker:dispatcher_ng/items/Gnd/Hallway/DeskLight/state:command:*:default],<[localbroker:dispatcher_ng/items/Gnd/Hallway/DeskLight/state/feedback:state:default]"} Switch Gnd_Hallway_DeskLight "Schreibtischlampe Flur"{mqtt=">[localbroker:dispatcher_ng/items/Gnd/Hallway/DeskLight/state:command:*:default],<[localbroker:dispatcher_ng/items/Gnd/Hallway/DeskLight/state/feedback:state:default]"}
Switch Gnd_Hallway_StandLight {mqtt=">[localbroker:dispatcher_ng/items/Gnd/Hallway/StandLight/state:command:*:default],<[localbroker:dispatcher_ng/items/Gnd/Hallway/StandLight/state/feedback:state:default]"} Switch Gnd_Hallway_StandLight "Stehlampe Flur"{mqtt=">[localbroker:dispatcher_ng/items/Gnd/Hallway/StandLight/state:command:*:default],<[localbroker:dispatcher_ng/items/Gnd/Hallway/StandLight/state/feedback:state:default]"}
Switch Gnd_Hallway_WardrobeLight {mqtt=">[localbroker:dispatcher_ng/items/Gnd/Hallway/WardrobeLight/state:command:*:default],<[localbroker:dispatcher_ng/items/Gnd/Hallway/WardrobeLight/state/feedback:state:default]"} Switch Gnd_Hallway_WardrobeLight "Schranklicht Flur"{mqtt=">[localbroker:dispatcher_ng/items/Gnd/Hallway/WardrobeLight/state:command:*:default],<[localbroker:dispatcher_ng/items/Gnd/Hallway/WardrobeLight/state/feedback:state:default]"}
Switch Gnd_Kitchen_WindowLight {mqtt=">[localbroker:dispatcher_ng/items/Gnd/Kitchen/WindowLight/state:command:*:default],<[localbroker:dispatcher_ng/items/Gnd/Kitchen/WindowLight/state/feedback:state:default]"} Switch Gnd_Kitchen_WindowLight "Fensterbanklicht Küche"{mqtt=">[localbroker:dispatcher_ng/items/Gnd/Kitchen/WindowLight/state:command:*:default],<[localbroker:dispatcher_ng/items/Gnd/Kitchen/WindowLight/state/feedback:state:default]"}
Switch Gnd_Kitchen_CeilingLight {mqtt=">[localbroker:dispatcher_ng/items/Gnd/Kitchen/CeilingLight/state:command:*:default],<[localbroker:dispatcher_ng/items/Gnd/Kitchen/CeilingLight/state/feedback:state:default]"} Switch Gnd_Kitchen_CeilingLight "Deckenlampe Küche"{mqtt=">[localbroker:dispatcher_ng/items/Gnd/Kitchen/CeilingLight/state:command:*:default],<[localbroker:dispatcher_ng/items/Gnd/Kitchen/CeilingLight/state/feedback:state:default]"}
Switch 1st_BedRoom_WolfgangsSide {mqtt=">[localbroker:dispatcher_ng/items/1st/BedRoom/WolfgangsSide/state:command:*:default],<[localbroker:dispatcher_ng/items/1st/BedRoom/WolfgangsSide/state/feedback:state:default]"} Switch 1st_BedRoom_WolfgangsSide "Wolfgangs Seite Schlafzimmer"{mqtt=">[localbroker:dispatcher_ng/items/1st/BedRoom/WolfgangsSide/state:command:*:default],<[localbroker:dispatcher_ng/items/1st/BedRoom/WolfgangsSide/state/feedback:state:default]"}
Switch 1st_BedRoom_PattysSide {mqtt=">[localbroker:dispatcher_ng/items/1st/BedRoom/PattysSide/state:command:*:default],<[localbroker:dispatcher_ng/items/1st/BedRoom/PattysSide/state/feedback:state:default]"} Switch 1st_BedRoom_PattysSide "Pattys Seite Schlafzimmer"{mqtt=">[localbroker:dispatcher_ng/items/1st/BedRoom/PattysSide/state:command:*:default],<[localbroker:dispatcher_ng/items/1st/BedRoom/PattysSide/state/feedback:state:default]"}
Switch 1st_BedRoom_WindowLight {mqtt=">[localbroker:dispatcher_ng/items/1st/BedRoom/WindowLight/state:command:*:default],<[localbroker:dispatcher_ng/items/1st/BedRoom/WindowLight/state/feedback:state:default]"} Switch 1st_BedRoom_WindowLight "Fensterbanklicht Schlafzimmer"{mqtt=">[localbroker:dispatcher_ng/items/1st/BedRoom/WindowLight/state:command:*:default],<[localbroker:dispatcher_ng/items/1st/BedRoom/WindowLight/state/feedback:state:default]"}
Switch 1st_Bedroom_WindowContactStreet {mqtt="<[localbroker:dispatcher_ng/items/1st/Bedroom/WindowContactStreet/state/feedback:state:default]"} Contact 1st_Bedroom_WindowContactStreet "Fenster Schlafzimmer Strasse" {mqtt="<[localbroker:dispatcher_ng/items/1st/Bedroom/WindowContactStreet/state/feedback:state:default]"}
Switch 1st_Bedroom_WindowContactGarden {mqtt="<[localbroker:dispatcher_ng/items/1st/Bedroom/WindowContactGarden/state/feedback:state:default]"} Contact 1st_Bedroom_WindowContact1Garden "Fenster Schlafzimmer 1 Garten" {mqtt="<[localbroker:dispatcher_ng/items/1st/Bedroom/WindowContact1Garden/state/feedback:state:default]"}
Number 1st_Bedroom_Thermostat {mqtt=">[localbroker:dispatcher_ng/items/1st/Bedroom/Thermostat/temperature:command:*:default],<[localbroker:dispatcher_ng/items/1st/Bedroom/Thermostat/temperature/feedback:state:default]"} Contact 1st_Bedroom_WindowContact2Garden "Fenster Schlafzimmer 2 Garten" {mqtt="<[localbroker:dispatcher_ng/items/1st/Bedroom/WindowContact2Garden/state/feedback:state:default]"}
Switch Gnd_Hallway_DayLight {mqtt=">[localbroker:dispatcher_ng/items/Gnd/Hallway/DayLight/state:command:*:default],<[localbroker:dispatcher_ng/items/Gnd/Hallway/DayLight/state/feedback:state:default]"} Number 1st_Bedroom_Thermostat "Thermostat Schlafzimmer" {mqtt=">[localbroker:dispatcher_ng/items/1st/Bedroom/Thermostat/temperature:command:*:default],<[localbroker:dispatcher_ng/items/1st/Bedroom/Thermostat/temperature/feedback:state:default]"}
Switch Gnd_Hallway_EcoLight {mqtt=">[localbroker:dispatcher_ng/items/Gnd/Hallway/EcoLight/state:command:*:default],<[localbroker:dispatcher_ng/items/Gnd/Hallway/EcoLight/state/feedback:state:default]"} Switch Gnd_Hallway_DayLight "DayLight"{mqtt=">[localbroker:dispatcher_ng/items/Gnd/Hallway/DayLight/state:command:*:default],<[localbroker:dispatcher_ng/items/Gnd/Hallway/DayLight/state/feedback:state:default]"}
Switch Gnd_Hallway_MorningLight {mqtt=">[localbroker:dispatcher_ng/items/Gnd/Hallway/MorningLight/state:command:*:default],<[localbroker:dispatcher_ng/items/Gnd/Hallway/MorningLight/state/feedback:state:default]"} Switch Gnd_Hallway_EcoLight "EcoLight"{mqtt=">[localbroker:dispatcher_ng/items/Gnd/Hallway/EcoLight/state:command:*:default],<[localbroker:dispatcher_ng/items/Gnd/Hallway/EcoLight/state/feedback:state:default]"}
Switch Gnd_Bathroom_WindowContact {mqtt="<[localbroker:dispatcher_ng/items/Gnd/Bathroom/WindowContact/state/feedback:state:default]"} Switch Gnd_Hallway_MorningLight "MorningLight"{mqtt=">[localbroker:dispatcher_ng/items/Gnd/Hallway/MorningLight/state:command:*:default],<[localbroker:dispatcher_ng/items/Gnd/Hallway/MorningLight/state/feedback:state:default]"}
Number Gnd_Bathroom_Thermostat {mqtt=">[localbroker:dispatcher_ng/items/Gnd/Bathroom/Thermostat/temperature:command:*:default],<[localbroker:dispatcher_ng/items/Gnd/Bathroom/Thermostat/temperature/feedback:state:default]"} Contact Gnd_Bathroom_WindowContact "Fenster Bad unten" {mqtt="<[localbroker:dispatcher_ng/items/Gnd/Bathroom/WindowContact/state/feedback:state:default]"}
Switch 1st_Bathroom_WindowContact {mqtt="<[localbroker:dispatcher_ng/items/1st/Bathroom/WindowContact/state/feedback:state:default]"} Number Gnd_Bathroom_Thermostat "Thermostat Bad unten" {mqtt=">[localbroker:dispatcher_ng/items/Gnd/Bathroom/Thermostat/temperature:command:*:default],<[localbroker:dispatcher_ng/items/Gnd/Bathroom/Thermostat/temperature/feedback:state:default]"}
Number 1st_Bathroom_Thermostat {mqtt=">[localbroker:dispatcher_ng/items/1st/Bathroom/Thermostat/temperature:command:*:default],<[localbroker:dispatcher_ng/items/1st/Bathroom/Thermostat/temperature/feedback:state:default]"} Contact 1st_Bathroom_WindowContact "Fenster Bad oben" {mqtt="<[localbroker:dispatcher_ng/items/1st/Bathroom/WindowContact/state/feedback:state:default]"}
Switch Gnd_Kitchen_WindowContact1 {mqtt="<[localbroker:dispatcher_ng/items/Gnd/Kitchen/WindowContact1/state/feedback:state:default]"} Number 1st_Bathroom_Thermostat "Thermostat Bad oben" {mqtt=">[localbroker:dispatcher_ng/items/1st/Bathroom/Thermostat/temperature:command:*:default],<[localbroker:dispatcher_ng/items/1st/Bathroom/Thermostat/temperature/feedback:state:default]"}
Switch Gnd_Kitchen_WindowContact2 {mqtt="<[localbroker:dispatcher_ng/items/Gnd/Kitchen/WindowContact2/state/feedback:state:default]"} Contact Gnd_Kitchen_WindowContact1 "Fenster Küche Garten" {mqtt="<[localbroker:dispatcher_ng/items/Gnd/Kitchen/WindowContact1/state/feedback:state:default]"}
Switch Gnd_Kitchen_WindowContact3 {mqtt="<[localbroker:dispatcher_ng/items/Gnd/Kitchen/WindowContact3/state/feedback:state:default]"} Contact Gnd_Kitchen_WindowContact2 "Fenster Küche Terassentür Garten" {mqtt="<[localbroker:dispatcher_ng/items/Gnd/Kitchen/WindowContact2/state/feedback:state:default]"}
Switch Gnd_Kitchen_WindowContact4 {mqtt="<[localbroker:dispatcher_ng/items/Gnd/Kitchen/WindowContact4/state/feedback:state:default]"} Contact Gnd_Kitchen_WindowContact3 "Fenster Küche Straße 1" {mqtt="<[localbroker:dispatcher_ng/items/Gnd/Kitchen/WindowContact3/state/feedback:state:default]"}
Number Gnd_Kitchen_Thermostat {mqtt=">[localbroker:dispatcher_ng/items/Gnd/Kitchen/Thermostat/temperature:command:*:default],<[localbroker:dispatcher_ng/items/Gnd/Kitchen/Thermostat/temperature/feedback:state:default]"} 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" {mqtt=">[localbroker:dispatcher_ng/items/Gnd/Kitchen/Thermostat/temperature:command:*:default],<[localbroker:dispatcher_ng/items/Gnd/Kitchen/Thermostat/temperature/feedback:state:default]"}

View File

@ -132,16 +132,16 @@ function ContactHomekitExport(id: string, label: string, status: string) : Homek
function SwitchOpenHABExport(id: string, label: string, setOn: string, statusOn: string): string { function SwitchOpenHABExport(id: string, label: string, setOn: string, statusOn: string): string {
// Switch windowLightKitchen {mqtt=">[localbroker:nodered/items/windowLightKitchen:command:*:default]", mqtt="<[localbroker:nodered/items/windowLightKitchen/feedback:state:default]"} // Switch windowLightKitchen {mqtt=">[localbroker:nodered/items/windowLightKitchen:command:*:default]", mqtt="<[localbroker:nodered/items/windowLightKitchen/feedback:state:default]"}
return `Switch ${id} {mqtt=">[localbroker:${setOn}:command:*:default],<[localbroker:${statusOn}:state:default]"}` return `Switch ${id} "${label}"{mqtt=">[localbroker:${setOn}:command:*:default],<[localbroker:${statusOn}:state:default]"}`
} }
function ContactOpenHABExport(id: string, label: string, status: string): string { function ContactOpenHABExport(id: string, label: string, status: string): string {
// Switch windowLightKitchen {mqtt=">[localbroker:nodered/items/windowLightKitchen:command:*:default]", mqtt="<[localbroker:nodered/items/windowLightKitchen/feedback:state:default]"} // Switch windowLightKitchen {mqtt=">[localbroker:nodered/items/windowLightKitchen:command:*:default]", mqtt="<[localbroker:nodered/items/windowLightKitchen/feedback:state:default]"}
return `Switch ${id} {mqtt="<[localbroker:${status}:state:default]"}` return `Contact ${id} "${label}" {mqtt="<[localbroker:${status}:state:default]"}`
} }
function ThermostatOpenHAPExport(id: string, label: string, setTemperature: string, statusTemperature: string) : string { function ThermostatOpenHAPExport(id: string, label: string, setTemperature: string, statusTemperature: string) : string {
return `Number ${id} {mqtt=">[localbroker:${setTemperature}:command:*:default],<[localbroker:${statusTemperature}:state:default]"}` return `Number ${id} "${label}" {mqtt=">[localbroker:${setTemperature}:command:*:default],<[localbroker:${statusTemperature}:state:default]"}`
} }
function HueColorLightHomekitExport(id: string, label: string, function HueColorLightHomekitExport(id: string, label: string,
@ -177,4 +177,4 @@ function HueColorLightHomekitExport(id: string, label: string,
} }
} }
return { 'id': id, 'object': o} return { 'id': id, 'object': o}
} }

View File

@ -195,20 +195,23 @@ allLabeledItems.push(bedRoomWindowLight)
let windowContactBedroomStreet1st = new MaxWindowContact('1st', 'Bedroom', 'WindowContactStreet', 'Fenster Schlafzimmer Strasse', 17) let windowContactBedroomStreet1st = new MaxWindowContact('1st', 'Bedroom', 'WindowContactStreet', 'Fenster Schlafzimmer Strasse', 17)
windowContactBedroomStreet1st.start() windowContactBedroomStreet1st.start()
allLabeledItems.push(windowContactBedroomStreet1st) allLabeledItems.push(windowContactBedroomStreet1st)
let windowContactBedroomGarden1st = new MaxWindowContact('1st', 'Bedroom', 'WindowContactGarden', 'Fenster Schlafzimmer Garten', 18) let windowContact1BedroomGarden1st = new MaxWindowContact('1st', 'Bedroom', 'WindowContact1Garden', 'Fenster Schlafzimmer 1 Garten', 18)
windowContactBedroomGarden1st.start() windowContact1BedroomGarden1st.start()
allLabeledItems.push(windowContactBedroomGarden1st) allLabeledItems.push(windowContact1BedroomGarden1st)
let windowContact2BedroomGarden1st = new MaxWindowContact('1st', 'Bedroom', 'WindowContact2Garden', 'Fenster Schlafzimmer 2 Garten', 22)
windowContact2BedroomGarden1st.start()
allLabeledItems.push(windowContact2BedroomGarden1st)
let thermostatBedroom1st = new MaxThermostat('1st', 'Bedroom', 'Thermostat', 'Thermostat Schlafzimmer', 19, [windowContactBedroomGarden1st, windowContactBedroomStreet1st]) let thermostatBedroom1st = new MaxThermostat('1st', 'Bedroom', 'Thermostat', 'Thermostat Schlafzimmer', 19, [windowContact1BedroomGarden1st, windowContact2BedroomGarden1st, windowContactBedroomStreet1st])
thermostatBedroom1st.start() thermostatBedroom1st.start()
allLabeledItems.push(thermostatBedroom1st) allLabeledItems.push(thermostatBedroom1st)
let thermostatBedroom1stCron = new Cron('thermostatBedroom1stCron', thermostatBedroom1st, [ let thermostatBedroom1stCron = new Cron('thermostatBedroom1stCron', thermostatBedroom1st, [
{cronTime: '00 01 06 * * 1-5', output: '21.0'}, {cronTime: '00 01 06 * * 1-5', output: '19.0'},
{cronTime: '00 01 09 * * 1-5', output: '5.0'}, {cronTime: '00 01 09 * * 1-5', output: '5.0'},
{cronTime: '00 01 08 * * 6,0', output: '21.0'}, {cronTime: '00 01 08 * * 6,0', output: '19.0'},
{cronTime: '00 01 11 * * 6,0', output: '5.0'}, {cronTime: '00 01 11 * * 6,0', output: '5.0'},
{cronTime: '00 00 17 * * *', output: '23.0'}, {cronTime: '00 00 17 * * *', output: '20.0'},
{cronTime: '00 59 23 * * *', output: '5.0'} {cronTime: '00 59 23 * * *', output: '5.0'}
]) ])
thermostatBedroom1stCron.start() thermostatBedroom1stCron.start()