NEWBIE Help with automation

Hi all,
i’m a new home assitant user and i’m glad to meet this great community.
i made an automation , realy 2 automaitons and no one of them is triggering and working.
The easy one is this below:

- id: '1674645955392'
  alias: Deumidificatore
  description: ''
  trigger:
  - type: humidity
    platform: device
    device_id: f71ebd15a45d7c8109a6d5d367434875
    entity_id: sensor.zhi_neng_yao_kong_humidity
    domain: sensor
    above: 69
  condition:
  - condition: state
    entity_id: group.famiglia
    attribute: entity_id
    state: not_home
    for:
      hours: 0
      minutes: 5
      seconds: 0
  action:
  - service: climate.set_hvac_mode
    data:
      hvac_mode: dry
    target:
      entity_id: climate.haier_camera
  - service: climate.set_temperature
    data:
      temperature: 19
    target:
      entity_id: climate.haier_camera
  - service: climate.set_fan_mode
    data:
      fan_mode: auto
    target:
      entity_id: climate.haier_camera
  - wait_for_trigger:
    - type: humidity
      platform: device
      device_id: f71ebd15a45d7c8109a6d5d367434875
      entity_id: sensor.zhi_neng_yao_kong_humidity
      domain: sensor
      below: 66
    continue_on_timeout: false
  - service: climate.set_hvac_mode
    data:
      hvac_mode: 'off'
    target:
      entity_id: climate.haier_camera
  mode: single
- id: '1675251944443'
  alias: Frigate Notification (0.10.0)
  description: ''
  use_blueprint:
    path: hunterjm/frigate_0.10_notification.yaml
    input:
      camera: camera_1
      notify_device: f1b76246aea333d58ea3392138e471e1
      labels:
      - person

i made it with the home assitant gui.
If i run from the automation panel it run but doesn’t trigger automatically.
thanks in advance for the help

Welcome to the forum.

Firstly the above is very difficult to read as it is not formatted correctly. When pasting code like this try to wrap the code with these ``` either side, or at the begining and end of the code if you please!

You say you can run the automation manual and it works - the important part to remember here is when running manually the automation will skip or ignore all triggers AND conditions. So you know instantly you have either a trigger issue and/or a condition issue.

It is worth looking at the automations trace to see if it actually did trigger but the condition was not true and also to see if any error text is present also.

However I suspect (can read the yaml correctly due to the above mentioned formatting) that the automation may be OK, you have to remember that using a numerical trigger (above or below) will only ever trigger when (in your case) the humidity sensor goes from any value below 69 to any value above 69. It has to cross the threshold so to speak.

So going from 68 to 70 would cross it, but going for 70-72 would not. So if the value is already above 69 no trigger will occur.

So its worth checking what the current sensor value is before hand. You can also use the developer tools / states / set states to override the actual humidity for testing.

1 Like

Try to debug your automation by accessing traces inside your automation (Top right, when editing your automation or click the dots in the information overview).

Then check if your automation trigger did not fire or a condition was not met.

More info on traces can be found here: Troubleshooting Automations - Home Assistant

Hope this helps.

that wouldn’t work if it doesn’t trigger :thinking:

To me it looks like the normal problem. The trigger will only happen when humidity goes from below to above 69%

You need to trigger on humidity changing and condition to above 69%

Not sure if its the best way to do it but it will work like that.

The automation would also show as not triggered if the condition is not met, even when the actual trigger is. Not very intuitive, but thats how it is.

If there are not traces its the trigger, if there are traces its the condition.

Looking at traces will allow you to check if it was the trigger OR the condition and then fix the actual problem. Always better to check than to assume when debugging and its just one click away.

code formatted, now ill try to debug and we will see if it’s fixed.
Thanks for now

Try removing the attribute as this may prevent the condition passing.

YOU ARE THE MAN!
Thank you!
Is there a workaround to let the automation trigger even if is not changing from below to above a % ?

Yes, always - but depends on what you are trying to achieve, would need some more insight in to what or why so to speak to suggest anything relevant.

sorry for the late answear,
what i want is to have the room humidity below 70 % during the day if i’m not at home

So three triggers (fires when ANY of these happens):

  • Humidity goes above 70%
  • Time becomes “during the day” (however you define that)
  • You leave the home
  • (and perhaps an extra one for Home Assistant restart)

And three conditions (requires ALL of these to be true to proceed):

  • Humidity is above 70%
  • Time is “during the day”
  • You are not at home

That way, the automation will trigger when any one of those things happens, but only continue to the action if all three are true. In other words, it’ll run when the third of the three things becomes true.

Example scenario:

  • It becomes daytime. Automation triggers, but humidity is only 60% and you’re home. Condition fails, action not run.
  • Next, you leave home. Automation triggers, it is daytime, but humidity is only 64%. Condition fails, action not run.
  • Finally, humidity rises above 70%. Automation triggers, it is daytime, you’re out and humidity is high. Condition passes, HVAC runs.

You then might need a separate automation to catch when any of those things stops being true.

Trigger on a humidity change

condition on humidity below whatever, time and weather you are home.

action whatever you want.