I want to create a single automation/blueprint that contains 18 automations.
Below are the codes of two automations:
alias: 2F Main Bedroom Light ON via Single Press
trigger:
- platform: state
entity_id:
- sensor.sonoff_a0a00a0a00
to: button_1_single
action:
- type: toggle
device_id: 0000a0a0a0000a0a000aaa00000a00a
entity_id: switch.sonoff_a00a0a0aa0_0
domain: switch
mode: single
&
alias: 2F Main Bedroom Light Extra ON via Double Press
trigger:
- platform: state
entity_id:
- sensor.sonoff_a0a0000a00
to: button_1_double
action:
- type: toggle
device_id: 0000a0a0a0000a0a00a0aaa00000a00a
entity_id: switch.sonoff_000a0a0aa0_0
domain: switch
mode: single
I have 90 such automation that I want to integrate into a single automation/blueprint.
Can someone please tell me how I can make this possible?
The two automations you posted can be easily combined into one because they both do exactly the same thing (toggle a switch) when the sensor changes to either button_1_single or button_1_double.
alias: example
trigger:
- platform: state
entity_id:
- sensor.sonoff_a0a0000a00
to:
- button_1_single
- button_1_double
action:
- type: toggle
device_id: 0000a0a0a0000a0a0000aaa00000a00a
entity_id: switch.sonoff_00000a0aa0_0
domain: switch
mode: single
My bad. I tried to mask the entity id & device id; and in doing so I messed up. These two section of codes are two different automations i.e. they control two different switches. So I need a way to integrate 18 automations into a single blueprint/automation. Actually I was trying to make a blueprint for my Sonoff R5 Scene Controller. It has 6 buttons & each button support single tap, double tap & hold. So in total it can perform 18 independent automation. Sorry for my typo of 90 instead of 18. So can you please tell me how I can do the above?
Below are the three different automations that control three different switches by using three different remote press types.
The 1st automation is triggered when I press the Button 1 of my R5 once; this toggles the Light 1.
alias: 2F Main Bedroom Light ON via Single Press
trigger:
- platform: state
entity_id:
- sensor.sonoff_2f_main_bedroom_r5
to: button_1_single
action:
- type: toggle
device_id: 1685a5h0k7843a1b734bff38094d13g
entity_id: switch.sonoff_2f_main_bedroom_light
domain: switch
mode: single
The below automation is triggered when I double press the Button 1 on my R5; which toggles the Light 2.
alias: 2F Main Bedroom Light Extra ON via Double Press
trigger:
- platform: state
entity_id:
- sensor.sonoff_2f_main_bedroom_r5
to: button_1_double
action:
- type: toggle
device_id: 7536f6a6n9467g7v54v0bng65070c23v
entity_id: switch.sonoff_2f_main_bedroom_light_extra
domain: switch
mode: single
The below automation is triggered when I long press/hold the Button 1 of my R5; which toggles the Fan.
alias: 2F Main Bedroom Fan ON via Hold
trigger:
- platform: state
entity_id:
- sensor.sonoff_2f_main_bedroom_r5
to: button_1_hold
action:
- type: toggle
device_id: 6589a3f6a6965f4c0912ghr43875d13d
entity_id: switch.sonoff_2f_main_bedroom_fan
domain: switch
mode: single
I want to know is there any way to integrate these three automations into a single automation/blueprint?
Can you please elaborate? I am total noob when it comes to automations. Based on the above automations (codes), can you please give me an example on how to use trigger id & the choose action?
The 1st automation code that you have posted is working. But the 2nd one is not working properly i.e. nothing happens when I single or double press the Button 1 on my R5. But the hold/long press is workin i.e it toggles the fan. BTW can you please tell me how I can control AC (Temperature Control) & RGBW LED (Shelly RGBW2 Controller) in this senario? I mean Suppose I want to include 3 automations in a single automation; the 1st one being a switch toggle, the 2nd one being Increase AC Temperature & the 3rd one being Changing the color of the RGBW controller to Cyan?
Oh, thanks for the correction. I will try the 2nd automation soon. BTW the 2nd automation looks much tidier than the 1st one.
Below are the three different automations;
In this automation Single Pressing the Button 2 on my R5 Toggles the Light
alias: 2F Main Bedroom Light ON via Single Press
trigger:
- platform: state
entity_id:
- sensor.sonoff_2f_main_bedroom_r5
to: button_2_single
action:
- type: toggle
device_id: 1685a5h0k7843a1b734bff38094d13g
entity_id: switch.sonoff_2f_main_bedroom_light
domain: switch
mode: single
In this automation Double Pressing the Button 2 on my R5 does three things i.e. Turns ON the AC Switch, then Waits for 30 Seconds (It takes approximately 25s for my Samsung AC to connect to my WiFi) & then it Sets the AC Temperature to 26 in Cool Mode.
alias: 2F Main Bedroom AC On via Double Press
trigger:
- platform: state
entity_id:
- sensor.sonoff_2f_main_bedroom_r5
to: button_2_double
action:
- type: turn_on
device_id: a1f654f872498a00q3h84085f4454cbh
entity_id: switch.main_bedroom_ac
domain: switch
- delay:
hours: 0
minutes: 0
seconds: 30
milliseconds: 0
- service: climate.set_temperature
data:
temperature: 26
hvac_mode: cool
target:
entity_id: climate.computer_room_ac
mode: single
In this automation Long Pressing/Holding the Button 2 on my R5 Turns ON & Sets the RGBW LED Controller (Shelly RGBW2) to Cyan Color at 20% Brightness.
alias: 2F Main Bedroom LED On Cyan via Double
trigger:
- platform: state
entity_id:
- sensor.sonoff_2f_main_bedroom_r5
to: button_2_hold
action:
- service: light.turn_on
data:
rgbw_color:
- 0
- 255
- 255
- 0
brightness_pct: 20
target:
device_id: 33v54g00v2f75961356389546lo3v745
mode: single
This automation will turn on the alarm system when all phones are more then 201 mtrs from the house AND turn it off again once closer than 199 mtr from the house
Please consider marking my post above with the Solution tag. It will automatically place a check-mark next to the topic’s title which signals to other users that this topic is resolved. This helps other users find answers to similar questions. For more information, refer to guideline 21 in the FAQ.
I was trying to mark your post as solution. But there is no option to do so. I refered to the guideline link that you provided, but I was unable to find that option under your post.
My bad regarding the device_id confusion. It is in fact working.
I have another request that is related to the 2nd automation.
Is there any way to perform the action of increasing or decreasing the exisiting temperature of the AC by using an automation. I mean the automation should either simply increment the existing temperature by +1 or -1. Can this be done?
Because you have the original thread/post under the wrong category (Blueprint Exchange), it should be under “Configuration”. if you change that, you should be able to mark it as solved.