Automation is not triggering

Pretty basic stuff…

alias: Clarity Arrives
description: ''
trigger:
  - platform: state
    entity_id: device_tracker.ble_tracker_dc0d3003512d
    id: Clarity Beacon
    to: home
  - platform: state
    entity_id: binary_sensor.clarity_wi_fi_ping
    id: Clarity Ping
    to: 'on'
condition:
  - condition: state
    entity_id: cover.garage_door
    state: closed
  - condition: state
    entity_id: binary_sensor.clarity_in_garage
    state: 'off'
  - condition: state
    entity_id: binary_sensor.clarity_bluetooth
    for:
      hours: 0
      minutes: 0
      seconds: 0
    state: 'on'
action:
  - service: cover.open_cover
    target:
      entity_id: cover.garage_door
    data: {}
  - service: notify.pushover
    data:
      title: Clarity is home
      message: |
        Triggered by {{ trigger.id }}
        from {{ trigger.from_state.state }}
        to {{ trigger.to_state.state }}
      data:
        priority: 0

but entity_id: binary_sensor.clarity_wi_fi_ping is not triggering the automation and I for the life of me can’t figure out why.




binary_sensor.yaml:

  - platform: ping
    name: Clarity Wi-Fi Ping
    host: 192.168.1.72
    count: 2
    scan_interval: 10

I think this is because the entity is named “wi-fi” with a dash and your trigger is “wi_fi” with an underscore.

I don’t think so. The -in the descriptive name translates to _ in the entity_id.
I just created this test automation and set the state to off via Dev Tools and the ping platform changed it back to on within 2 seconds (the car is currently ON in the garage so ping is successful) and this new automation fired:

alias: Clarity Ping
description: ''
trigger:
  - platform: state
    entity_id: binary_sensor.clarity_wi_fi_ping
    to: 'on'
condition: []
action:
  - service: notify.windows_11_hass_agent
    data:
      title: Clarity
      message: Ping  triggered
mode: single

Now you mention it that sounds correct … uppercase characters get converted to lowercase and dashes get converted to underscores.

I’m not sure what else to suggest other than maybe the conditions are preventing the actions from being executed.

I think I found it. The Visual editor shows For (optional) for all 3 conditions but when unset, the yaml is blank. In this automation, one of the conditions had a left-over from when I did have a For (optional) setting but changed it to 0:00:00 and the yaml then reflected those new 0:00:00 settings:

    for:
      hours: 0
      minutes: 0
      seconds: 0

Once I deleted that block the automation started working.


Beware!

Great, glad you got it sorted.