Do I have so do anything to have an automation start ( after completing it ) or they will function with the set conditions and triggers ?
I check the logbook but only one of the automations show to be running as configured .
Do I have so do anything to have an automation start ( after completing it ) or they will function with the set conditions and triggers ?
I check the logbook but only one of the automations show to be running as configured .
You shouldn’t have to do anything.
Many new users misunderstand the basics of event-driven triggers. Since you are having issues with numeric state related triggers, make sure you understand how they work.
id: '1716856711613'
alias: Biru Blaze HFC WedNite 95%
description: 'fan controls humidity of enclosure by set temps '
trigger:
- type: humidity
platform: device
device_id: 01c5acc026bfc71c90c0e7359428e015
entity_id: 24c2b2073424ae443122e58bd6c3dc8c
domain: sensor
above: 95
- platform: homeassistant
event: start
id: Biru Blaze Fan-On
- type: humidity
platform: device
device_id: 01c5acc026bfc71c90c0e7359428e015
entity_id: 24c2b2073424ae443122e58bd6c3dc8c
domain: sensor
below: 93
for:
hours: 0
minutes: 5
seconds: 0
id: Biru Blaze Fan-Off
condition:
- condition: time
after: sensor.sun_next_dusk
before: sensor.sun_next_dawn
weekday:
- wed
action:
- choose:
- conditions:
- condition: trigger
id:
- Biru Blaze Fan-On
sequence:
- type: turn_on
device_id: e7f4512f7c5a2effc641293410819e48
entity_id: cf2eb6286817d34e3bc9949ef05881fe
domain: switch
- conditions:
- condition: trigger
id:
- Biru Blaze Fan-Off
sequence:
- type: turn_off
device_id: e7f4512f7c5a2effc641293410819e48
entity_id: cf2eb6286817d34e3bc9949ef05881fe
domain: switch
mode: single
this one above works as it should
alias: Salem Ornamental HFC WednesDay 88%
description: |-
fan controls humidity of enclosure by set temps
HFC - Humidity Fan Control
trigger:
- type: humidity
platform: device
device_id: 33b3bcf399f68c16f8015b204512ece1
entity_id: 95a5f63417517313dae90c156821b5c9
domain: sensor
id: Salem ornamental Fan-On
above: 88
- platform: homeassistant
event: start
- type: humidity
platform: device
device_id: 33b3bcf399f68c16f8015b204512ece1
entity_id: 95a5f63417517313dae90c156821b5c9
domain: sensor
id: Salem ornamental Fan-Off
below: 86
for:
hours: 0
minutes: 5
seconds: 0
condition:
- condition: time
after: sensor.sun_next_dawn
before: sensor.sun_next_dusk
weekday:
- wed
action:
- choose:
- conditions:
- condition: trigger
id:
- Salem ornamental Fan-On
sequence:
- type: turn_on
device_id: a3db8fb2af0407b79d237dbbb9945709
entity_id: 16dc374f4c4c55017fd052de6c809487
domain: switch
- conditions:
- condition: trigger
id:
- Salem ornamental Fan-Off
sequence:
- type: turn_off
device_id: a3db8fb2af0407b79d237dbbb9945709
entity_id: 16dc374f4c4c55017fd052de6c809487
domain: switch
mode: single
this one is not running ( the salem one does not have an ID like the Biru one does… can that be an issue and how do i make sure it have an ID if that is the issue)?
Please format your code properly by adding 3 back-ticks on the line above and the line below the code block.
Are you sure the first one is actually working the way you expect…?
Each of them have a trigger without an ID, which will cause the Choose to run no action. In the first the high humidity trigger isn’t doing anything… in the second the restart trigger isn’t doing anything.
“Device_ID” wouldn’t be the ID being used on the trigger part ?
I followed this video to create this automation . Of course I went with humidity so a slight change.
I moved over from your other topic, and just wanted to give you some beginners tips.
And “Welcome to the forum!” btw…
The thing with Home Assistant is the steep learning curve. Many things can be done in HA, but a lot of these require some basic understanding of the underlying techniques.
That leads to the unfortunate thing, that people look for something, strand with a video, but the techniques used are either outdated (as you saw in the other post) or not really suited for beginners. It’s practically impossible for new users, to see that difference.
Long story short, start with basics and work your way up over time.
Taking your automation as an example, don’t use trigger_id
s in the beginning. If you want to have two different things done, make two automations. Work with easy understandable things, like a state
trigger. Don’t get yourself confused with lists of triggers or things like that. Make an automation for one device with one trigger. See if this works as expected an build upon it.
I think you get what I mean. The learning curve is step enough, why complicate things in the beginning, when there is time for these details later on, after a little knowledge is gathered.
And on a seperate note: Don’t use device_id
s at all! See here for more information:
Not to forget the Cookbook itself, you can find some interesting topics there:
completely understood. was really trying to simplify the process of having to make 224 automations ( 7 days out of the week , 1 for during the day, 1 for during the night, on and off with 5 different tanks with their perspective sensors). but if thats what it requires then ill get started writing these automations
thanks to everyone for assisting. im starting to miss the automations since they were simple to create and worked but thats a thing of the past since its updated ios broke all automations.
In time ill get to love home assistant, right now its … not a loving feeling lol.
No… but even if it was, none of your device IDs are “Salem ornamental Fan-On” or “Salem ornamental Fan-Off” which are the only values you have assigned actions for.
For the second automation, if you want the restart trigger to fire an action assign it one of the IDs, like:
- platform: homeassistant
event: start
id: Salem ornamental Fan-On
The same goes for the first automation’s high humidity trigger, assign it the appropriate ID.
I get what you are saying, is it possible that in the editor ( not yaml) its assigning the ID of the device and not the ID of the trigger. I say this because it is turning the fan on at the set % of humidity assigned and turning off when it reaches below set % of humidity.
either way as much as i would like this to work this way i see it may be frustrating people in that it appears that im not setting it up correctly ( my luck is im using an old video to follow the steps). so im just going to get started on creating new simple automations to have it simpler for the system, myself and trouble shooting.
I hope it wasn’t me that set you off, I can asure you, it’s not what I meant, nor what this forum is like! All the people are here to help, and it is a common understanding that only really, really dumb questions get answered ironically or sarcastically. Like “I’ve cut the power to the server, why is my HA not running anymore?”
That being said, it’s not that you should “hide” the things you do, ask if you need to. And you don’t get people frustrated because you’re a beginner, we all know how hard it was!
Back to my post before:
What I meant was, start with one automation that you want to setup. See, if it does what you want and then expand on it.
Before I give you an example, start with some basic things, that will help you down the road a lot, like using some kind of a naming convention. Name your entities with some system, like areaOrRoom_device_entity
what would translate to the real world like “livingroom_thermometer_temperature” or “livingroom_thermometer_humidity”. If necessary you can always add to that, like “livingroom_table_thermometer_temperature”. You get the idea. That way you’re avoiding all the things that come with device_id
s.
This automation is complicated, not only to read, but as well to work with:
id: '1716856711613'
alias: Biru Blaze HFC WedNite 95%
description: 'fan controls humidity of enclosure by set temps '
trigger:
- type: humidity
platform: device
device_id: 01c5acc026bfc71c90c0e7359428e015
entity_id: 24c2b2073424ae443122e58bd6c3dc8c
domain: sensor
above: 95
- platform: homeassistant
event: start
id: Biru Blaze Fan-On
- type: humidity
platform: device
device_id: 01c5acc026bfc71c90c0e7359428e015
entity_id: 24c2b2073424ae443122e58bd6c3dc8c
domain: sensor
below: 93
for:
hours: 0
minutes: 5
seconds: 0
id: Biru Blaze Fan-Off
condition:
- condition: time
after: sensor.sun_next_dusk
before: sensor.sun_next_dawn
weekday:
- wed
action:
- choose:
- conditions:
- condition: trigger
id:
- Biru Blaze Fan-On
sequence:
- type: turn_on
device_id: e7f4512f7c5a2effc641293410819e48
entity_id: cf2eb6286817d34e3bc9949ef05881fe
domain: switch
- conditions:
- condition: trigger
id:
- Biru Blaze Fan-Off
sequence:
- type: turn_off
device_id: e7f4512f7c5a2effc641293410819e48
entity_id: cf2eb6286817d34e3bc9949ef05881fe
domain: switch
mode: single
Simplify for the beginning and work your way up.
id: Biru Blaze HFC WedNite 95%
alias: Biru Blaze HFC WedNite 95%
description: 'fan controls humidity of enclosure by set temps '
trigger:
- platform: numeric_state
entity_id: sensor.livingroom_thermometer_humidity
above: 95
action:
- service: fan.turn_on
entity_id: fan.livingroom_ceiling
mode: single
If this works as expected, configure a second trigger.
id: Biru Blaze HFC WedNite 95%
alias: Biru Blaze HFC WedNite 95%
description: 'fan controls humidity of enclosure by set temps '
trigger:
- platform: numeric_state
entity_id: sensor.livingroom_thermometer_humidity
above: 95
- platform: homeassistant
event: start
action:
- service: fan.turn_on
entity_id: fan.livingroom_ceiling
mode: single
This is a second trigger, but is that what you want exactly? Shouldn’t there be some check, if the humidity isn’t below 95%? Add that as a condition.
id: Biru Blaze HFC WedNite 95%
alias: Biru Blaze HFC WedNite 95%
description: 'fan controls humidity of enclosure by set temps '
trigger:
- platform: numeric_state
entity_id: sensor.livingroom_thermometer_humidity
above: 95
- platform: homeassistant
event: start
condition:
- condition: numeric_state
entity_id: sensor.livingroom_thermometer_humidity
above: 95
action:
- service: fan.turn_on
entity_id: fan.livingroom_ceiling
mode: single
When you have configured this automation that it works like you want it to, move on to the next part by setting up an automation to stop the fan.
After you have both working, you’ll likely have a lot more knowledge on how and what is going on. I would speculate after the fourth or fifth automation you will get to a point, where you see, how these two beginners automations fit together in one.
But I’m always a fan of easy to read code. Your wife/husband/partner should as well understand, what is happening in that automation. So even as an experienced user of HA, I still have some of these automations, why wouldn’t I? Complicating things is not the end goal here, at least not for me.
EDIT: removed copy&paste error in conditions, sorry!
hey no, no one set me off. I appreciate all the help. when you say to " name my entities" - i had gone into the entity and changed its ID to a name like in this photo.
or its the name that i have to use “-” to be able to keep the entities with that name?
i ask because after naming the entity ID it still shows a long numerical serial #
This part will not work. What was the intent of the condition? if something should happen at this time, make it a trigger. Because as a condition, you would need the automation trigger to happen exactly at this time. Chances of that are very close to 0.
Thanks for pointing that out, it was a copy&paste error. I’ll update the post above.
Otherwise sound advices
After reading to better understand what you guys meant about entity ID ( thank you for the direct link to learb about it ) and the different platforms ( numeric_state and service) . I really do hope this has become simplified to the point someone on here can understand, and it works as intended. of course any and all help truly helps me to try and do better.
the “data: {}” is there something i have to input in here or that something i leave alone
alias: Biru Blaze HFC WedNite 95%
description: "fan controls humidity of enclosure by set temps "
trigger:
- platform: numeric_state
entity_id:
- sensor.biru_blaze_sensor_humidity
above: 95
id: "Biru Blaze fan-on "
- platform: homeassistant
event: start
id: "Home assistant start fan-on "
- platform: numeric_state
entity_id:
- sensor.biru_blaze_sensor_humidity
below: 93
id: "Biru Blaze fan-off "
condition:
- condition: time
after: sensor.sun_next_dusk
before: sensor.sun_next_dawn
weekday:
- wed
action:
- choose:
- conditions:
- condition: trigger
id:
- "Biru Blaze fan-on "
sequence:
- service: switch.turn_on
data: {}
target:
entity_id: switch.biru_blaze_fan
- conditions:
- condition: trigger
id:
- "Biru Blaze fan-off "
sequence:
- service: switch.turn_off
target:
entity_id: switch.biru_blaze_fan
data: {}
- conditions:
- condition: trigger
id:
- "Home assistant start fan-on "
sequence:
- service: switch.turn_on
target:
entity_id: switch.biru_blaze_fan
data: {}
mode: single
Good afternoon all. Dropping in to say hi and bringing this thread back to top for a little review
Do you have a question?
In your previous post you stated “it works as intended”…
I was mentioning that I hope it works as intended . Not that it’s running yet.
There are a couple issues with the condition:
This may be on purpose, but it is only set to work on Wednesday… If you want the automation to work all the time, you need to fix that part.
The second issue is much more important. The current time will only be both `after sensor.sun_next_dusk and before sensor.sun_next_dawn for a few milliseconds… You should use either Numeric State conditions or templates Conditions instead.
Just FYI, you can use trigger ID’s more than once. That way you avoid having to have repetitive Options in the Choose action:
alias: Biru Blaze HFC WedNite 95%
description: "fan controls humidity of enclosure by set temps"
trigger:
- platform: numeric_state
entity_id:
- sensor.biru_blaze_sensor_humidity
above: 95
id: "Biru Blaze fan-on"
- platform: homeassistant
event: start
id: "Biru Blaze fan-on"
- platform: numeric_state
entity_id:
- sensor.biru_blaze_sensor_humidity
below: 93
id: "Biru Blaze fan-off"
condition:
- alias: "Sun elevation is between dusk and dawn: overnight"
condition: numeric_state
entity_id: sun.sun
attribute: elevation
below: -6
action:
- choose:
- conditions:
- condition: trigger
id:
- "Biru Blaze fan-on"
sequence:
- service: switch.turn_on
data: {}
target:
entity_id: switch.biru_blaze_fan
- conditions:
- condition: trigger
id:
- "Biru Blaze fan-off"
sequence:
- service: switch.turn_off
target:
entity_id: switch.biru_blaze_fan
data: {}
mode: single
The {}
after data:
is auto-populated by the automation editor, you do not need to do anything to it.
aaah yes you noticed the date. soo what this is simulating is the humidity levels of the spiders origin. so what i did was checked out the weather website for 10 days and created automations for during the day with the humidity of its location, then the same for the night. then i followed that by checking the humidity for each day so that the humidity for each day and night is its own automation
ok so like the trigger ID biru fan-on, use that for the homeassistant start instance. ok ill work on adjusting that…
so what are your thoughts on duplicating this yaml script and only tweaking it accordingly for each device sensor and fan ( basically not having to right this out over and over). or is the duplicate script function not to be trusted?
once again thank you for all the help. once this is ironed out and spiders are safe i will have another … idea im working on having to do with me desiging some things then coding. ultimate goal is to mimic environment for animals in a more fluid way with an automated system that takes account for different days and seasons . now i dont know how to use a weather API to generate the humidity temps but maybe one day thats the next big step.