Takže polovina podmínek, tedy východ je před 7:00 - otevřít v 7:00 a druhá západ je před 21:00 - zamkni při západu je zcela jistě správně. Následné změny stavu (lock/unlock) entity během dne nejsou toto automatikou již ovlivňovány. Pokud si v 7:00:01 zamkneš. Zůstane zamčeno až do "zítra". Což je dobré v případě, že se do zítřejšího rána stihneš vratit. Pokud ovšem odjedeš třeba byť jen na dva dny, druhý den se Ti odemkne aniž by jsi byl doma. Přidat další podmínky je tedy jistě žádoucí.
Kód: Vybrat vše
[{"id":"6e48ceca.1335d","type":"trigger-state","z":"11f6ac49.d2cca4","name":"slunce vyjde po 7:00","server":"31810f0.ea8c872","exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityid":"sun.sun","entityidfiltertype":"exact","debugenabled":false,"constraints":[{"targetType":"this_entity","targetValue":"","propertyType":"property","comparatorType":"is","comparatorValueDatatype":"bool","comparatorValue":"true","propertyValue":"new_state.attributes.rising"},{"targetType":"this_entity","targetValue":"","propertyType":"current_state","comparatorType":"is","comparatorValueDatatype":"str","comparatorValue":"above_horizon","propertyValue":"new_state.state"},{"targetType":"entity_id","targetValue":"sensor.time","propertyType":"current_state","comparatorType":">","comparatorValueDatatype":"str","comparatorValue":"07:00","propertyValue":"new_state.state"},{"targetType":"this_entity","targetValue":"","propertyType":"property","comparatorType":">","comparatorValueDatatype":"str","comparatorValue":"0","propertyValue":"new_state.attributes.elevation"},{"targetType":"this_entity","targetValue":"","propertyType":"property","comparatorType":"<","comparatorValueDatatype":"str","comparatorValue":"1","propertyValue":"new_state.attributes.elevation"}],"outputs":2,"customoutputs":[],"outputinitially":false,"state_type":"str","x":566.039794921875,"y":304.4308776855469,"wires":[["e8629f7a.42f44"],[]]},{"id":"14239210.57eb5e","type":"trigger-state","z":"11f6ac49.d2cca4","name":"slunce vyjde před 7:00","server":"31810f0.ea8c872","exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityid":"sensor.time","entityidfiltertype":"exact","debugenabled":false,"constraints":[{"targetType":"this_entity","targetValue":"","propertyType":"current_state","comparatorType":"is","comparatorValueDatatype":"str","comparatorValue":"07:00","propertyValue":"new_state.state"},{"targetType":"entity_id","targetValue":"sun.sun","propertyType":"current_state","comparatorType":"is","comparatorValueDatatype":"str","comparatorValue":"above_horizon","propertyValue":"new_state.state"}],"outputs":2,"customoutputs":[],"outputinitially":false,"state_type":"str","x":568.039794921875,"y":232.43087768554688,"wires":[["e8629f7a.42f44"],[]]},{"id":"7c7f560c.abf098","type":"trigger-state","z":"11f6ac49.d2cca4","name":"slunce zapadne po 21:00","server":"31810f0.ea8c872","exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityid":"sensor.time","entityidfiltertype":"exact","debugenabled":false,"constraints":[{"targetType":"this_entity","targetValue":"","propertyType":"current_state","comparatorType":"is","comparatorValueDatatype":"str","comparatorValue":"21:00","propertyValue":"new_state.state"},{"targetType":"entity_id","targetValue":"sun.sun","propertyType":"current_state","comparatorType":"is","comparatorValueDatatype":"str","comparatorValue":"above_horizon","propertyValue":"new_state.state"}],"outputs":2,"customoutputs":[],"outputinitially":false,"state_type":"str","x":586.039794921875,"y":484.4308776855469,"wires":[["a685a813.332f08"],[]]},{"id":"144166f9.26ec29","type":"trigger-state","z":"11f6ac49.d2cca4","name":"slunce zapadne před 21:00","server":"31810f0.ea8c872","exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityid":"sun.sun","entityidfiltertype":"exact","debugenabled":false,"constraints":[{"targetType":"this_entity","targetValue":"","propertyType":"property","comparatorType":"is","comparatorValueDatatype":"bool","comparatorValue":"false","propertyValue":"new_state.attributes.rising"},{"targetType":"this_entity","targetValue":"","propertyType":"current_state","comparatorType":"is","comparatorValueDatatype":"str","comparatorValue":"below_horizon","propertyValue":"new_state.state"},{"targetType":"entity_id","targetValue":"sensor.time","propertyType":"current_state","comparatorType":"<","comparatorValueDatatype":"str","comparatorValue":"21:00","propertyValue":"new_state.state"},{"targetType":"this_entity","targetValue":"","propertyType":"property","comparatorType":"<","comparatorValueDatatype":"num","comparatorValue":"0","propertyValue":"new_state.attributes.elevation"},{"targetType":"this_entity","targetValue":"","propertyType":"property","comparatorType":">","comparatorValueDatatype":"num","comparatorValue":"-1","propertyValue":"new_state.attributes.elevation"}],"outputs":2,"customoutputs":[],"outputinitially":false,"state_type":"str","x":606.039794921875,"y":564.4308776855469,"wires":[["a685a813.332f08"],[]]},{"id":"28a27282.104a5e","type":"comment","z":"11f6ac49.d2cca4","name":"Odemčení dveří při východu slunce, nejdříve však v 7:00","info":"","x":796.039794921875,"y":164.43087768554688,"wires":[]},{"id":"12fca45d.2c600c","type":"comment","z":"11f6ac49.d2cca4","name":"Zamčení dveří při západu slunce, nejpozději však v 21:00","info":"","x":796.039794921875,"y":424.4308776855469,"wires":[]},{"id":"478bbafc.635654","type":"api-call-service","z":"11f6ac49.d2cca4","name":"odemkni","server":"c10959a0.9ba6e8","version":1,"debugenabled":false,"service_domain":"lock","service":"unlock","entityId":"lock.zadni_dvere","data":"","dataType":"jsonata","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":996.039794921875,"y":264.4308776855469,"wires":[[]]},{"id":"e8629f7a.42f44","type":"api-current-state","z":"11f6ac49.d2cca4","name":"je zamčeno?","server":"c10959a0.9ba6e8","version":1,"outputs":2,"halt_if":"locked","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"lock.zadni_dvere","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":806.039794921875,"y":284.4308776855469,"wires":[["478bbafc.635654"],[]]},{"id":"a685a813.332f08","type":"api-current-state","z":"11f6ac49.d2cca4","name":"je odemčeno?","server":"c10959a0.9ba6e8","version":1,"outputs":2,"halt_if":"unlocked","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"lock.zadni_dvere","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":836.039794921875,"y":504.4308776855469,"wires":[["18ca98ad.424697"],[]]},{"id":"18ca98ad.424697","type":"api-call-service","z":"11f6ac49.d2cca4","name":"zamkni","server":"c10959a0.9ba6e8","version":1,"debugenabled":false,"service_domain":"lock","service":"lock","entityId":"lock.zadni_dvere","data":"","dataType":"jsonata","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1026.039794921875,"y":484.4308776855469,"wires":[[]]},{"id":"7a4c0988.8c8018","type":"comment","z":"11f6ac49.d2cca4","name":"\" 1 \"","info":"","x":316.039794921875,"y":224.43087768554688,"wires":[]},{"id":"b1d511a6.f58ea","type":"comment","z":"11f6ac49.d2cca4","name":"\" 2 \"","info":"","x":316.039794921875,"y":304.4308776855469,"wires":[]},{"id":"1f9bfba8.e570c4","type":"comment","z":"11f6ac49.d2cca4","name":"\" 3 \"","info":"","x":316.039794921875,"y":484.4308776855469,"wires":[]},{"id":"203bb662.9dbf2a","type":"comment","z":"11f6ac49.d2cca4","name":"\" 4 \"","info":"","x":316.039794921875,"y":564.4308776855469,"wires":[]},{"id":"31810f0.ea8c872","type":"server","name":"Home Assistant","legacy":true,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true},{"id":"c10959a0.9ba6e8","type":"server","name":"Home Assistant","legacy":true,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]