#Simple Temperature Sensor Automation didn't Trigger When it Should Have
1 messages · Page 1 of 1 (latest)
This is the whole automation ```alias: Sam's Room - Pets - Automation - Crab's Temp Above 80 - Crab's Light Off
description: ""
triggers:
- type: temperature
device_id: 944943aa423d199cf373cf3443576ac6
entity_id: 8c64b53aef5baef3015fc54fe7cd43f3
domain: sensor
above: 80
trigger: device
conditions: []
actions: - type: turn_off
device_id: 1c90d0ddb6902b9d30e3d72f6181326c
entity_id: 7140f705064a3392c003d61808c9fd48
domain: switch
mode: single
The temperature sensor was above 80 degrees for about 4 hours and it never triggered the automation. The only reason the temperature is going down is because I manually turned off the light.
firstly i suggest using entity selection instead of device selection when making automations.
for this particualar case i would recomend triggering on every change to the temp entity and have a condition that checks if its >80 that way if for some reason it misses the exaact moment it goes over80 and the automation doesnt run it will ensure on any change it will "catch up"
How would I go about doing that? All I see when trying to make is is when it gets above or below a certain temp, it will trigger. The way your describing it would be ideal though.
add trigger, and select entity and not device
then select the temp sensor entity
will be a numeric state
So it should look like this instead?
oh actually my apologies, use state not numeric state
because we want to trigger on everything
then use numberic state on the condition
like this
so it will trigger and check the temp on every change but only move to actions if numeric state > 80
if that makes sense?
I think it does, so it should look like this for me?
yes i beleive so
that was if it gets to 81 and its still on cos something went wrong. when it changes again to say 81.1 it will trigger again and realise it needs to run the action (which turns it off)
I do obviously suggest that you keep an eye on it first time for testing
So now it should check every time the temp sensor updates and trigger regardless of if it is at or above 80 now? I just want to make sure i'm understanding this correctly. And yes, I will keep an eye on it, not a bad idea
it will trigger every slightly temp change and check the condition. if the condition is true then it will run the actions
so 74->76 will trigger it then it will fail the condtion check
but 79 -> 81 will trigger it then it will sucseed the condition check and run the action
Ok, that makes sense. Hopefully this will work correctly from now on then. I have a similar automation that turns on the light once it gets below a certan temp so i will change that one to work the same way as well. thank you!!
no worries, I hope it works out and you have a happy crab 🙂
Thanks, I think we would have had cooked crab if I didn't check the temp in the cage before I went to bed tonight lol.
yeah, you might want to look at a dedicated device for this kind of thing, can still interact and report to HA but can run locally too in case HA is down
remember HA is not nessasarily designed for life critical applications
maybe worth setting a notication of some sort too if its above say... 85. in case the relay fails or something
I used to have something like that but it worked way worse than home assistant did. I couldn't set the temp to a exact amount so it was basically just guessing at that point. I do have a analog temp gauge in the cage that I look at to make sure every thing is running correctly and that's how I found out it wasn't this time. I also do have a notification that gets sent to me but I had it set for 90 degrease so it just didn't send yet. I am going to lower that to something closer to 85 now though.
if your handy with electronics. you could have an esp32 running esphome with a relay and a temp sensor and have it be able to do stuff itself as well as report to HA.
nothing is ever going to be perfect but if you can handle a few circumstances then it may make the difference
I have considered something like that as well but just never really looked that deepley into it. I could try to do something like that, normally something doesn't work correctly when I set stuff like that up though
And yeah, nothing is ever going to be perfect, just hopefully better that what you have originally. That's all you can really hope for
yeah, you could also have a check that. if the light is on for x time then turn it off and send alert. if its usually only supported to be on for 45 mins and its on for 1h. ask you to investigate in case of temp sensor failure or something else
theres a million ways to add extra checks, you just gotta work out where you are comftable i guess
I used to have something like that set up but I live in a area where we have drastic temperature changes outside witch apparently greatly affects how long the light stays on because the cage is up against a outside wall so I had to disable that one. That was just causing more problems that it was fixing
Ill probably mess around with a few more checks that will just work without a fuss and look into the esp32 boards more to see how doable that would be for me but hopefully this fix that you helped me with in these automations fix most of my current issues
is "fail cold" just as bad as "fail hot"?
i know nothing about crabs
I assume they are both bad but one is probably worse
are you just asking if it is worse if they get to cold or hot or what?
yeah, we mostly covered the "cooked crab" situation. but is "frozen crab" just as bad?
mostly just curious at this point 😛
They both would not be ideal as you could probably imagine but they are apparently fairly resilient to temperature changes in general. If they get to cold, they just move slower and less to conserve any heat they have because there cold blooded. When there to hot, for the most part it doesn't matter until it gets to bad (like around 95+) where it would start to be a real issue assuming it stayed like that for a long time. I haven't got it that hot in there for them to know what they do at that point but I would assume they would just hide under something until it cools off
If it just got to hot or cold for a few hours or so, they would be fine. It would be more like a few days where it would become a issue
And I have hermit crabs so I only really know about them. Normal crabs might be different but I would assume there about the same with all of this
ah that's cool stuff. always fascinating to hear about peoples use cases and the reasons behind them.
I could imagine with basically the endless things you can create with HA. Are you like a dev/admin for it or your just good with this stuff?
I help people out in here quite a lot, I did get code in the most recent release but i am not sure if my small bugfix makes me a "dev" though
I toy around with a lot of stuff. and like the problem solving parts
I mean technically yeah, it dose. Maybe not a main dev but more then I could do with it so its got to count for something. I feel like I know a lot about this stuff until there is just a dumb issue I have like with this automation where I then have no idea what to try to change to fix it because it was working every other time. That's what I like about it to, I just like being able to solve the random small annoyances in life that you don't really think about until you have the option to fix it. Then when you fix it, it is just satisfying every time it happens knowing your the one that fixed it
Until something else about it breaks, but up until that point it is 🙂
yeah enjoy the small wins as HA is an evergrowing thing
something probably happened and the turn off command got eaten with network issue or something. then it never got resent. with new system it will constantly check and send
gotta take into account the non-ideal circumstance
Yeah, its just finding all the non-ideal circumstance before they happen is the problem. I can think of most but there is always just that one thing that you didn't account for that ends up being a issue
yup, all part of the fun
Lol, yep. I got to go now but thanks again for all your help! The crabs thank you as well!
lol, no problem, have a good night