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

WIP Attempt to track HS2WD-E siren status. help needed #8834

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ghoz
Copy link
Contributor

@ghoz ghoz commented Feb 18, 2025

The HS2WD-E siren does not report back its state.
As the siren command has a duration (and a max duration config) , it will stop at some point, but the triggering system as no way to know that.
Attempts to track current state by looking at the mode, duration (and strobe) when the command is sent.

This is not ready to merge.

2 open questions :

  • How to publish a state from a toZigbee convertSet context with a delay ? there is no easy publish available as in fromZigbee convert
  • Where to properly implement all this without duplicating tz.warning ? would adding a flag to meta be the right place to turn on this virtual state ?

The HS2WD-E does not report on its state.
Attempts to track current state by tracking  duration and siren mode/duraition
clearTimeout(globalStore.getValue(entity, 'state_timer'));
globalStore.clearValue(entity, 'state_timer');
if (siren_on) {
const duration = Math.min(values.duration, 240);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

240 is a placeholder for the actual max duration for now

@ghoz ghoz marked this pull request as draft February 18, 2025 22:54
@ghoz ghoz changed the title WIP Attempt to track HS2WD-E siren status WIP Attempt to track HS2WD-E siren status. help needed Feb 19, 2025
@Koenkk
Copy link
Owner

Koenkk commented Feb 20, 2025

Where to properly implement all this without duplicating tz.warning ? would adding a flag to meta be the right place to turn on this virtual state ?

That's fine

How to publish a state from a toZigbee convertSet context with a delay ? there is no easy publish available as in fromZigbee convert

What is the use case for this? Do you want to publish siren OFF after a certain time?

@ghoz
Copy link
Contributor Author

ghoz commented Feb 20, 2025

What is the use case for this? Do you want to publish siren OFF after a certain time?

Yes, exactly . Not sure how other warning devices return their state, through ias Zone Status maybe, but this one doesn't return anything, which make it's use as an HA siren a bit tricky

I wanted to copy the idea of the occupancy sensors that don't reset their state, but as those timers are created from within fromZigbee convertSet they have access to publish, which is not available here...

@Koenkk
Copy link
Owner

Koenkk commented Feb 21, 2025

We have to add a publish to https://github.com/Koenkk/zigbee2mqtt/blob/1accb8b66b95b99658c50e4c0209edcb946a5fe2/lib/extension/publish.ts#L230 in that case. Would you mind making a PR for that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants