Not planned
Description
The problem
In homeassistant/components/google_assistant/trait.py a check is made for the sensor device class so that the sensor can be matched to an appropriate Google Assistant sensor type.
For min_max sensors, it doesn't appear as though this attribute is exposed, and so no min_max based sensors
can be exported or synced with Google Assistant.
Presumably the device_class should be inherited from one of the child sensors.
What version of Home Assistant Core has the issue?
2022.9.1
What was the last working version of Home Assistant Core?
Not known
What type of installation are you running?
Home Assistant Container
Integration causing the issue
min_max
Link to integration documentation on our website
https://www.home-assistant.io/integrations/min_max/
Diagnostics information
config_entry-google_assistant-821d371e09089be29be4406bfeeb5e1b.json.txt
The debug dump shows the sensor in the entity_config list, but nothing in the sync list.
Example YAML snippet
sensor:
- platform: min_max
type: mean
name: Wine Cellar temperature
round_digits: 1
entity_ids:
- sensor.wine_cellar_1_temperature
- sensor.wine_cellar_2_temperature
google_assistant:
...
report_state: true
expose_by_default: false
exposed_domains:
- sensor
- switch
entity_config:
sensor.wine_cellar_temperature:
name: Wine Cellar temperature
expose: true
room: Wine Cellar
switch.0x00158d000353d160:
name: Switch
expose: true
room: Downstairs
Anything in the logs that might be useful for us?
No response
Additional information
No response
Activity
homeassistant commentedon Sep 23, 2022
min_max documentation
min_max source
(message by IssueLinks)
Hey there @fabaff, mind taking a look at this issue as it has been labeled with an integration (
min_max
) you are listed as a code owner for? Thanks!(message by CodeOwnersMention)
aamcrae commentedon Sep 23, 2022
I am happy to try and fix this, and provide a suggested patch, but I'm new to HA so might take me a while to figure it out.
aamcrae commentedon Sep 23, 2022
Also confirming that when one of the source temperature sensors is used, Google Assistant sees the sensor fine.
aamcrae commentedon Sep 23, 2022
A workaround is to add the device_class via 'customize'.
fabaff commentedon Oct 2, 2022
I'm not using
google_assistant
thus I don't know if I got the issue right. Would it be sufficient to adddevice_class
from the observed sensors tomin_max
?aamcrae commentedon Oct 2, 2022
Yes, that I think would be the right fix. The code that I pointed to in trait.py uses device_class to match against the Google Assistant types. Without device_class being set, no corresponding Google Assistant device type will be matched, so these sensors will never be exposable to Google Assistant.
Thanks!
github-actions commentedon Dec 31, 2022
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.