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

Experimental home assistant events retrigger when restarting container #25101

Closed
abrasher opened this issue Dec 6, 2024 · 3 comments
Closed
Labels
problem Something isn't working

Comments

@abrasher
Copy link

abrasher commented Dec 6, 2024

What happened?

When I restart the container, ~~some lights that were previously off prior to the restart suddenly turn on. ~~ event entities are retriggered

This was not happening on version 1.4.1

I also get an error about publishEntityState

What did you expect to happen?

Events not to get retriggered

How to reproduce it (minimal and precise)

docker compose restart zigbee2mqtt
events are triggered again, event though it is several hours since last action
image

Zigbee2MQTT version

1.42.0-dev commit: 639e3bb

Adapter firmware version

20220219

Adapter

zStack3x0 Sonoff Zigbee USB Stick

Setup

Docker, linux x64, debian 12

Debug log

The devices that trigger a new event after restart:turn on after restart are:
Hue Tap 00315 (0x000000000047a196)

log.log

@abrasher abrasher added the problem Something isn't working label Dec 6, 2024
@abrasher
Copy link
Author

abrasher commented Dec 6, 2024

It is not a problem with the lights turning on, but instead the home assistant event ( experimental_event_entities: true) get triggered again after a restart. Also, is the state of the event supposed to be a timestamp or still an action_type?

@abrasher abrasher changed the title Some devices turn on after restarting container Experimental home assistant events retrigger when restarting container Dec 6, 2024
@abrasher
Copy link
Author

abrasher commented Dec 7, 2024

I guess this is intended behaviour as the official docs have it ignore if the previous state is unavailable

conditions:
          - condition: template
            value_template: "{{trigger.from_state.state != 'unavailable'}}"
          - condition: template
            value_template: "{{trigger.to_state.attributes.event_type == 'single'}}"

@abrasher abrasher closed this as completed Dec 7, 2024
@mundschenk-at
Copy link
Contributor

The actual state is always a timestamp (generated by HA). I agree that having to check for unavailable is somewhat unfortunate, but that's how the HA state engine seems to work (unless we introduce a new idle event_type).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
problem Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants