home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
69.94k stars 29.03k forks source link

missing device class for entity "analog_temperature" for shelly plus 2pm #95921

Closed Bascht74 closed 10 months ago

Bascht74 commented 1 year ago

The problem

Hi,

I use both shelly 2.5pm and shelly plus 2pm. With plus 2pm for the entity "analog_temperature" there is no device class, unit of measurement set. See screenshots below

What version of Home Assistant Core has the issue?

core-2023.7.0

What was the last working version of Home Assistant Core?

not sure

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Tasmota

Link to integration documentation on our website

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

Diagnostics information

I am not able to download tasmota diagnostics, it downloads a "unifi" diagnostic file.

Example YAML snippet

./.

Anything in the logs that might be useful for us?

no

Additional information

entity plus 2pm:

image

entity 2.5pm image

home-assistant[bot] commented 1 year ago

Hey there @emontnemery, mind taking a look at this issue as it has been labeled with an integration (tasmota) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `tasmota` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign tasmota` Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


tasmota documentation tasmota source (message by IssueLinks)

Najihel commented 11 months ago

Hello, Same issue on Sonoff Nspanel flashed on Tasmota

emontnemery commented 10 months ago

The Tasmota integration trues to guess the type of sensor based on the sensors's name, it will map a Tasmota sensor named "Temperature" to Home Assistant device class temperature, but it does not know about "analog temperature".

Could you share the Tasmota's MQTT discovery message for the shelly plus 2pm please?

From command line:

mosquitto_sub -h <mqtt_broker> -v -t "tasmota/#"
Najihel commented 10 months ago

Hello @emontnemery

For the NsPanel :

mosquitto_sub -h <host> -u <user> -P <password> -v -t "tasmota/#"
tasmota/discovery/<snipped>/config {"ip":"<snipped>","dn":"<snipped>","fn":["<snipped>","",null,null,null,null,null,null],"hn":"<snipped>","mac":"<snipped>","md":"NSPanel","ty":0,"if":0,"ofln":"Offline","onln":"Online","state":["OFF","ON","TOGGLE","HOLD"],"sw":"13.1.0","t":"<snipped>","ft":"%prefix%/%topic%/","tp":["cmnd","stat","tele"],"rl":[1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"swc":[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],"swn":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"btn":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"so":{"4":0,"11":0,"13":0,"17":0,"20":0,"30":0,"68":0,"73":0,"82":0,"114":0,"117":0},"lk":0,"lt_st":0,"bat":0,"dslp":0,"sho":[],"sht":[],"ver":1}
tasmota/discovery/<snipped>/sensors {"sn":{"Time":"2023-09-07T22:44:41","ANALOG":{"Temperature1":26.5},"TempUnit":"C"},"ver":1}

Thanks

emontnemery commented 10 months ago

Thanks! How is the device configured? Could you maybe show the output of the module + template commands?

Najihel commented 10 months ago

Module

{"Module":{"0":"NSPanel"}}

Template

{"NAME":"NSPanel","GPIO":[0,0,0,0,3872,0,0,0,0,0,32,0,0,0,0,225,0,480,224,1,0,0,0,33,0,0,0,0,0,0,0,0,0,0,4736,0],"FLAG":0,"BASE":1}
emontnemery commented 10 months ago

Fixed by https://github.com/emontnemery/hatasmota/pull/252 which is included in https://github.com/home-assistant/core/pull/100169 The fix will be included in Home Assistant Core 2023.9.2