How do I translate HA actions that have indentations in their YAML into node red actions?

Example:

data:
  title: It's gonna be warm today.
  message: Open the windows, turn off the heaters.
  data:
    icon_url: /local/window_closed.png
action: notify.mobile_app_iphone_of_arsi

From looking at other threads, I thought the part that needs to go into the data field would be translated into this:

{
    "message": "Open the windows, turn off the heaters.",
    "title": "It's gonna be warm today.",
    "data": {
        "icon_url": "/local/window_closed.png"
    }
}

But it doesn’t work. I’m getting the error “InputError: Invalid JSON: { “message””

Where are you entering this? In the data section of an action node? Is the data section set to JSON?

1 Like

In the data section of the action node. Yes, it is set to JSON.


You have an old set of home assistant nodes. Domain and service has been combined to create “action” as opposed to “call service”. Backup your NR addon first then the right side hamburger menu choose manage palette and update the HA nodes.

1 Like

I might do that. But you know what’s odd? It just randomly worked.

1 Like

There recently has been quite a few structural changes to HA. Be aware that this can cause NR to stop working. Check your logs for warnings about using depreciated methods.

I tried using the updated HA nodes but then I noticed that the special characters “%” and “<” don’t show in HA companion app notifications, even though they did before, I think. Any idea what to do about this?

{
    "message": "Luftfeuchtigkeit <55%",
    "title": "Wasch heute Wäsche.",
    "data": {
        "notification_icon": "mdi:washing-machine",
        "color": "#AFEEEE"
    }
}

Leave a space after the <.

"Luftfeuchtigkeit < 55%"

Did you update the NR addon as well? Or just the nodes?

Thank you. This worked. But is there no way of doing it without a space?

I updated the NR addon and the HA nodes.

You can use the alt code for < "Luftfeuchtigkeit &#x003C;55%"

Can you screenshot what is happening? In the node red addon logs are there any errors or warnings?