Increasing / Decreasing AC Temperature by an increment / decrement of 1.
Retaining the attributes of an rgbw led controller, then changing the attributes for a few seconds & then returning the attributes back to the retained state. Example the light is red color at 50% brightness. If a button is preseed then the light should change to green at 100% brightness for 10 seconds, then it should change back to red at 50% brighntness.
Automation that can cycle between 5 preset colors.
I haven’t exactly tried anything as I am total noob at HA. But below I am mentioning what I think I want from these automation:
Increasing / Decrease Temperature of my Samsung AC: Currently I can set a specific temperature for my samsung AC via the climate service. So I want an automation which when triggered can either increase / decrease the temperature by an increment/decrement of 1. So I think this automation should first fetch the current temperature of my samsung ac & then based on the automation should increase / decrease the temperaure by 1.
To change the temperature of my ac to 26, below is the code:
mode: single
trigger:
- platform: state
entity_id:
- sensor.sonoff_mainbedroomr5
to: button_1_single
action:
- service: climate.set_temperature
data:
temperature: 26
target:
device_id: MainBedroomAC
So the automation should be triggered when the state of the MainBedroomR5 sensor changes to button_1_single.
Then the automation should fetch the Temperature state of the AC.
And then whatever the Temperature was it should increment it by 1.
I can see the Temperature State of my AC by going to Developer Tools > State > MainBedroomAC (Entity) > Temperature.
But I don’t understand how I can fetch this value in an automation & then increment it by 1.
An automation that can be triggered when the state of the MainBedroomR5 sensor changes to button_1_double.
I want this automation should first fetch the current state of my MainBedroomLED (Shelly RGBW2 Controller); suppose it fetches that the RGBW was set to Cyan Color at 50% Brightness without any coolor changing effect. Then it should change the state of the LED to my desired color, brightness & effect for 10 seconds i.e. Red Color at 30% Brightness without any color changing effects.
After the 10 seconds has passed the LED state then should return back to its old state i.e. Cyan Color at 50% Brightness. Below is the code that can be used to set the state of the LED to the above mentioned color:
I can’t figure out the part of the automation that fetches the current state of the LED & store it, then once the above automation runs (along with the 10s delay), the state of the LED should change back to the stored (previous) state.
In float(21), what does 21 mean?
Before running this automation my ac temp was 29. When I use this automation, it sets the temp to 22 which is 21+1. Its not fetching the current temp.
Sorry I wasn’t more clear about what automation that I wanted to run.
I want an automation that changes color of my Shelly RGBW2 Controller from one color to another upon a button press i.e. the button_3_single state of an R5 Scene Controller.
So, the trigger should be,
trigger:
- platform: state
entity_id:
- sensor.sonoff_bedroomr5
to: button_3_single
So the actions should be as follows:
action:
RED at 100%
Each time when I single press the Button 3 of my R5, it should change color. Suppose my RGBW2 controller color is set to White at 25% Brightness. When I Single Press the Button 3 of my BedroomR5 it should change its color to Red at 100% Brightness. Then if I single press the same button again it should change the color to Blue at 100% Brightness, then again to Green at 100% & then again to White at 100%.
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?