I’ve set up a Node-Red flow that uses the “chronos scheduler” node to inject a “{“service”: “turn_on”}” payload into a series of HA “call service” nodes. The flow works well except for one light (node). There is a light that is switched on at the start of the flow that I’d like to turn off at the end of the flow. I thought using an HA “call service” node and setting the service to turn off would turn off the light. That isn’t the case and I don’t understand why?
I’ve set up a test flow to mimic the last step of the flow, The “inject” node sends a “{“service”: “turn_on”}” payload to an HA “call service” node. That node is configured to turn off the light. Problem is, the light stays on! I don’t understand what I’m doing wrong and could use assistant in resolving the issue. Here’s the test flow that I set up;
[{"id":"b1fbb2ee15ebd48a","type":"api-call-service","z":"4c304699.150758","name":"Foyer Light - Off","server":"fcf9b76b.256a88","version":3,"debugenabled":true,"service_domain":"switch","service":"turn_off","entityId":"switch.foyer","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"data"}],"queue":"none","x":800,"y":120,"wires":[["aa9d124433a854fd"]]},{"id":"27a247c440bd5f54","type":"inject","z":"4c304699.150758","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"service\": \"turn_on\"}","payloadType":"str","x":580,"y":120,"wires":[["b1fbb2ee15ebd48a"]]},{"id":"aa9d124433a854fd","type":"debug","z":"4c304699.150758","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1000,"y":120,"wires":[]},{"id":"fcf9b76b.256a88","type":"server","name":"Home Assistant","version":2,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30}]
Much appreciated.