Wow @jimpower that is quite impressive setup and documentation you did there. I will definitely take a deeper look at your “Kingia Castle” setup as it is exactly this kind of home automation I’m going toward. Big thanks for sharing!!
thanks for your time. Im new to home automation. Check config button gives error
Invalid config for [automation]: [input_select] is an invalid option for [automation]. Check: automation->action->0->input_select. (See /config/configuration.yaml, line 67). Please check the docs at https://home-assistant.io/components/automation/
can you explain which scene id from the states tab should i enter? Thank you
So you need to follow the steps I have provided above, the input_select does not go in the automation section.
Step One - Add input_select into your configuration.yaml file exactly as above.
Step Two - Add your scenes to your scene.yaml or configuration.yaml file depending on how you handle scenes, then reboot HA this will add the input_select & scenes and make them available for automations.
Step Three - Add automations to your automation.yaml and reboot.
Once HA Comes back up you can call your automations from the service button to ensure they work.
thank you, now i understand hassio structure much better.
Still struggling with this. Light doesnt respond to double click if input select and scenes are not connected. But from webui i can activate scenes. Where is my mistake?
input_select:
yeecolours:
name: Color Mode
options:
- dim
- bright
initial: bright
icon: mdi:palette
scene:
- name: dim
entities:
light.yeelight_rgb_7c49eb0ff332:
state: on
transition: 1
brightness_pct: 10
kelvin: 5000
- name: bright
entities:
light.yeelight_rgb_7c49eb0ff332:
state: on
transition: 1
brightness_pct: 100
kelvin: 5000
automations.yaml
- alias: Yeelight Dim
trigger:
- platform: state
entity_id: input_select.yeecolours
to: dim
action:
- service: scene.dim
- alias: Yeelight Bright
trigger:
- platform: state
entity_id: input_select.yeecolours
to: bright
action:
- service: scene.bright
- alias: Change light scenes
trigger:
- platform: event
event_type: click
event_data:
entity_id: binary_sensor.switch_158d0001d8ea53
click_type: double
action:
- service: input_select.select_next
data:
entity_id: input_select.yeecolours
I would love to use this solution for cycling through scenes (and playlist-entries) within Node-Red. Has anyone tried this perhaps? Will be thankful for any hints.
The options: script cycles through all options pressing the on (I) button, except for option 0 (off), which is only selected when the off (o) zigbee button is pressed.
To teach myself the new scripting features in 0.113, I modified your automation to use the new choose feature. It is useful when the action must choose between different services and especially when the services have different options. Although it can be done entirely with templates, the result is a bit messy; the choose feature makes it neater.
Here’s how it works:
If the event is 1002, it calls select_next.
If the event is 2002, it sets the input_select to its first option.
Finally, the action calls scene.turn_on and computes the scene’s name. I shortened the template slightly by using regex_replace to remove ( and ) characters.
Wow that looks lots better
Only question I have is, in my earlier script it skipped option 0 as this is the Off option, which I do not want to cycle through.
How does your script prevent that ?
It doesn’t. All it was meant to do was serve as a demonstration of the use of choose to call two different services (select_next and select_option). If you need to skip option 0 then you’re better off using your original automation that calls just one service and uses a data_template.
I have used Taras code for cycling scenes in my house for some time now, and as far as I can see the best alternative I can find, but there are some issues:
My biggest problem is it looks like the automation has taken total control over my switches. I try to use the dim up and dim down buttons in two different automations to dim up and down the light. When I press one of those buttons, I see a short flicker in the light before it’s back to what was set in the scene. When I look in the core log I get these messages (AUR301_06: Dim down automation, AUR301_01: Cycle scene automation):
So it looks like AUR301_01 is triggered even tho the dim up and dim down buttons are not mapped in that automation.
A similar thing happens when switching my house to night mode: I have an automation for long press off on all my dimmer switches that calls the night mode settings. When I long press the off button my whole house goes into night mode, except light in the room where I press the button. In this room light dims shortly before going back to the previous scene.
Another problem I have is after night mode has been triggered it looks like the first cycle scene press I do in a room recalls my last used scene or the next one in the list, not the first one.