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

Timer / Alarm entities set to Unavailable if no timers/alarms, should be none #278

Open
kaosmagix opened this issue Jun 25, 2021 · 10 comments · May be fixed by #839
Open

Timer / Alarm entities set to Unavailable if no timers/alarms, should be none #278

kaosmagix opened this issue Jun 25, 2021 · 10 comments · May be fixed by #839
Assignees
Labels
feature New feature or request

Comments

@kaosmagix
Copy link

kaosmagix commented Jun 25, 2021

When no timer is set the status of the *_timers entity is currently set to "unavailable". The same is true for the *_alarms entity when no alarms.

Unavailable is considered an error state in HA, so the entities get flagged (and in my case show up in my issues listing)

Please change the status to "none" instead, and onl to unavailable it the device can not be reached

@ArnyminerZ ArnyminerZ added the feature New feature or request label Jun 26, 2021
@ArnyminerZ
Copy link
Collaborator

This makes completely sense. Should be an easy fix. Right now I'm quite busy on other things. But I may have some time to take a look at this.

@ArnyminerZ
Copy link
Collaborator

Found out that the "issue" comes from sensor.py L184. We should pick a different value from home-assistant:core/const.py.
I can't find an accurate option, so I'd create a new one called "none".

@KapJI
Copy link
Collaborator

KapJI commented Jun 27, 2021

Having state for something else than unavailable, unknown or actual timestamp will cause state will be rendered incorrectly in the UI because of timestamp device class we're using.

To set none we need HA to support it.

@kaosmagix
Copy link
Author

OK, I understand (it is annoying as HA itself flags the entries suspect, but I understand it first needs to be supported by HA for timestamp types) I might raise an issue in HA for it (not sure where to raise/report it)

@ArnyminerZ
Copy link
Collaborator

Having state for something else than unavailable, unknown or actual timestamp will cause state will be rendered incorrectly in the UI because of timestamp device class we're using.

Shouldn't the translation provided in sensor.en.json fix the bad rendering issue? Since we are setting the timestamp class. Haven't tested my changes yet, since I don't have a working development setup at the moment.

@KapJI
Copy link
Collaborator

KapJI commented Jun 28, 2021

Shouldn't the translation provided in sensor.en.json fix the bad rendering issue?

I don't think so but feel free to test it.

@spudje
Copy link

spudje commented Aug 4, 2021

Unfortunately I have no luck with this component. It has worked correctly once. After a Hass restart, some entities become unavailable. And now after updating to Hass 2021.08 all entities are unavailable. No way I'm going to do the "restart devices, restart Hass, reinstall component" every time I reset Hass...

@leikoilja
Copy link
Owner

@KapJI, @ArnyminerZ, i think we should replace unavailable state with unknown for now.
unavailable state brings so much confusion around . People mostly see it as "integration doesn't work, cause it can't fetch data", while in reality, we meant it as "no alarms are currently set"

@jazzyisj
Copy link

Alarms that are not set should report a state of "Not Set".
Timers that are not set should report a state of "Idle".

Just my 2 cents.

@KapJI
Copy link
Collaborator

KapJI commented Sep 21, 2021

This requires some changes on HA side. More details here: home-assistant/architecture#635

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
6 participants