Home assistant call service node: invalid json syntaxerror unexpected token

i don't get what i'm doing wrong. i'm trying to use the call service node in home assistant to trigger:

domain: light
service: turn_on
entity id: light.master_bedroom
data: "brightness_pct": "100", "kelvin": "2700"

the json editor is complaining 'invalid json: syntaxerror: unexpected token : in json at position 16' in my data field. with the pages of light service data nomenclature that's plastered all over the call service node properties screen it would be nice if there was 1 syntax example.

From what you posted, it does not look like valid json. You have a nested object "data".
The object might look like this:

{
  domain: 'light',
  service: 'turn_on',
  'entity id': 'light.master_bedroom',
  data: {
    brightness_pct: 100,
    kelvin: 2700,
  },
}

With the corresponding json string:

{
   "domain":"light",
   "service":"turn_on",
   "entity id":"light.master_bedroom",
   "data":{
      "brightness_pct":100,
      "kelvin":2700
   }
}

what is the correct typed syntax for my data field? it is not:

"brightness_pct": "100", "kelvin": "2700"

the correct syntax is:

{"brightness_pct": "100", "kelvin": "2700"}

the properties dialog STRONGLY implies the {} is provided, but it is not.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.