Mobile_app notification not working from node-RED: API error

I had to start from scratch because my old docker based installation of HA stop working.
Now I am using hassio.
I integrated node-RED too as in the previous installation. Unfortunately this time I’m not able to have mobile notification working.
Despite this notification works from HA developer tools services panel:

Service:
notify.mobile_app_soylents_iphone
Service Data (YAML, optional):
{"title":"Accensione forno","message":"Forno acceso"}

In node-RED same call got an API error:

“Call-service API error. Error Message: extra keys not allowed @ data[‘title’]”

Here you are the node:

[
    {
        "id": "47f4314c.f9005",
        "type": "api-call-service",
        "z": "f841e824.d474f",
        "name": "",
        "server": "c6e21e6c.847e8",
        "version": 1,
        "debugenabled": false,
        "service_domain": "notify",
        "service": "notify.mobile_app_soylents_iphone",
        "entityId": "",
        "data": "{\"title\":\"Accensione forno\",\"message\":\"Forno acceso\"}",
        "dataType": "json",
        "mergecontext": "",
        "output_location": "",
        "output_location_type": "none",
        "mustacheAltTags": false,
        "x": 720,
        "y": 1560,
        "wires": [
            []
        ]
    },
    {
        "id": "c6e21e6c.847e8",
        "type": "server",
        "z": "",
        "name": "Casa (local https)",
        "legacy": false,
        "hassio": false,
        "rejectUnauthorizedCerts": false,
        "ha_boolean": "y|yes|true|on|home|open",
        "connectionDelay": true
    }
]

1 Like

You’re missing the top level data object in your payload.

{"data":{"message":"Forno acceso","title":"Accensione forno"}}

I did the change but nothing happens:

{
    "data": {
        "message": "Forno acceso",
        "title": "Accensione forno"
    }
}

Same error…

“Call-service API error. Error Message: extra keys not allowed @ data[‘data’]”

This works fine for me. I was wrong about another level of data:. That was because I create the message to send to the service call, so my payload has to have another data: level in it.

[{"id":"16b6b3ee.6e898c","type":"api-call-service","z":"196ff00e.dd19f","name":"","server":"d86c8a3e.cc7138","version":1,"debugenabled":false,"service_domain":"notify","service":"mobile_app_oneplus_6","entityId":"","data":"{\"message\":\"This is a notification\",\"title\":\"home ass\"}","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":1020,"y":120,"wires":[[]]},{"id":"d86c8a3e.cc7138","type":"server","z":"","name":"Home Assistant","legacy":false,"hassio":false,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]

Your “service” should only be mobile_app_soylents_iphone and not notify.mobile_app_soylents_iphone

I got the difference from your exported node.
Anyway same result…

Call-service API error. Error Message: extra keys not allowed @ data[‘message’]

[
    {
        "id": "47f4314c.f9005",
        "type": "api-call-service",
        "z": "f841e824.d474f",
        "name": "",
        "server": "c6e21e6c.847e8",
        "version": 1,
        "debugenabled": false,
        "service_domain": "notify",
        "service": "mobile_app_soylents_iphone",
        "entityId": "",
        "data": "{\"message\":\"Forno acceso\",\"title\":\"Accensione forno\"}",
        "dataType": "json",
        "mergecontext": "",
        "output_location": "",
        "output_location_type": "none",
        "mustacheAltTags": false,
        "x": 700,
        "y": 1560,
        "wires": [
            []
        ]
    },
    {
        "id": "c6e21e6c.847e8",
        "type": "server",
        "z": "",
        "name": "Casa (local https)",
        "legacy": false,
        "hassio": false,
        "rejectUnauthorizedCerts": false,
        "ha_boolean": "y|yes|true|on|home|open",
        "connectionDelay": true
    }
]

Mmmmm I used your node changing server and service name and it works!
Mine node not…

Ok the problem was caused by an intermediate node.
I had to review all my flow because I changed my HA installation.
Thank You for your help

Your “service” should only be mobile_app_soylents_iphone and not notify.mobile_app_soylents_iphone

THANK YOU… this is where I was stuck.

1 Like

Hello, I have this current setup and it’s working fine for one phone, but what if I want to notify two phones?

Is there a way to list multiple entries in the service section?

IE - "service": "mobile_app_john_iphone, mobile_app_maria_iphone" ?