#Simple Temperature Sensor Automation didn't Trigger When it Should Have

1 messages · Page 1 of 1 (latest)

stray pier
#

I have a automation that turns off a light when a temperature sensor gets at/above 80 degrees but this last time, the automation didn't trigger and for no apparent reason. Is there a way to see why this is because this is used for some of my pets and is verry concerning how it didn't trigger when it should have.

#

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.

west roost
stray pier
#

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.

west roost
#

add trigger, and select entity and not device

#

then select the temp sensor entity

#

will be a numeric state

stray pier
#

So it should look like this instead?

west roost
#

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?

stray pier
#

I think it does, so it should look like this for me?

west roost
#

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

stray pier
#

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

west roost
#

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

stray pier
#

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!!

west roost
#

no worries, I hope it works out and you have a happy crab 🙂

stray pier
#

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.

west roost
#

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

stray pier
#

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.

west roost
#

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

stray pier
#

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

west roost
#

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

stray pier
#

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

west roost
#

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

stray pier
#

are you just asking if it is worse if they get to cold or hot or what?

west roost
#

yeah, we mostly covered the "cooked crab" situation. but is "frozen crab" just as bad?

#

mostly just curious at this point 😛

stray pier
#

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

west roost
#

ah that's cool stuff. always fascinating to hear about peoples use cases and the reasons behind them.

stray pier
#

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?

west roost
#

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

stray pier
#

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 🙂

west roost
#

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

stray pier
#

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

west roost
#

yup, all part of the fun

stray pier
#

Lol, yep. I got to go now but thanks again for all your help! The crabs thank you as well!

west roost
#

lol, no problem, have a good night