Take Your Home Assistant Automations to the Next Level!
HTML-код
- Опубликовано: 12 сен 2023
- In this video, I demonstrate three different methods of using conditional logic to make decisions in your automations, including condition blocks, choose blocks, and if...then...else logic.
For code, early access to ad-free videos, exclusive giveaways, free t-shirts and more, please consider supporting the channel by becoming a Patron at / fasthowto
This episode's t-shirt: amzn.to/4857Jnz
Some of my favorite home automation things:
Aqara temperature and humidity sensor (zigbee): amzn.to/3X2ubr3
Aqara water leak sensor (zigbee): amzn.to/3JkWH3P
Aqara door & window sensor (zigbee): amzn.to/3Ril7N7
Aqara mini switch (zigbee): amzn.to/3HlmmGK
Aqara motion sensor (zigbee): amzn.to/3kV2eDS
Conbee II Zigbee stick: amzn.to/40pORfx
Zigbee and Zwave coordinator: amzn.to/3yuqPTG
USB extension for Zigbee/Zwave sticks: amzn.to/3ySQGVL
Intel Nuc: amzn.to/3JcVivA
KASA outdoor outlet (wifi): amzn.to/3XOLoFl
KASA indoor outlet HS103 (wifi): amzn.to/3XOLVai
KASA single pole dimmer HS220 (wifi): amzn.to/3HgOaft
KASA single pole switch HS200 (wifi): amzn.to/3HHNEsC
KASA three way switch HS210(wifi): amzn.to/3kSZ0ks
KASA three way dimmer KS230 (wifi)" amzn.to/3kQm2s8
Shelly 2.5 relay switch (wifi): amzn.to/40drGon
Honeywell T9 thermostat (wifi, homekit): amzn.to/3WOVvsD
Honeywell T9 remote zone sensor: amzn.to/3jfr5Sw
Sonoff S31 Lite smart plug (zigbee): amzn.to/3HDsb3U
Sonoff S31 smart plug with power monitoring (zigbee): amzn.to/40fkvMk
Sengled bulbs (zigbee): amzn.to/3JH95vl
MyQ Homebridge for Chamberlain/Liftmaster MyQ garage door openers (wifi, homekit): amzn.to/3DrfxSW
MyQ Chamberlain/Liftmaster garage door controller for non-MyQ openers (wifi): amzn.to/3HIctVm
August 4th generation WiFi smart lock: amzn.to/3ksXZj3
Motorola MoCA Adapters: amzn.to/41h9LxI
My studio gear:
Canon 90D (primary and secondary cameras): amzn.to/3WOvmKz
Canon EF 24mm f/1.4 L II USM (primary lens): amzn.to/448iD8Q
Canon EF 28mm f/1.8 USM: amzn.to/3DkPvAH
Canon EF 50mm f/1.4 USM: amzn.to/3jinlQk
Canon EF-S 17-55 f/2.8 IS USM: amzn.to/3kRZgQK
Canon AC adapter: amzn.to/3RgogNC
Canon DC coupler: amzn.to/3HcmTuK
Lexar Pro 128GB SDXC cards: amzn.to/3Drg7jA
ProGrade SD card reader: amzn.to/3HmPRYQ
Lowepro ProTactic 450 camera bag: amzn.to/3DoJras
Manfrotto 055 CX Pro tripod: amzn.to/3XOaMei
Manfrotto 055LC leveling center column: amzn.to/40aYm1R
Manfrotto MVH502AH fluid head: amzn.to/40eyOkw
Rode NTG-3B (primary mic): amzn.to/3kGEbIL
Rode SM4-R shockmount: amzn.to/3Y8zo1m
Shure SM7B (voiceover mic): amzn.to/3wEnX5H
Zoom H4n pro 4-track digital recorder: amzn.to/3Y365x6
Zoom F6 digital field recorder: amzn.to/3ZWxjHa
Cloudlifter for Shure SM7B: amzn.to/3Z31tqO
GLS balanced XLR cables: amzn.to/3kXb97K
TASCAM DR-10 lav mic: amzn.to/3kRvGLb
Windjammer for lav mics: amzn.to/3HFPDNM
Neewer boom arm mic stand: amzn.to/3WH8YCI
Samson MD5 mic stand: amzn.to/3HHP46q
Aputure Amaran 100x lights: amzn.to/40dJqQp
Aputure Light Dome SE: amzn.to/40dJBex
Light stands: amzn.to/3Rethq2
Green screen: amzn.to/3jcOjJ3
Hair light: amzn.to/3RkyzQW
Rim light: amzn.to/3qlynb7
#homeassistant
#smarthome
#smarthouse
#howto
#tutorial Наука
The standard If-Then blows "Choose" out of the water. It's so much easier to understand...
DEFINITELY far easier to understand, I agree. Choose does have it's applications, but 99% of the time the exact same thing can be accomplished through creative use of If..Then. :)
Thanks for watching!
Like the new video changes! Nice summary of the decision logic approaches.
Awesome, thank you! I'm trying to improve a little bit with every video, so it's great to hear that viewers like the changes. Thanks for watching!!!
I like your shirt and the new intro!
Looks great! Digging the intro!
We live in the North East US. Yes, Oil, for heating. So I have currently setup the ha-multiscrape to monitor 4 different oil providers for their pricing and now it will push me notifications if the price for any one of them changes.
I really am interested in the conditional notifications, if connected to wifi send this notification else send this one, as that would help cut down on the type of notifications I am getting.
That's a really cool use! I have some stuff I'd like to scrape as well, but it's so far down my list.. Between videos, and the pile of equipment sitting here that I still need to install (and make videos about), it's tough to add more to that list. Lol maybe one day I'll have more free time...
Thanks for watching!!
Chapter marker would be great! Awesome vid though!
Yeah.. I've added them to some videos, but I really do need to do better at that. Thank you for the reminder, and thanks for watching!
@@fasthowto you’re welcome, thanks for the reply
Can you have conditions only (and not have a trigger)? I have 6 conditions that must be false (using an And & block) to turn off a fan, but don't know if a trigger must be specified.
How would the automation run then?
Tried conditions only and it won't trigger. So, added a periodic time trigger (to run once a minute) and now it works.
@@waynekremer1649I don't understand.. Surely one of the 6 things that you are referring to as a condition can be used as a trigger, rather than attempting to trigger it once a minute? What are your conditions?
@@fasthowto I have 6 rooms each with a CO2 monitor in them. When one of the 6 rooms gets too high of a CO2 reading, then it triggers the house fan. When all of the 6 rooms are below the CO2 amount, I turn the fan off. How would I do this with one of the items as a trigger?
I'm sure somebody will dream up a (more complicated) way to do it all in a single automation, but the simplest way to do it is like this:
Automation 1:
Triggers: 6 different triggers, one for each of your sensors. The trigger is the sensor crossing the threshold from acceptable to high.
Action: Turn on the fan.
Automation 2:
Triggers: 6 different triggers, one for each of your sensors. The trigger is the sensor crossing the threshold from high to acceptable.
Conditions: 6 different conditions, one for each of your sensors, in an AND configuration. Check to make sure all 6 sensors are at acceptable levels.
Action: Turn off the fan.
Alternatively, you could configure a template sensor that monitors all 6 of your CO2 sensors, and just use that as the trigger for both turn on and turn off. Would look much cleaner in the interface, and would only be a single thing to edit if you added a 7th sensor. If any of the 6 are high, the template sensor would turn on. When they are all acceptable, it would turn off. That would be how I would do it *now*, personally, since I know how to use template sensors. There's some examples in my Dashboard December series. I use them for all sorts of things, like my battery monitor automation, to change colors of icons on my dashboard, to send high temp alerts, all sorts of stuff.
Even with template sensors, I still prefer to have discrete on/off automations. Makes it much easier to modify individual pieces of a routine than it otherwise would be if I had to dream up a ton of complex logic every time.
So I'd have a "Fan On" automation that would turn on the fan when the template sensor turned on, and a "Fan Off" automation that would turn off the fan when the template sensor turned off. That way, I could make different things happen on each side of the routine as well, such as flashing the lights when the fan turned on to alert to poor air quality so you can go outside for 20 minutes or something. Or I could flash the lights red when the fan turned on, then flash them green when the fan turned off.
Easy. :)