Hello,
I’m trying to use a xiaomi switch to cycle through scenes for a hue light (both hue scenes or HA scenes are ok) using the same single click action
This is my code so far:
Automation
- id: '1514305999984'
alias: "Cicla Scene Luci Soggiorno"
trigger:
event_type: click
platform: event
event_data:
click_type: single
entity_id: binary_sensor.switch_158d00019d676c
action:
entity_id: input_select.living_room_scenes
service: input_select.select_next
action:
service: scene.turn_on
data_template:
entity_id: '{{ states.input_select.living_room_scenes.state }}'
Input_Select and Scenes
input_select:
living_room_scenes:
name: Scenes
options:
- Full Brighness
- Late Evening
- Dim to 50%
initial: Full Brighness
icon: mdi:lightbulb-on-outline
scene:
- name: Full Brighness
entities:
input_select.full_brightness:
option: Full Brighness
light.soggiorno:
state: on
transition: 2
brightness: 254
- name: Late Evening
entities:
input_select.late_evening:
option: Late Evening
light.soggiorno:
state: on
transition: 2
brightness: 25
- name: Dim to 50
entities:
input_select.dim_50:
option: Dim to 50
light.soggiorno:
state: on
transition: 2
brightness: 127
When I press the button I see the input select change, but then I get this error:
2017-12-26 18:05:38 ERROR (MainThread) [homeassistant.core] Invalid service data for scene.turn_on: Entity ID full brighness is an invalid entity id for dictionary value @ data['entity_id']. Got 'Full Brighness'
That seems because the data template passes the scene name instead of entity_id, any Idea on how to fix this?