I want to turn 2 lights on instead of 1 …
- light.turn_on:
id: gangkeuken
id: gangslaapkamer
brightness: 1.0
when compiling it gives an error … Duplicate key “id”
what am I doing wrong ?
is there another way ?
full yaml :
binary_sensor:
- platform: gpio
name: "Keuken 0"
id: buttonkeuken0
pin:
mcp23xxx: mcp23017_hub
# Use pin number 0
number: 0
# One of INPUT or INPUT_PULLUP
mode:
input: true
pullup: true
inverted: true
on_click:
then:
- if:
condition:
light.is_off: gangkeuken
then:
- light.turn_on:
id: gangkeuken
id: gangslaapkamer
brightness: 1.0
else:
light.turn_off: gangkeuken
# light.turn_off: gangslaapkamer
on_press:
then:
- if:
condition:
light.is_off: gangkeuken
then:
- delay: 0.5s
- while:
condition:
binary_sensor.is_on: buttonkeuken0
then:
- light.dim_relative:
id: gangkeuken
# id: gangslaapkamer
relative_brightness: 5%
transition_length: 0.1s
- delay: 0.1s
else:
- delay: 0.5s
- while:
condition:
and:
- binary_sensor.is_on: buttonkeuken0
- light.is_on: gangkeuken
then:
- light.dim_relative:
id: gangkeuken
# id: gangslaapkamer
relative_brightness: -5%
transition_length: 0.1s
- delay: 0.1s
Thanks