Why does my code only work 50% of the time

I cant figure this one out. this snippet of code only works about 50% of the time and I cant figure out why it works and when it works and then wont work at another time… any insights?

alias: Jaces room humidifier control on function
description: ""
trigger:
  - platform: numeric_state
    entity_id:
      - sensor.jace_s_room_temp_and_humidity_humidity
    below: 43
condition: []
action:
  - type: turn_on
    device_id: d5cfcac2c42ec46f30c584d46a228e63
    entity_id: dea54b8837466dd506ad1f568eb9f908
    domain: switch
mode: single

Thanks for the insight!

It would be helpful to look at and post the traces from the automation when it does not work.

Is it not better to use this?

Your trigger will fire when the sensor drops below 43. It won’t fire again until it rises above 43, then drops again. Could that have something to do with it?

1 Like

Didnt even know that was a option. Still learning alot. I think ill switch to the generic hygrostat. seems to make a ton of sense…

as for my own automation… the turn off function works 100% of the time, and as far as I can tell, the only difference is that instead of being below 43, its above 44… really strange that only the automation that turns off the humidifier works, and the opposite only works 50% of the time… its more that its never firing I think, because if I manually run it, it functions fine…

well I thought so as well, but I kept running it up manually and letting it drop again, and for some reason it never fired when it dropped from, say, 45 to 35… and like I said earlier, the actual script to turn if off when it gets to the proper humidity is almost identical, and it works 100% of the time