How to show device state on the notification message

I am new on home assistant and node-red, so please bear with me. I’ve created a node-red flow to send a notification message to mobile phone when it detect the state change of light switch in study room.

I just wonder how can I modify the json message in call service node to output the light current state?
I’ve try the following in the notify node, but the notification message that I receive on the mobile phone only shows “Study room light is”.

Thanks in advance

{
    "title": "Notification",
    "message": "Study room light is {{ light.study_room_light }}"
}

[{"id":"41a04c4f.0cc054","type":"api-call-service","z":"a8c7899.091af78","name":"","server":"2e154d50.f6c7e2","version":1,"debugenabled":false,"service_domain":"notify","service":"mobile_app_jacky_s_iphone","entityId":"","data":"{\"title\":\"Notification\",\"message\":\"Study room light is {{ light.study_room_light }}\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":720,"y":240,"wires":[[]]},{"id":"2e154d50.f6c7e2","type":"server","name":"Home Assistant","legacy":false,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]

Use an edit change node after the change state node.

image

Set the message like “message”:"{{payload}}"

1 Like