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

Binary Sensor - No logbook entries when used as an automation trigger #110495

Closed
NzKyle opened this issue Feb 13, 2024 · 2 comments
Closed

Binary Sensor - No logbook entries when used as an automation trigger #110495

NzKyle opened this issue Feb 13, 2024 · 2 comments

Comments

@NzKyle
Copy link

NzKyle commented Feb 13, 2024

The problem

I recently added in a new automation based on the state of a binary motion sensor (setup via ESPHome) - when the automation is enabled the state changes of the binary sensor do not seem to be written to the logbook at all. As soon as I disable the automation the state changes are written to the log book without issue. I only added this automation in after the upgrade to 2024.2.1 so I'm uncertain if this does or doesn't work in previous versions.

More Info screen for the sensor with the automation enabled:
Sensor-more-info-automation-enabled

More Info screen for the sensor with the automation disabled:
Sensor-more-info-automation-disabled

What version of Home Assistant Core has the issue?

core-2024.2.1

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

recorder

Link to integration documentation on our website

No response

Diagnostics information

config_entry-esphome-7bfff552c359cc3bf3d43c090039aa83 (1).json

Example YAML snippet

#The Automation that I was using: 
alias: Bedroom Motion - Fan Timer On
description: ""
trigger:
  - platform: state
    entity_id:
      - binary_sensor.motion_combined
    to: "on"
condition: []
action:
  - service: timer.start
    metadata: {}
    data: {}
    target:
      entity_id: timer.fan_off
mode: single

#My recorder setting from the configuration: 
recorder:
  db_url: mysql://[user]:[pass]@core-mariadb/homeassistant?charset=utf8mb4

Anything in the logs that might be useful for us?

I've had a poke around in the logs and there is nothing in there related to either the sensor or the recorder.

Additional information

No response

@NzKyle
Copy link
Author

NzKyle commented Feb 14, 2024

Did some additional investigation today (turned recorder debug logging on) - and it would appear that the recorder is receiving the state changes (when the automation is enabled):

2024-02-15 09:29:33.064 DEBUG (Recorder) [homeassistant.components.recorder.core] Processing task: <Event state_changed[L]: entity_id=binary_sensor.motion_combined, old_state=<state binary_sensor.motion_combined=off; device_class=motion, friendly_name=Motion Combined @ 2024-02-15T09:28:08.347349+13:00>, new_state=<state binary_sensor.motion_combined=on; device_class=motion, friendly_name=Motion Combined @ 2024-02-15T09:29:33.062634+13:00>>

2024-02-15 09:31:42.192 DEBUG (Recorder) [homeassistant.components.recorder.core] Processing task: <Event state_changed[L]: entity_id=binary_sensor.motion_combined, old_state=<state binary_sensor.motion_combined=on; device_class=motion, friendly_name=Motion Combined @ 2024-02-15T09:29:33.062634+13:00>, new_state=<state binary_sensor.motion_combined=off; device_class=motion, friendly_name=Motion Combined @ 2024-02-15T09:31:42.191127+13:00>>

But no data appears to be written to the database.

@NzKyle
Copy link
Author

NzKyle commented Mar 15, 2024

As of the 2024.3.1 update this appears to be working. I'll close this issue now.

@NzKyle NzKyle closed this as completed Mar 15, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Apr 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant