Hi,
I want to automate my Cinema Mode.
Whenever my Chromecast starts 1 Media App (lets say Netflix) I want to save the state of the current light (via switchnode I copy the value of msg.payload, msg.topic and msg.data into flow variables.
If the Sensor Reports that none of the Apps is running it should switch on the lights with given attributes from a switchnode which writes my flow variables back into the message).
My Debug Nodes tell me that my message really contains all the information I had stored before.
Now the challenge I’m struggling with:
How can I use the HA call service with the payload, topic and most importantly the data of the msg. passed through?
[{"id":"4ff54085.5e9c6","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"53d94457.1f2aec","type":"inject","z":"4ff54085.5e9c6","name":"","topic":"","payload":"None","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":110,"y":320,"wires":[["124d1156.74b357"]]},{"id":"124d1156.74b357","type":"switch","z":"4ff54085.5e9c6","name":"Rly?","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"Netflix","vt":"str"},{"t":"eq","v":"None","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":270,"y":320,"wires":[["52696a25.511174","b9849f6e.976ef"],["605a5dd1.43add4"]]},{"id":"b9849f6e.976ef","type":"api-current-state","z":"4ff54085.5e9c6","name":"Status Office Light","server":"18b877af.344b38","halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":true,"override_payload":true,"override_data":true,"entity_id":"light.gruppebuero","state_type":"str","outputs":1,"x":470,"y":240,"wires":[["f56c628d.9b5fc"]],"outputLabels":["flow.test"]},{"id":"52696a25.511174","type":"delay","z":"4ff54085.5e9c6","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":460,"y":340,"wires":[["5b073278.9b0824"]]},{"id":"605a5dd1.43add4","type":"change","z":"4ff54085.5e9c6","name":"load from flow variable","rules":[{"t":"set","p":"payload","pt":"msg","to":"payloadsavewz","tot":"flow"},{"t":"set","p":"topic","pt":"msg","to":"topicsavewz","tot":"flow"},{"t":"set","p":"data","pt":"msg","to":"datasavewz","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":460,"y":420,"wires":[["a23d4086.ef0198","f3152942.8f3d98"]]},{"id":"3d0e84c0.357bcc","type":"debug","z":"4ff54085.5e9c6","name":"Save","active":true,"tosidebar":true,"console":true,"tostatus":false,"complete":"true","targetType":"full","x":860,"y":180,"wires":[],"inputLabels":["flow.wz"]},{"id":"f56c628d.9b5fc","type":"change","z":"4ff54085.5e9c6","name":"save to flow variable","rules":[{"t":"set","p":"payloadsavewz","pt":"flow","to":"payload","tot":"msg"},{"t":"set","p":"topicsavewz","pt":"flow","to":"topic","tot":"msg"},{"t":"set","p":"datasavewz","pt":"flow","to":"data","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":700,"y":240,"wires":[["3d0e84c0.357bcc"]]},{"id":"5b073278.9b0824","type":"api-call-service","z":"4ff54085.5e9c6","name":"turn_on_movielights","server":"18b877af.344b38","service_domain":"light","service":"turn_on","data":"{\"entity_id\":\"light.gruppebuero\",\"brightness\":\"10\",\"rgb_color\":[0,255,0]}","render_data":false,"mergecontext":"","output_location":"","output_location_type":"none","x":660,"y":340,"wires":[[]]},{"id":"a23d4086.ef0198","type":"api-call-service","z":"4ff54085.5e9c6","name":"Office Light","server":"18b877af.344b38","service_domain":"light","service":"turn_on","data":"{\"entity_id\":\"light.gruppebuero\"}","render_data":true,"mergecontext":"","output_location":"payload","output_location_type":"msg","x":670,"y":420,"wires":[["4e6e0895.5924e"]],"inputLabels":["payload.data"]},{"id":"4e6e0895.5924e","type":"api-current-state","z":"4ff54085.5e9c6","name":"Status Office Light","server":"18b877af.344b38","halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":true,"override_payload":true,"override_data":true,"entity_id":"light.gruppebuero","state_type":"str","outputs":1,"x":870,"y":420,"wires":[["3dee6019.f0685"]],"outputLabels":["flow.test"]},{"id":"f3152942.8f3d98","type":"debug","z":"4ff54085.5e9c6","name":"Restore","active":true,"tosidebar":true,"console":true,"tostatus":false,"complete":"true","targetType":"full","x":670,"y":480,"wires":[]},{"id":"3dee6019.f0685","type":"debug","z":"4ff54085.5e9c6","name":"Debug","active":true,"tosidebar":true,"console":true,"tostatus":false,"complete":"true","targetType":"full","x":860,"y":480,"wires":[]},{"id":"c42614bc.bc7f28","type":"inject","z":"4ff54085.5e9c6","name":"","topic":"","payload":"Netflix","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":110,"y":260,"wires":[["124d1156.74b357"]]},{"id":"18b877af.344b38","type":"server","z":"","name":"<Insert your Server here>","legacy":false,"hassio":false,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open"}] ```