You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Integral helper falsely only allows selecting sensors with "unit_of_measurement": null after previous sensor (with non-null unit_of_measurement) got deleted
#131389
Open
laundmo opened this issue
Nov 23, 2024
· 1 comment
After a sensor which was previously used in a Integral helper was removed, i tried to modify this integral to add the replacement for the now-removed sensor. This led to an error since i think i'm only allowed to enter sensors which have the same "unit_of_measurement" as the previous sensor, which is null due to the previous sensor being deleted. Entering the sensor anyways, even though it doesn't appear in the dropdown, causes this error (from which i've removed some sensors):
value must be one of ['sensor.sun_next_dawn', 'sensor.sun_next_dusk', 'sensor.sun_next_midnight', 'sensor.sun_next_noon', 'sensor.sun_next_rising', 'sensor.sun_next_setting']
all the sensors in this error happen to have a unit_of_measurement of null in /config/.storage/core.entity_registry
I'm pretty sure this snippet is the source of this issue, as it seems to do exactly that filtering for the same unit of measurement:
I think a solution could be to not filter at all after a sensor is delted, or alternatively to store the required unit of measurement on the Integral helper.
What version of Home Assistant Core has the issue?
2024.11.3
What was the last working version of Home Assistant Core?
Hey there @dgomes, mind taking a look at this issue as it has been labeled with an integration (integration) you are listed as a code owner for? Thanks!
Code owner commands
Code owners of integration 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 integration Removes the current integration label and assignees on the issue, add the integration domain after the command.
@home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue.
@home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.
laundmo
changed the title
Integral helper only allows selecting sensors with "unit_of_measurement": null when previous sensor is deleted
Integral helper falsely only allows selecting sensors with "unit_of_measurement": null after previous sensor (with non-null unit_of_measurement) got deleted
Nov 23, 2024
The problem
After a sensor which was previously used in a Integral helper was removed, i tried to modify this integral to add the replacement for the now-removed sensor. This led to an error since i think i'm only allowed to enter sensors which have the same "unit_of_measurement" as the previous sensor, which is null due to the previous sensor being deleted. Entering the sensor anyways, even though it doesn't appear in the dropdown, causes this error (from which i've removed some sensors):
all the sensors in this error happen to have a unit_of_measurement of
null
in/config/.storage/core.entity_registry
I'm pretty sure this snippet is the source of this issue, as it seems to do exactly that filtering for the same unit of measurement:
core/homeassistant/components/integration/config_flow.py
Lines 61 to 79 in 50013cf
I think a solution could be to not filter at all after a sensor is delted, or alternatively to store the required unit of measurement on the Integral helper.
What version of Home Assistant Core has the issue?
2024.11.3
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
Integral
Link to integration documentation on our website
https://www.home-assistant.io/integrations/integration
Diagnostics information
No response
Example YAML snippet
No response
Anything in the logs that might be useful for us?
No response
Additional information
/config/.storage/core.config_entries
of the integral helper/config/.storage/core.entity_registry
of "sensor.REDACTED"The text was updated successfully, but these errors were encountered: