Hopefully Simple Node-Red Fix - Resolved

Probably something simple that I’m missing, but I have a Node-Red automation linked to a wi-fi enabled Heat Pump Dryer. All I want to do is put out a Telegram message when the state/status changes.
This is the Nonde-Red flow JSON:

[{"id":"0f0bab0731d8a51f","type":"server-state-changed","z":"b753a5cbf0c61117","name":"Dryer State Change","server":"8432d461.f08148","version":6,"outputs":1,"exposeAsEntityConfig":"","entities":{"entity":["sensor.tumble_dryer_dryer_job_state"],"substring":[],"regex":[]},"outputInitially":false,"stateType":"str","ifState":"","ifStateType":"str","ifStateOperator":"is","outputOnlyOnStateChange":true,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":true,"ignorePrevStateUnknown":true,"ignorePrevStateUnavailable":true,"ignoreCurrentStateUnknown":true,"ignoreCurrentStateUnavailable":true,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"eventData"}],"x":170,"y":340,"wires":[["9007aa2de95ea741","c584a28342204a95"]]},{"id":"9007aa2de95ea741","type":"debug","z":"b753a5cbf0c61117","name":"debug DSC","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":450,"y":300,"wires":[]},{"id":"c584a28342204a95","type":"api-call-service","z":"b753a5cbf0c61117","name":"","server":"8432d461.f08148","version":7,"debugenabled":true,"action":"notify.ha311_bot","floorId":[],"areaId":[],"deviceId":[],"entityId":[],"labelId":[],"data":"{\"message\":\"HA-NR Dryer state changed to {{payload}}\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":false,"domain":"notify","service":"ha311_bot","x":460,"y":380,"wires":[[]]},{"id":"8432d461.f08148","type":"server","name":"Home Assistant","addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"","connectionDelay":false,"cacheJson":false,"heartbeat":false,"heartbeatInterval":"30","statusSeparator":"","enableGlobalContextStore":false}]

All I get in my actual Telegram output is

“Dryer state changed to {{payload}}”

I have verified that the value in sensor.tumble_dryer_dryer_job_state is a text string (or appears as one), such as “drying”, “cooling” or “finished”.

Any suggestions?

What is shows in your Debug Node when the state of Dryer changes?

I’ll have to wait for the Dryer to run another load - as usual no debug messages are kept unless you have the views open…

You have payload set to event data change it to entity state.

1 Like

In the events:state node, you have msg.payload set to “event data,” which includes all event details, not just the state. Mustache templates don’t handle objects well. Change the output property to set msg.payload to “event state,” and you’ll see the actual state of the entity.

1 Like