I am trying to get notified of updates on my phone. I have this node sequence where I get the data needed to build the notification:
{"entity_id":"update.mosquitto_broker_update","old_state":{"entity_id":"update.mosquitto_broker_update","state":"on","attributes":{"auto_update":false,"installed_version":"6.1.3","in_progress":true,"latest_version":"6.2.0","release_summary":"# Changelog\n\n## 6.2.0\n\n- Update mosquitto to 2.0.15\n- Update libwebsockets to 4.3.2 (fixes Unable to create websockets listener)\n\n#","release_url":null,"skipped_version":null,"title":"Mosquitto broker","entity_picture":"/api/hassio/addons/core_mosquitto/icon","friendly_name":"Mosquitto broker Update","supported_features":25},"last_changed":"2023-03-28T11:02:52.715080+00:00","last_updated":"2023-03-28T13:55:56.139161+00:00","context":{"id":"01GWM820K9SFGW0CKMHSVDF7CP","parent_id":null,"user_id":"2958b2a38fdf487694e401cc6e50ce79"},"original_state":"on"},"new_state":{"entity_id":"update.mosquitto_broker_update","state":"off","attributes":{"auto_update":false,"installed_version":"6.2.0","in_progress":true,"latest_version":"6.2.0","release_summary":"# Changelog\n\n## 6.2.0\n\n- Update mosquitto to 2.0.15\n- Update libwebsockets to 4.3.2 (fixes Unable to create websockets listener)\n\n## 6.1.3\n\n- Change timestamp format in logs\n\n## 6.1.2\n\n- Add debug option to help with issues\n\n## 6.1.1\n\n- Don't purge openss","release_url":null,"skipped_version":null,"title":"Mosquitto broker","entity_picture":"/api/hassio/addons/core_mosquitto/icon","friendly_name":"Mosquitto broker Update","supported_features":25},"last_changed":"2023-03-28T13:56:20.366291+00:00","last_updated":"2023-03-28T13:56:20.366291+00:00","context":{"id":"01GWM82R8EB57PN01HATMEKJK8","parent_id":null,"user_id":null},"original_state":"off","timeSinceChangedMs":3},"_msgid":"80599e8c79891b8f"}
But when I tried to send it as notification, all the msg.something
are empty.
"data": "{\"message\":\"Update exists for {{{msg}}} ({{{msg.new_state.attributes.installed_version}}} ➡ {{{msg.new_state.attributes.latest_version}}})\"}",
this is the full flow
[{"id":"735dc33062cb97db","type":"tab","label":"Notify on updates","disabled":false,"info":"","env":[]},{"id":"d81f91852ae0c245","type":"debug","z":"735dc33062cb97db","name":"debug 1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":900,"y":480,"wires":[]},{"id":"f8d90c1a90c3d7a6","type":"server-state-changed","z":"735dc33062cb97db","name":"","server":"1265decc.ac6211","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"update.","entityidfiltertype":"substring","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":160,"y":260,"wires":[["269ea2a6777b7ff7"]]},{"id":"a72253ba9a2c17a2","type":"api-call-service","z":"735dc33062cb97db","name":"","server":"1265decc.ac6211","version":5,"debugenabled":false,"domain":"notify","service":"mobile_app_poco_saninn_app","areaId":[],"deviceId":[],"entityId":[],"data":"{\"message\":\"Update exists for {{{msg}}} ({{{msg.new_state.attributes.installed_version}}} ➡ {{{msg.new_state.attributes.latest_version}}})\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":870,"y":260,"wires":[[]],"info":"The data comes as\n\n```\n{\n \"payload\": \"off\",\n \"data\": {\n \"entity_id\": \"update.mosquitto_broker_update\",\n \"old_state\": {\n \"entity_id\": \"update.mosquitto_broker_update\",\n \"state\": \"on\",\n \"attributes\": {\n \"auto_update\": false,\n \"installed_version\": \"6.1.3\",\n \"in_progress\": true,\n \"latest_version\": \"6.2.0\",\n \"release_summary\": \"# Changelog\\n\\n## 6.2.0\\n\\n- Update mosquitto to 2.0.15\\n- Update libwebsockets to 4.3.2 (fixes Unable to create websockets listener)\\n\\n#\",\n \"release_url\": null,\n \"skipped_version\": null,\n \"title\": \"Mosquitto broker\",\n \"entity_picture\": \"/api/hassio/addons/core_mosquitto/icon\",\n \"friendly_name\": \"Mosquitto broker Update\",\n \"supported_features\": 25\n },\n \"last_changed\": \"2023-03-28T11:02:52.715080+00:00\",\n \"last_updated\": \"2023-03-28T13:55:56.139161+00:00\",\n \"context\": {\n \"id\": \"01GWM820K9SFGW0CKMHSVDF7CP\",\n \"parent_id\": null,\n \"user_id\": \"2958b2a38fdf487694e401cc6e50ce79\"\n },\n \"original_state\": \"on\"\n },\n \"new_state\": {\n \"entity_id\": \"update.mosquitto_broker_update\",\n \"state\": \"off\",\n \"attributes\": {\n \"auto_update\": false,\n \"installed_version\": \"6.2.0\",\n \"in_progress\": true,\n \"latest_version\": \"6.2.0\",\n \"release_summary\": \"# Changelog\\n\\n## 6.2.0\\n\\n- Update mosquitto to 2.0.15\\n- Update libwebsockets to 4.3.2 (fixes Unable to create websockets listener)\\n\\n## 6.1.3\\n\\n- Change timestamp format in logs\\n\\n## 6.1.2\\n\\n- Add debug option to help with issues\\n\\n## 6.1.1\\n\\n- Don't purge openss\",\n \"release_url\": null,\n \"skipped_version\": null,\n \"title\": \"Mosquitto broker\",\n \"entity_picture\": \"/api/hassio/addons/core_mosquitto/icon\",\n \"friendly_name\": \"Mosquitto broker Update\",\n \"supported_features\": 25\n },\n \"last_changed\": \"2023-03-28T13:56:20.366291+00:00\",\n \"last_updated\": \"2023-03-28T13:56:20.366291+00:00\",\n \"context\": {\n \"id\": \"01GWM82R8EB57PN01HATMEKJK8\",\n \"parent_id\": null,\n \"user_id\": null\n },\n \"original_state\": \"off\",\n \"timeSinceChangedMs\": 3\n }\n },\n \"topic\": \"update.mosquitto_broker_update\",\n \"_msgid\": \"3215480a351ad1af\"\n}\n```"},{"id":"3d8eb15214cf93ed","type":"inject","z":"735dc33062cb97db","name":"","props":[{"p":"payload"},{"p":"data","v":"{\"payload\":\"off\",\"data\":{\"entity_id\":\"update.mosquitto_broker_update\",\"old_state\":{\"entity_id\":\"update.mosquitto_broker_update\",\"state\":\"on\",\"attributes\":{\"auto_update\":false,\"installed_version\":\"6.1.3\",\"in_progress\":true,\"latest_version\":\"6.2.0\",\"release_summary\":\"# Changelog\\n\\n## 6.2.0\\n\\n- Update mosquitto to 2.0.15\\n- Update libwebsockets to 4.3.2 (fixes Unable to create websockets listener)\\n\\n#\",\"release_url\":null,\"skipped_version\":null,\"title\":\"Mosquitto broker\",\"entity_picture\":\"/api/hassio/addons/core_mosquitto/icon\",\"friendly_name\":\"Mosquitto broker Update\",\"supported_features\":25},\"last_changed\":\"2023-03-28T11:02:52.715080+00:00\",\"last_updated\":\"2023-03-28T13:55:56.139161+00:00\",\"context\":{\"id\":\"01GWM820K9SFGW0CKMHSVDF7CP\",\"parent_id\":null,\"user_id\":\"2958b2a38fdf487694e401cc6e50ce79\"},\"original_state\":\"on\"},\"new_state\":{\"entity_id\":\"update.mosquitto_broker_update\",\"state\":\"off\",\"attributes\":{\"auto_update\":false,\"installed_version\":\"6.2.0\",\"in_progress\":true,\"latest_version\":\"6.2.0\",\"release_summary\":\"# Changelog\\n\\n## 6.2.0\\n\\n- Update mosquitto to 2.0.15\\n- Update libwebsockets to 4.3.2 (fixes Unable to create websockets listener)\\n\\n## 6.1.3\\n\\n- Change timestamp format in logs\\n\\n## 6.1.2\\n\\n- Add debug option to help with issues\\n\\n## 6.1.1\\n\\n- Don't purge openss\",\"release_url\":null,\"skipped_version\":null,\"title\":\"Mosquitto broker\",\"entity_picture\":\"/api/hassio/addons/core_mosquitto/icon\",\"friendly_name\":\"Mosquitto broker Update\",\"supported_features\":25},\"last_changed\":\"2023-03-28T13:56:20.366291+00:00\",\"last_updated\":\"2023-03-28T13:56:20.366291+00:00\",\"context\":{\"id\":\"01GWM82R8EB57PN01HATMEKJK8\",\"parent_id\":null,\"user_id\":null},\"original_state\":\"off\",\"timeSinceChangedMs\":3}},\"topic\":\"update.mosquitto_broker_update\",\"_msgid\":\"3215480a351ad1af\"}","vt":"json"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"on","payloadType":"str","x":110,"y":580,"wires":[["269ea2a6777b7ff7"]]},{"id":"269ea2a6777b7ff7","type":"switch","z":"735dc33062cb97db","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":390,"y":260,"wires":[["50bfb0c6abe45141"]]},{"id":"50bfb0c6abe45141","type":"function","z":"735dc33062cb97db","name":"Extract Data","func":"// const info = msg.data.data;\n// const message = `Update exists for ${info.new_state.attributes.title} (${info.new_state.attributes.installed_version} ➡ ${info.new_state.attributes.latest_version})`\n// return {message}\n\nreturn msg.data.data","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":590,"y":260,"wires":[["a72253ba9a2c17a2","d81f91852ae0c245"]]},{"id":"1265decc.ac6211","type":"server","name":"Home Assistant","addon":true}]
I have also tried with two {
instead of three.
What I am doing wrong?
thanks!