Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automations stopped working #114402

Closed
Bluhme1 opened this issue Mar 28, 2024 · 9 comments · Fixed by #114825
Closed

Automations stopped working #114402

Bluhme1 opened this issue Mar 28, 2024 · 9 comments · Fixed by #114825

Comments

@Bluhme1
Copy link

Bluhme1 commented Mar 28, 2024

The problem

Automation with alias 'Kontorlampe tænd/sluk' failed to setup actions and has been disabled: Integration 'binary_sensor' does not support device automation actions

What version of Home Assistant Core has the issue?

2024.4.0b0

What was the last working version of Home Assistant Core?

2024.3

What type of installation are you running?

Home Assistant OS

Integration causing the issue

No response

Link to integration documentation on our website

No response

Diagnostics information

Automation with alias 'Kontorlampe tænd/sluk' failed to setup actions and has been disabled: Integration 'binary_sensor' does not support device automation actions

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

@joostlek joostlek added this to the 2024.4.0 milestone Mar 28, 2024
@joostlek
Copy link
Member

Please add more context. The automation yaml and any logs. What entities are you using for the trigger and what integration are you using for that?

@Bluhme1
Copy link
Author

Bluhme1 commented Mar 28, 2024

The trigger-device is Hue Motion through Zigbee2MQTT

Here is my yaml:

alias: Kontorlampe tænd/sluk
description: ""
trigger:
  - type: motion
    platform: device
    device_id: 50818e03847dc2a6963edd367e05764c
    entity_id: binary_sensor.motion_sensor_kontor_occupancy
    domain: binary_sensor
condition:
  - type: is_illuminance
    condition: device
    device_id: 1ba2259b8418d29d3a33f7e16ca0f42d
    entity_id: sensor.lyssensor_kontor_illuminance_lux
    domain: sensor
    below: 50
action:
  - type: turn_on
    device_id: 6eba6aa388bad821211eb4f97f0622e1
    entity_id: light.bordlampe_kontor
    domain: light
  - delay:
      hours: 0
      minutes: 5
      seconds: 0
      milliseconds: 0
  - type: is_no_motion
    condition: device
    device_id: 50818e03847dc2a6963edd367e05764c
    entity_id: binary_sensor.motion_sensor_kontor_occupancy
    domain: binary_sensor
  - type: turn_off
    device_id: 6eba6aa388bad821211eb4f97f0622e1
    entity_id: light.bordlampe_kontor
    domain: light
mode: restart

And the log says:

Logger: homeassistant.components.automation
Kilde: components/automation/config.py:108
integration: Automatisering (dokumentation, problemer)
Første forekomst: 20.37.18 (4 forekomster)
Senest logget: 20.37.18

Automation with alias 'Kontorlampe tænd/sluk' failed to setup actions and has been disabled: Integration 'binary_sensor' does not support device automation actions
Automation with alias 'Anneks tænd/sluk' failed to setup actions and has been disabled: Integration 'binary_sensor' does not support device automation actions
Automation with alias 'Gang&Trappe tænd/sluk' failed to setup actions and has been disabled: Integration 'binary_sensor' does not support device automation actions
Automation with alias 'Garagelys tænd' failed to setup actions and has been disabled: Integration 'binary_sensor' does not support device automation actions

@joostlek
Copy link
Member

Anything in the logs?

@Bluhme1
Copy link
Author

Bluhme1 commented Mar 28, 2024

Only this:

2024-03-28 20:37:11.683 ERROR (MainThread) [homeassistant.helpers.translation] Validation of translation placeholders for localized (da) string component.nut.config.error.cannot_connect failed
2024-03-28 20:37:18.397 ERROR (MainThread) [homeassistant.components.automation] Automation with alias 'Kontorlampe tænd/sluk' failed to setup actions and has been disabled: Integration 'binary_sensor' does not support device automation actions
2024-03-28 20:37:18.424 ERROR (MainThread) [homeassistant.components.automation] Automation with alias 'Anneks tænd/sluk' failed to setup actions and has been disabled: Integration 'binary_sensor' does not support device automation actions
2024-03-28 20:37:18.425 ERROR (MainThread) [homeassistant.components.automation] Automation with alias 'Gang&Trappe tænd/sluk' failed to setup actions and has been disabled: Integration 'binary_sensor' does not support device automation actions
2024-03-28 20:37:18.425 ERROR (MainThread) [homeassistant.components.automation] Automation with alias 'Garagelys tænd' failed to setup actions and has been disabled: Integration 'binary_sensor' does not support device automation actions
2024-03-28 20:48:20.825 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140276465045312] Error handling message: Integration 'binary_sensor' does not support device automation actions (home_assistant_error) Lars Bluhme from 192.168.86.24 (Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.2.1 Safari/605.1.15)

@bdraco
Copy link
Member

bdraco commented Mar 29, 2024

raise InvalidDeviceAutomationConfig(

Its hitting this exception

@bdraco
Copy link
Member

bdraco commented Mar 29, 2024

There is no binary_sensor device_action

alarm_control_panel/device_action.py	cover/device_action.py			light/device_action.py			number/device_action.py			rfxtrx/device_action.py			text/device_action.py			zha/device_action.py
button/device_action.py			fan/device_action.py			lock/device_action.py			nut/device_action.py			select/device_action.py			vacuum/device_action.py			zwave_js/device_action.py
climate/device_action.py		humidifier/device_action.py		mobile_app/device_action.py		remote/device_action.py			switch/device_action.py			water_heater/device_action.py

@bdraco
Copy link
Member

bdraco commented Mar 29, 2024

  - type: is_no_motion
    condition: device
    device_id: 50818e03847dc2a6963edd367e05764c
    entity_id: binary_sensor.motion_sensor_kontor_occupancy
    domain: binary_sensor

Maybe I'm missing something, but that looks a bit suspect in the action

@Bluhme1
Copy link
Author

Bluhme1 commented Mar 29, 2024

@bdraco Your hint helped a lot.
It seems that you cannot use "conditions" together with binary_sensors in the Action-part of an automation. Instead it is possible to use "If / Else" to get the same result. Must have changed in this beta. My automations are rather old and have been working for years but suddenly not. I give an example which is NOT working:

alias: Kontorlampe tænd/sluk
description: ""
trigger:
  - type: motion
    platform: device
    device_id: 50818e03847dc2a6963edd367e05764c
    entity_id: binary_sensor.motion_sensor_kontor_occupancy
    domain: binary_sensor
condition:
  - type: is_illuminance
    condition: device
    device_id: 1ba2259b8418d29d3a33f7e16ca0f42d
    entity_id: sensor.lyssensor_kontor_illuminance_lux
    domain: sensor
    below: 50
action:
  - type: turn_on
    device_id: 6eba6aa388bad821211eb4f97f0622e1
    entity_id: light.bordlampe_kontor
    domain: light
  - delay:
      hours: 0
      minutes: 5
      seconds: 0
      milliseconds: 0
  - type: is_no_motion
    condition: device
    device_id: 50818e03847dc2a6963edd367e05764c
    entity_id: binary_sensor.motion_sensor_kontor_occupancy
    domain: binary_sensor
  - type: turn_off
    device_id: 6eba6aa388bad821211eb4f97f0622e1
    entity_id: light.bordlampe_kontor
    domain: light
mode: restart

And the the same automation which is working:

alias: Kontorlampe tænd/sluk
description: ""
trigger:
  - type: motion
    platform: device
    device_id: 50818e03847dc2a6963edd367e05764c
    entity_id: binary_sensor.motion_sensor_kontor_occupancy
    domain: binary_sensor
condition:
  - type: is_illuminance
    condition: device
    device_id: 1ba2259b8418d29d3a33f7e16ca0f42d
    entity_id: sensor.lyssensor_kontor_illuminance_lux
    domain: sensor
    below: 50
action:
  - type: turn_on
    device_id: 6eba6aa388bad821211eb4f97f0622e1
    entity_id: light.bordlampe_kontor
    domain: light
  - delay:
      hours: 0
      minutes: 5
      seconds: 0
      milliseconds: 0
  - if:
      - type: is_no_motion
        condition: device
        device_id: 50818e03847dc2a6963edd367e05764c
        entity_id: 9a44e50854a3a3e2c4d24ae5607dfbb0
        domain: binary_sensor
    then:
      - type: turn_off
        device_id: 6eba6aa388bad821211eb4f97f0622e1
        entity_id: 5750c0f8b598d8f383440f7b7ecd0d02
        domain: light
mode: restart

So it is not a bug but just a new way of doing things. I will close the issue

@bdraco
Copy link
Member

bdraco commented Apr 4, 2024

It turns out this was a bug which I just fixed in #114825

When condition and device_id were in the same action we needed to always prefer condition

@github-actions github-actions bot locked and limited conversation to collaborators May 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants