core icon indicating copy to clipboard operation
core copied to clipboard

Numeric Value field showing non-numeric value unavailable - Shelly

Open B-Hartley opened this issue 1 year ago • 6 comments

The problem

Is this a bug that needs fixing, or is this expected behaviour if the device is currently unavailable ?

Sensor sensor.shellyplusht_xxx_temperature has device class temperature, state class measurement and unit °C thus indicating it has a numeric value; however, it has the non-numeric value: unavailable (<class 'str'>);

What version of Home Assistant Core has the issue?

2023.2.0b4

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

shelly

Link to integration documentation on our website

https://www.home-assistant.io/integrations/shelly/

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

WARNING (MainThread) [homeassistant.components.sensor] Sensor sensor.shellyplusht_xxx_temperature has device class temperature, state class measurement and unit °C thus indicating it has a numeric value; however, it has the non-numeric value: unavailable (<class 'str'>); Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+shelly%22
WARNING (MainThread) [homeassistant.components.sensor] Sensor sensor.shellyplusht_xxx_humidity has device class humidity, state class measurement and unit % thus indicating it has a numeric value; however, it has the non-numeric value: unavailable (<class 'str'>); Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+shelly%22
WARNING (MainThread) [homeassistant.components.sensor] Sensor sensor.shellyplusht_xxx_battery has device class battery, state class measurement and unit % thus indicating it has a numeric value; however, it has the non-numeric value: unavailable

Additional information

No response

B-Hartley avatar Jan 30 '23 12:01 B-Hartley

Hey there @balloob, @bieniu, @thecode, @chemelli74, @bdraco, mind taking a look at this issue as it has been labeled with an integration (shelly) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of shelly can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Change the title of the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign shelly Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


shelly documentation shelly source (message by IssueLinks)

home-assistant[bot] avatar Jan 30 '23 12:01 home-assistant[bot]

I am seeing the same in other integrations.

I thought "unavailable" and "unkown" were special cases and should not trigger this warning?

maegibbons avatar Feb 05 '23 11:02 maegibbons

I thought "unavailable" and "unkown" were special cases and should not trigger this warning?

Exactly. Since 2023.2 HA started to complain about many integrations (in my case MQTT, Modbus, Speedtest just to name a few) for this very same reason - which simply makes no sense. Why try to validate unavailable sensors as numeric, when most integrations have their sensors as unavailable at start?

realthk avatar Feb 05 '23 18:02 realthk

Which, I believe, is the proper method for Integrations to notify HA of "unavailability"!!

If there is another prefered method of notification then please let us know!

maegibbons avatar Feb 05 '23 19:02 maegibbons

Not sure why more people are not reporting this! The actual underlying reporting is great as it has highlighted a couple of my template sensors giving wrong results BUT the inclusion of "unavailable" just fills the logs unnecessarily.

maegibbons avatar Feb 05 '23 19:02 maegibbons

same issue here

WingCH avatar Feb 06 '23 14:02 WingCH

Same here...

SupremeSports avatar Feb 08 '23 23:02 SupremeSports

So is this meant to be fixed in 2023.3.0 release?

I am still seeing this error on several integrations (one of which I help to maintain). If we are not meant to use unknown or unavailable any more how should an integration notify HA that the entity state is unavailable?

I hate seeing these WARNINGS in the logs and I would like a programmatic way of either fixing this or getting the warning surpressed in core.

Krs

Mark

maegibbons avatar Mar 01 '23 22:03 maegibbons

Yes I would like to get some information about this. Are we not supposed to be using or handling unavailable any more? How to suppress or fix these errors?

kristjanbjarni avatar Mar 02 '23 10:03 kristjanbjarni

Thanks didnt realize similar issue already open. Hopefully it will be resolved in the future for shelly drvices in general.

yarafie avatar May 03 '23 09:05 yarafie

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.