I have an automation that is intended to set the color of a scene controller button LED based on values of other switches.
I originally had it “mostly” working with just a series of if-thens for the actions using this config.
alias: Set Kitchen Zooz Scene 2 LED Color
description: ""
trigger:
- platform: event
event_type: set_zooz_scene2_color
condition: []
action:
- if:
- condition: state
entity_id: switch.second_floor_lights
state: "on"
then:
- device_id: 5416582252fbb94e976a1524c3ea804e
domain: zwave_js
type: set_config_parameter
parameter: 8
bitmask: null
subtype: 8 (LED Indicator Color (Button 2))
value: 3
- if:
- condition: state
entity_id: switch.first_floor_lights
state: "on"
then:
- device_id: 5416582252fbb94e976a1524c3ea804e
domain: zwave_js
type: set_config_parameter
parameter: 8
bitmask: null
subtype: 8 (LED Indicator Color (Button 2))
value: 2
- if:
- condition: state
entity_id: switch.basement_lights
state: "on"
then:
- device_id: 5416582252fbb94e976a1524c3ea804e
domain: zwave_js
type: set_config_parameter
parameter: 8
bitmask: null
subtype: 8 (LED Indicator Color (Button 2))
value: 1
mode: single
But this did not handle the condition if ALL of the switches are off. So I tried to nest these if-thens into another if-then which first checks if any of then are on, and then sets the color base don the floor, else (none of then are “on”) set the color to white.
alias: Set Kitchen Zooz Scene 2 LED Color
description: ""
trigger:
- platform: event
event_type: set_zooz_scene2_color
condition: []
action:
- if:
- condition: or
conditions:
- condition: state
entity_id: switch.second_floor_lights
state: "on"
- condition: state
entity_id: switch.first_floor_lights
state: "on"
- condition: state
entity_id: switch.basement_lights
state: "on"
then:
- if:
- condition: state
entity_id: switch.basement_lights
state: "on"
then:
- device_id: 5416582252fbb94e976a1524c3ea804e
domain: zwave_js
type: set_config_parameter
parameter: 8
bitmask: null
subtype: 8 (LED Indicator Color (Button 2))
value: 1
- if:
- condition: state
entity_id: switch.first_floor_lights
state: "on"
then:
- device_id: 5416582252fbb94e976a1524c3ea804e
domain: zwave_js
type: set_config_parameter
parameter: 8
bitmask: null
subtype: 8 (LED Indicator Color (Button 2))
value: 2
- if:
- condition: state
entity_id: switch.second_floor_lights
state: "on"
then:
- device_id: 5416582252fbb94e976a1524c3ea804e
domain: zwave_js
type: set_config_parameter
parameter: 8
bitmask: null
subtype: 8 (LED Indicator Color (Button 2))
value: 3
else:
- device_id: 5416582252fbb94e976a1524c3ea804e
domain: zwave_js
type: set_config_parameter
parameter: 8
bitmask: null
subtype: 8 (LED Indicator Color (Button 2))
mode: single
However, I am getting the following error trying to save this automation.
Message malformed: not a valid value for dictionary value @ data[‘type’]
If I am going about this all wrong (very likely), by all means please advise. But I would still like to understand this error message a little better, regardless.