Do wklejenia w Node-Red (import):
[{"id":"f6a80b77.904ed","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"d496520d.00729","type":"api-current-state","z":"f6a80b77.904ed","name":"Okno w salonie","server":"6334d9e6.c75ed8","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"binary_sensor.aqara_window_salon_contact","state_type":"str","state_location":"salon","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":300,"y":180,"wires":[["992b841.b299ef8"]]},{"id":"d8e1fcce.9f225","type":"comment","z":"f6a80b77.904ed","name":"Sprawdź okna","info":"","x":290,"y":140,"wires":[]},{"id":"992b841.b299ef8","type":"api-current-state","z":"f6a80b77.904ed","name":"Okno w kuchni","server":"6334d9e6.c75ed8","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"binary_sensor.aqara_window_kitchen_contact","state_type":"str","state_location":"kuchnia","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":480,"y":180,"wires":[["d71207d6.0f36b8"]]},{"id":"d71207d6.0f36b8","type":"api-current-state","z":"f6a80b77.904ed","name":"Okno w sypialni","server":"6334d9e6.c75ed8","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"binary_sensor.aqara_window_bedroom_contact","state_type":"str","state_location":"sypialnia","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":660,"y":180,"wires":[["2da1c0ec.908fd"]]},{"id":"2da1c0ec.908fd","type":"api-current-state","z":"f6a80b77.904ed","name":"Okno u Emilii","server":"6334d9e6.c75ed8","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"binary_sensor.aqara_window_emilia_contact","state_type":"str","state_location":"emilia","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":830,"y":180,"wires":[["4eabdf60.27f3b8"]]},{"id":"4eabdf60.27f3b8","type":"function","z":"f6a80b77.904ed","name":"","func":"if (msg.salon==\"on\"){\n msg.salon=\" Okno w salonie. \";\n msg.okna=\"on\"\n} else { msg.salon=\" \"\n}\n\nif (msg.kuchnia==\"on\"){\n msg.kuchnia=\" Okno w kuchni. \";\n msg.okna=\"on\"\n} else { msg.kuchnia=\" \"\n}\n\nif (msg.sypialnia==\"on\"){\n msg.sypialnia=\" Okno w sypialni. \";\n msg.okna=\"on\"\n} else { msg.sypialnia=\" \"\n}\n\nif (msg.emilia==\"on\"){\n msg.emilia=\" Okno u Emilii. \";\n msg.okna=\"on\"\n} else { msg.emilia=\" \"\n}\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1000,"y":180,"wires":[["a6504fd8.cced6"]]},{"id":"a6504fd8.cced6","type":"function","z":"f6a80b77.904ed","name":"Wiadomość","func":"if (msg.okna==\"on\"){\nmsg.wiadomosc = \"OK, urządzenia wyłączone. Uwaga! Wykryto otwarte okna. \"+msg.salon+msg.kuchnia+msg.sypialnia+msg.emilia+\" Przed wyjściem zamknij okna.\"\n} else { msg.wiadomosc = \"OK, urządzenia wyłączone.\"\n}\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":490,"y":340,"wires":[["2add1bb3.cd73e4"]]},{"id":"2add1bb3.cd73e4","type":"function","z":"f6a80b77.904ed","name":"Gotowa wiadomość na głośniki","func":"msg.payload = \n{\n \"data\":\n {\n \"message\": msg.wiadomosc,\n \"language\":\"pl\",\n }\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":730,"y":340,"wires":[["6a4c00a6.ca37c"]]},{"id":"6a4c00a6.ca37c","type":"api-call-service","z":"f6a80b77.904ed","name":"","server":"6334d9e6.c75ed8","version":1,"debugenabled":false,"service_domain":"tts","service":"google_translate_say","entityId":"media_player.mini_group","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1030,"y":340,"wires":[[]]},{"id":"75e534fa.3ea46c","type":"inject","z":"f6a80b77.904ed","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":110,"y":180,"wires":[["d496520d.00729"]]},{"id":"6334d9e6.c75ed8","type":"server","name":"Home Assistant","addon":true}]