Trying to get some entity states into plain text so I can send via the whin whatsapp integration

I am trying to send a daily snapshot of the vivarium temperature and humidity to my whatsapp just to give me peace of mind that the viv is maintaining a good temperature. Eventually I will have it message me if the temp gets too low or too high, but I also want a daily snapshot.

I started by trying to use the format node, and taking the entities in there. I found something similar in the post below.

But when I hit inject, the text comes out okay, but the entity values are not showing. I have tried with a few temp and humidity sensors I have set up but nothing. There is no error message in the debug, It just shows the output string, with no entity values between just a gap…

I’ll attempt to put the node red flow on here. (dont shoot me if I get it wrong im a noob)

Thanks in advance.

Rob

[{"id":"373a2ab4.29c286","type":"inject","z":"eab07eeee23ea2ba","name":"","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":120,"y":1240,"wires":[["9646d923.432558"]]},{"id":"9646d923.432558","type":"api-current-state","z":"eab07eeee23ea2ba","name":"Reggy_Temp","server":"d2541961.8b4938","version":2,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"sensor.coco_temperature","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"x":230,"y":1300,"wires":[["d92bf2f0.d578"]]},{"id":"d92bf2f0.d578","type":"api-current-state","z":"eab07eeee23ea2ba","name":"Reggy_Humid","server":"d2541961.8b4938","version":2,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"sensor.coco_humidity","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"x":400,"y":1360,"wires":[["67634f6c.20eb7"]]},{"id":"3e380017.db9a8","type":"debug","z":"eab07eeee23ea2ba","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":670,"y":1500,"wires":[]},{"id":"67634f6c.20eb7","type":"template","z":"eab07eeee23ea2ba","name":"format it","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"Reggies Viv Temperature is {{Reggy_Temp}} 'C and Humidity is {{Reggy_Humid}}%","output":"str","x":540,"y":1420,"wires":[["3e380017.db9a8"]]},{"id":"d2541961.8b4938","type":"server","name":"Home Assistant","version":1,"legacy":false,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]

image

In the current state node enter the temp entity. Below


enter the humidity sensor.

[{"id":"1a9792682a1a8bd7","type":"inject","z":"f80b6c338afd5483","name":"","props":[{"p":"payload"},{"p":"temp","v":"76","vt":"num"},{"p":"hum","v":"44","vt":"num"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":480,"y":400,"wires":[["77e56b62f233434d"]]},{"id":"26677a541b73021f","type":"api-call-service","z":"f80b6c338afd5483","name":"","server":"6b1110b5.183a4","version":5,"debugenabled":false,"domain":"notify","service":"mobile_app_pixel_3","areaId":[],"deviceId":[],"entityId":[],"data":"{\"message\":\"The humidity is {{hum}} and\\n<br>the temperature is {{temp}}\\n\",\"title\":\"Daily humidity and temp\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1030,"y":400,"wires":[[]]},{"id":"77e56b62f233434d","type":"api-current-state","z":"f80b6c338afd5483","name":"","server":"6b1110b5.183a4","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"temp entity here#","state_type":"num","blockInputOverrides":false,"outputProperties":[{"property":"temp","propertyType":"msg","value":"","valueType":"entityState"},{"property":"hum","propertyType":"msg","value":"$number($entities(\"sensor.humidity_here\").state)","valueType":"jsonata"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":730,"y":400,"wires":[["26677a541b73021f"]]},{"id":"6b1110b5.183a4","type":"server","name":"Home Assistant","version":2,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":false,"heartbeat":false,"heartbeatInterval":"30"}]

Thanks Mikefila,

I am not using the HA mobile app in this instance.

I am trying to get a message payload for the output, using the current entity data.

The notify domain is used for whatsapp not just the companion app. Just change the service to notify.whatsapp.

Here you can see how to configure whin notifications directly into HA (not using the node-red nodes).

The new version supports sending to whatsapp groups.

You have also the node-red version, just in case you like it more.