The following State Trigger will trigger when the sensor’s state changes from some value tobutton_3_single.
trigger:
- platform: state
entity_id:
- sensor.sonoff_bedroomr5
to: button_3_single
If you press the same button twice, the sensor’s value won’t change the second time (because the previous and new values are identical) so because there’s no state-change it won’t trigger the State Trigger.
You can check its behavior using this simple automation.
alias: button test
trigger:
- platform: state
entity_id:
- sensor.sonoff_bedroomr5
to: button_3_single
condition: []
action:
- service: notify.persistent_notification
data:
title: "{{ now().timestamp() | timestamp_custom() }}"
message: Button pressed.
Press the button once and the automation will post a persistent notification. Press the same button again and see if another notification is produced or nothing happens.
OK, that’s interesting so it means the sensor’s state doesn’t remain the same after the button is released. What is the sensor’s state immediately after the button is released?
I think the Sonoff’s R5 Scene Controller is a state less device. I mean when I press a button on my R5 it shows in the log as “Main Bedroom R5 changed to button_3_single
7:43:07 AM - 2 hours ago”.
But when I pressed the same button again, it just shows “Main Bedroom R5
7:43:08 AM - 2 hours ago”.
Although I have used the same button on my R5 to toggle switch & it successfully toggles the switch even if I single press the desired button once & then again within the next 2-3 seconds if I press the same button again, it succesddfully toggles the switch again.
When I press any button on my R5 it shows the exact button that I pressed & then it disappears.
Example when I Single Press the Button 3 on my R5, it shows button_3_single for a second then the state goes blank. BTW it is being able to detect each button single press within 1.5s of each press.
I’m unable to create input_select because there is no input select option under Helpers. I checked my configuration.yaml file & it has default_config:
But because i was not seeing the input select option under the helpers; i searched online & it said that if it was deleted them i should add input_select: to my yaml file. I did that & checked the config and restarted. But i still can’t see the input select. Attaching screenshot of the helper section.
Oh. Thanks for pointing that out. BTW using the code worked for me. Another thing the code that you posted has a small mistake; color_name: "{{ states(input_select.colors') }}"
It should be; color_name: "{{ states('input_select.colors') }}"
I want to ask another thing is there any way to assign each color different brightness level. Example: Red at 80%, Green at 60%, Blue at 40%, etc.?
Yes, but it changes the automation significantly. Are there any other features you want to add because it’s more efficient (for me) to know all of the requirements in advance.
Thanks. BTW this post is solved. But there are 3 different automations that were solved. So which one should i select as the solution? Or you want to create one final post including all the three automations, so that i can select it as the solution?
Hi. I am reviving this as i face the same issue, and the shelly integration still does not let you handle the RGBW2 like a simple LED…
I am unclear where I would need to put this array?
The Helper is not accessible via YAML or any other editor.
Or what am I missing?
Also is there a way to extract the values from a color wheel?
I find it in particular frustrating that the frontend in HA gives you a color way but no way to adress it within an automation.