Hi, I have a doorbell sensor that I what these rules:
If door bell Rings:
a. Send email notification with camera screen grab
b. If between 9am and 9pm alert on all Alex’s
c. If between 9pm and 9am only alert on downstairs Alexas (kids are in bed)
Currently I have 3 separate automations for each of the above which is working fine, but looks very messy and I am having to repeat a lot of lines of code.
How can I condence this down to one single automation?
Thanks Tinkerer, only one thing which doesn’t work is using multiple devices, ‘media_player.lounge_echo, media_player.kitchen_echo’, where single does ‘media_player.lounge_echo’. How can I use multiple devices in target?
Hi guys, sorry on a much more basic automation, I am trying to turn on my desklight - Sonoff Basic (Tasmotized 8.2) when the temp from the DHT11 on GPIO14 goes above 25 degrees… I then want it to turn off when it goes below 22 degrees. I can only get the automation for turning on, to work!
When I try to add a second automation I get errors… I have changed indenting etc but no luck.
You didn’t even provide a complete single automation let alone a second automation so we can see where the error is. Not to mention that you didn’t say what the error even was so we know where to look.
So this is the full Automation that I wrote.
However in the file editor page at the top right I have the RED cation which says,
'duplicated mapping key at line 11, column 1:
alias: ‘automation2’
So when I scaled it back to just the 1st part I was able to get it to work. (Although I can’t get it to work anymore.)
If these are in the same file with the default automation: !include automations.yaml in configuration.yaml then you need to make them a list by putting a hyphen before the aliases like this (and aligning the elements in each automation accordingly):
- alias: Turn light on
trigger:
platform: numeric_state
...
- alias: Turn light off
trigger:
platform: numeric_state
...
The alias can be whatever you want, I just used those as examples.
THANK YOU. THANK YOU. THANK YOU. THANK YOU. THANK YOU. THANK YOU.
Solved… you are a champion.
I did try a variety of variations with indents and spacings but now can see what it needed.
This is the final