Node Red - YAML to JSON formatting

Hi

I’m still getting to grips with YAML and JSON formatting so please bear with me. I have several automations written in YAML but I am experimenting with Nodered with the aim of moving over.

I currently have an node red automation that successfully turns a light on/off when I want. But when I try and incorporate the light effect, which works in YAML I get an API error in nodered.

The YAML config is:

entity_id: light.bedside_lights
data:
  effect: Wake up

which when I format as JSON, I believe should be

{
  "entity_id": "light.bedside_lights",
  "data": {
    "effect": "Wake up"
  }
}

when I paste this into the data field of the call service node in nodered as below

I get an API error when the automation runs. Pretty sure it is my ignorance in formatting JSON

It could be that you only need {"effect": "wake up"} since entity is specified above the json field also.

What does the the debug message say?

@Hellis81 yes thankyou, sometimes it is the simple things staring me right in the face, the below works perfectly.

{"effect": "Wake up"} 

Just to be clear, it worked this time.
Next time when the situation is almost the same it needs the entity in the json.
It’s an annoyance, but you get used to it