Sensor to notification

hay there im once again stuck in node red i got this flow underneath
what i want is the output in a notification
i want
title, Time to put the bins out
message, “payload”
message, and in “payloaddays” days
message, put out “payloadnext”

i want the notification to look like
Time to put the bins out
Pmd
and in 3 days
put out “restafval”

i get them to work all seperetly but not as one notification

[{"id":"3a006495d6e7fb49","type":"api-call-service","z":"20089f623edec129","name":"Notify ","server":"62ca2d0356b10119","version":5,"debugenabled":true,"domain":"notify","service":"mobile_app_fold4","areaId":[],"deviceId":[],"entityId":[],"data":"{\"title\": \"Time to put the bins out\", \"message\": payload, \"And in\":  payloaddays}","dataType":"jsonata","mergeContext":"","mustacheAltTags":true,"outputProperties":[],"queue":"none","output_location":"","output_location_type":"none","x":750,"y":360,"wires":[[]]},{"id":"c50e9418f6d78235","type":"api-current-state","z":"20089f623edec129","name":"","server":"62ca2d0356b10119","version":3,"outputs":2,"halt_if":"Geen","halt_if_type":"str","halt_if_compare":"is","entity_id":"sensor.afvalwijzer_today_2","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":380,"y":320,"wires":[["3a006495d6e7fb49"],[]]},{"id":"14865832c9b032f9","type":"inject","z":"20089f623edec129","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":120,"y":380,"wires":[["c50e9418f6d78235","969d6c421abee441","15377e51af05909d"]]},{"id":"969d6c421abee441","type":"api-current-state","z":"20089f623edec129","name":"","server":"62ca2d0356b10119","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"sensor.afvalwijzer_next_in_days_2","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payloaddays","propertyType":"msg","value":"","valueType":"entityState"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":410,"y":380,"wires":[["3a006495d6e7fb49"]]},{"id":"15377e51af05909d","type":"api-current-state","z":"20089f623edec129","name":"","server":"62ca2d0356b10119","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"sensor.afvalwijzer_next_type_2","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payloadnext","propertyType":"msg","value":"","valueType":"entityState"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":400,"y":440,"wires":[["3a006495d6e7fb49"]]},{"id":"62ca2d0356b10119","type":"server","name":"Home Assistant","version":5,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":"30","areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":": ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"default","statusTimeFormat":"h:m","enableGlobalContextStore":false}]

now i tryde doing this
it kinde works but sends me 3 sepriate notifications
either the payload that i want or a complete random number
and it changes every time i run it

[{"id":"c50e9418f6d78235","type":"api-current-state","z":"20089f623edec129","name":"","server":"62ca2d0356b10119","version":3,"outputs":2,"halt_if":"Geen","halt_if_type":"str","halt_if_compare":"is","entity_id":"sensor.afvalwijzer_today_2","state_type":"str","blockInputOverrides":true,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":420,"y":320,"wires":[["3a006495d6e7fb49"],[]]},{"id":"14865832c9b032f9","type":"inject","z":"20089f623edec129","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":120,"y":380,"wires":[["c50e9418f6d78235","969d6c421abee441","15377e51af05909d"]]},{"id":"3a006495d6e7fb49","type":"api-call-service","z":"20089f623edec129","name":"Notify ","server":"62ca2d0356b10119","version":5,"debugenabled":true,"domain":"notify","service":"mobile_app_fold4","areaId":[],"deviceId":[],"entityId":[],"data":"{\"title\": \"Time to put the bins out\", \"message\": \"Today: \" &  payload & \"And in: \" &  payloaddays & \"Do\" &  payloadnext}","dataType":"jsonata","mergeContext":"","mustacheAltTags":true,"outputProperties":[],"queue":"none","output_location":"","output_location_type":"none","x":790,"y":380,"wires":[[]]},{"id":"969d6c421abee441","type":"api-current-state","z":"20089f623edec129","name":"","server":"62ca2d0356b10119","version":3,"outputs":1,"halt_if":"","halt_if_type":"num","halt_if_compare":"is","entity_id":"sensor.afvalwijzer_next_in_days_2","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payloaddays","propertyType":"msg","value":"","valueType":"entityState"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":430,"y":380,"wires":[["3a006495d6e7fb49"]]},{"id":"15377e51af05909d","type":"api-current-state","z":"20089f623edec129","name":"","server":"62ca2d0356b10119","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"sensor.afvalwijzer_next_type_2","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payloadnext","propertyType":"msg","value":"","valueType":"entityState"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":400,"y":440,"wires":[["3a006495d6e7fb49"]]},{"id":"62ca2d0356b10119","type":"server","name":"Home Assistant","version":5,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":"30","areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":": ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"default","statusTimeFormat":"h:m","enableGlobalContextStore":false}]

You can access the state of an entity within the call service using $entities('sensor.xyz').state without using current state nodes.


{
   "title": "Time to put the bins out",
   "message": "Today: " & $entities('sensor.today').state & "& in: " &  $entities('sensor.days').state & "Do" &
   $entities('sensor.type').state
}

thats exactly what i wanted now would it be posible to move each sensor on ther own line
now its all behind eachother but i want
sensor 1
sensor 2
sensor 3

Add \n where you want it to start the next line.

{
   "title": "Time to put the bins out",
   "message": "Today: " & $entities('sensor.today').state & "\n& in: " &  $entities('sensor.days').state & "\nDo" &
   $entities('sensor.type').state
}

Thank you your amazing

1 Like