Hi everyone,
I recently change one of my Node RED flows that triggers when a harmony activity starts.
It then creates a new scene with the create scene service of a few lights and turns them all off right after. When the Harmony activity ends, I activate the scene so all lights switch to their old “on” state.
[{"id":"ea2c0f58.23bbe","type":"tab","label":"Kino Harmony","disabled":false,"info":""},{"id":"1a49af3d.5f8581","type":"api-call-service","z":"ea2c0f58.23bbe","name":"Beamer command off","server":"929b5bd7.3a2728","version":1,"debugenabled":false,"service_domain":"remote","service":"send_command","entityId":"remote.harmony_hub","data":"{\"device\":60946313,\"command\":\"PowerOff\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":400,"y":300,"wires":[["19762dd3.0e74d2"]]},{"id":"19762dd3.0e74d2","type":"api-call-service","z":"ea2c0f58.23bbe","name":"Beamer command off","server":"929b5bd7.3a2728","version":1,"debugenabled":false,"service_domain":"remote","service":"send_command","entityId":"remote.harmony_hub","data":"{\"device\":60946313,\"command\":\"PowerOff\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":620,"y":300,"wires":[[]]},{"id":"927a4922.f91a58","type":"api-call-service","z":"ea2c0f58.23bbe","name":"Light Rack off","server":"929b5bd7.3a2728","version":1,"debugenabled":false,"service_domain":"light","service":"turn_off","entityId":"light.rack","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":540,"y":80,"wires":[[]]},{"id":"1fcf032a.6675ed","type":"api-call-service","z":"ea2c0f58.23bbe","name":"Light Esszimmer off","server":"929b5bd7.3a2728","version":1,"debugenabled":false,"service_domain":"light","service":"turn_off","entityId":"light.esszimmer","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":550,"y":120,"wires":[[]]},{"id":"c68f104.af92af","type":"api-call-service","z":"ea2c0f58.23bbe","name":"Light Sofalampe off","server":"929b5bd7.3a2728","version":1,"debugenabled":false,"service_domain":"light","service":"turn_off","entityId":"light.sofalampe","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":550,"y":160,"wires":[[]]},{"id":"728d44c2.e2f12c","type":"api-call-service","z":"ea2c0f58.23bbe","name":"Light Leinwand off","server":"929b5bd7.3a2728","version":1,"debugenabled":false,"service_domain":"light","service":"turn_off","entityId":"light.leinwand","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":550,"y":200,"wires":[[]]},{"id":"e2b28b38.cb5098","type":"server-state-changed","z":"ea2c0f58.23bbe","name":"Kino On/Off","server":"929b5bd7.3a2728","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"switch.kino","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"on","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":true,"for":"","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"x":110,"y":220,"wires":[["2ac0e308.111fec"],["1a49af3d.5f8581","5de45ce0.8040f4","cf7e6359.1045f"]]},{"id":"282d9f70.fc03b","type":"comment","z":"ea2c0f58.23bbe","name":"Kino Harmony Activity","info":"","x":140,"y":40,"wires":[]},{"id":"2ac0e308.111fec","type":"api-call-service","z":"ea2c0f58.23bbe","name":"Snapshot Wohnzimmer","server":"929b5bd7.3a2728","version":1,"debugenabled":false,"service_domain":"scene","service":"create","entityId":"","data":"{\"scene_id\":\"wohnzimmer_lichter\",\"snapshot_entities\":\"light.rack,light.sofalampe,light.leinwand\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":290,"y":100,"wires":[["cfebb4f.90ab548"]]},{"id":"cfebb4f.90ab548","type":"api-call-service","z":"ea2c0f58.23bbe","name":"Snapshot Esszimmer","server":"929b5bd7.3a2728","version":1,"debugenabled":false,"service_domain":"scene","service":"create","entityId":"","data":"{\"scene_id\":\"esszimmer_lichter\",\"snapshot_entities\":\"light.esszimmer\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":300,"y":140,"wires":[["3ef5ec32.5858d4"]]},{"id":"3ef5ec32.5858d4","type":"delay","z":"ea2c0f58.23bbe","name":"","pauseType":"delay","timeout":"500","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":300,"y":180,"wires":[["927a4922.f91a58","1fcf032a.6675ed","c68f104.af92af","728d44c2.e2f12c"]]},{"id":"5de45ce0.8040f4","type":"api-call-service","z":"ea2c0f58.23bbe","name":"Restore Wohnzimmer","server":"929b5bd7.3a2728","version":1,"debugenabled":false,"service_domain":"scene","service":"turn_on","entityId":"","data":"{\"entity_id\":\"scene.wohnzimmer_lichter\",\"transition\":4}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":400,"y":360,"wires":[[]]},{"id":"cf7e6359.1045f","type":"api-call-service","z":"ea2c0f58.23bbe","name":"Restore Esszimmer","server":"929b5bd7.3a2728","version":1,"debugenabled":false,"service_domain":"scene","service":"turn_on","entityId":"","data":"{\"entity_id\":\"scene.esszimmer_lichter\",\"transition\":6}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":390,"y":420,"wires":[[]]},{"id":"929b5bd7.3a2728","type":"server","z":"","name":"Home Assistant","legacy":false,"addon":false,"rejectUnauthorizedCerts":false,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]
The problem is, if I restart my Home Assistant instance in the meantime the scene will be deleted (standard behaviour) and no light will be turned on.
So what I want to do know is to implement a check if a scene with a specific name is created or not.
How could I do this?
Thanks in advance!
Regards
Stefan