Trying to learn automations

I have a Sensor push device that measures temp and humidity. I have a Shelly switch to switch AC power to a receptical. The goal is when the humidity drops below 60%, turn on power to the receptical that a humidifier is plugged into. Pretty simple. A second automation would turn if off when the humidity exceeds 65%. When I run the automation as a test, I think that I hear the Shelly switch engage. However, when I test the output, the voltage is zero. In the Shelly device, under controls for the Shelly device switch 0 is enabled and seems to be ‘on’. Under sensors for the Shelly device Input 0 input is off and an icon seems to indicate no power, though the icon is ‘mdi:power_plug_off’. Here is my automation yaml:

alias: Greenhouse Humidifier on
description: Turn on the greenhouse humidifier
triggers:
  - trigger: numeric_state
    entity_id:
      - sensor.ht1_d4a3_humidity
    below: 60
conditions: []
actions:
  - type: turn_on
    device_id: 387742858ea4a5bd9e6c382ddff2b948
    entity_id: 610303ee411fea8515bae12aff8f6674
    domain: switch
mode: single

What have I done wrong? TIA

When you run an automation manually (sounds as if that’s what you did), only the action part is tested, not the trigger. If you can’t wait for the real conditions you need, the easiest way of testing a trigger is to change the value of the sensor in Developer Tools.

Also, bear in mind when testing that a trigger is not a state, but a specific change of state.

So your trigger should fire when humidity goes from 60% to 59%, but it will not fire again until humidity rises to above 60%, then goes down a second time. Similarly the second automation would fire when humidity went from 65% to 66%, but it would not fire again unless humidity had dropped to below 65% first.

Thank you @jackjourneyman. You are correct that I ran the automation manually to test the action. I wasn’t certain quite how the trigger worked but suspected as you said. Still, the action isn’t accomplishing what I need. It isn’t turning on power to the receptical. I suspect that it is because the Shelly sensor input 0 input is off, but I can’t find any way to change it, either under the Shelly device or in my automation.

Hello Chuck_Crisler,