Node-red (nested json?)

Hello HA community.

I’m somewhat new to node-red and have a question about nested attributes. This is a snippet of what my current HA automation looks like:

    data:
      title: light notification
      message: 'The kitchen light is: {{states(''light.kitchen'')}}'
      data:
        actions:
        - action: KITCHEN_LIGHT_OFF
          title: Kitchen light off
        - action: KITCHEN_LIGHT_ON
          title: Kitchen light on

I can get the title and message working correctly but I’m not sure how to handle the actions section within the node. Ultimately what I’m trying to do is use node-red to send mobile notifications. Can someone help me understand what this would look like as a json formatted object in the data field within the node?

You can use a YAML - JSON converter.

Should give you a good idea of how the syntax works.

1 Like

Thanks a lot for this. This showed me exactly where I was making the mistake.

No problem. JSON can be a little confusing at first, but once you get used to its easy :slight_smile: