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
I have filled out the issue template to the best of my ability.
This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
This issue is not a duplicate issue of currently previous issues..
Describe the issue
When adding a new sensor (existing sensor by a device) and you have added this sensor already in another powercalc-sensor, there is an entry created, but it fails to add additional sensors eg. for the use in an energymeter. so you get an configuration entry without additional sensors:
There is no hint for the error and the user is left in the dark what to do. it is stated in the logs:
2024-11-17 11:36:20.902 ERROR (MainThread) [custom_components.powercalc.sensor] sensor.energy_log_current_power_consumption_32306: **This entity has already configured a power sensor. When you want to configure it twice make sure to give it a unique_id**
solutions could be:
ask the user for an unique id
inform the user of a sensor already in use and
-- ask the user if the system should create one or the process should be aborted
-- generate a UUID automatically in the background
no info for the user, just generate a UUID in the background
i would definitly prefer an automatic generation one or the other way so the user does not have to deal with coding ...
Reproduction steps
set up a sensor with a power-sensor of an existing entity
try to set up another sensor with the same power-sensor of an existing entity
Debug logs
2024-11-17 11:36:20.902 ERROR (MainThread) [custom_components.powercalc.sensor] sensor.energy_log_current_power_consumption_32306: This entity has already configured a power sensor. When you want to configure it twice make sure to give it a unique_id
2024-11-17 11:36:49.564 ERROR (MainThread) [custom_components.powercalc.sensor] sensor.energy_log_current_power_consumption_32306_2: This entity has already configured a power sensor. When you want to configure it twice make sure to give it a unique_id
Thanks for raising this issue.
I gave it a thought but I didn't see any reason why I wouldn't just generate a UUID for every config flow the user does.
Also removed unique id field from the dialog as well.
Implemented with #2708.
Will release new beta later today. Would be nice if you can give it a test run.
System Health details
System Information
Home Assistant Community Store
Home Assistant Cloud
Home Assistant Supervisor
Dashboards
Recorder
Checklist
Describe the issue
When adding a new sensor (existing sensor by a device) and you have added this sensor already in another powercalc-sensor, there is an entry created, but it fails to add additional sensors eg. for the use in an energymeter. so you get an configuration entry without additional sensors:
There is no hint for the error and the user is left in the dark what to do. it is stated in the logs:
2024-11-17 11:36:20.902 ERROR (MainThread) [custom_components.powercalc.sensor] sensor.energy_log_current_power_consumption_32306: **This entity has already configured a power sensor. When you want to configure it twice make sure to give it a unique_id**
solutions could be:
-- ask the user if the system should create one or the process should be aborted
-- generate a UUID automatically in the background
i would definitly prefer an automatic generation one or the other way so the user does not have to deal with coding ...
Reproduction steps
Debug logs
Diagnostics dump or YAML config
{
"home_assistant": {
"installation_type": "Home Assistant OS",
"version": "2024.11.2",
"dev": false,
"hassio": true,
"virtualenv": false,
"python_version": "3.12.4",
"docker": true,
"arch": "aarch64",
"timezone": "Europe/Vienna",
"os_name": "Linux",
"os_version": "6.6.31-haos-raspi",
"supervisor": "2024.11.2",
"host_os": "Home Assistant OS 13.2",
"docker_version": "27.2.0",
"chassis": "embedded",
"run_as_root": true
},
"custom_components": {
"powercalc": {
"documentation": "https://docs.powercalc.nl",
"version": "v1.15.4",
"requirements": [
"numpy>=1.21.1"
]
},
"hacs": {
"documentation": "https://hacs.xyz/docs/configuration/start",
"version": "2.0.1",
"requirements": [
"aiogithubapi>=22.10.1"
]
},
"midea_dehumidifier_lan": {
"documentation": "https://github.com/nbogojevic/homeassistant-midea-air-appliances-lan/blob/main/README.md",
"version": "0.9.4",
"requirements": [
"midea-beautiful-air==0.10.5"
]
},
"waste_collection_schedule": {
"documentation": "https://github.com/mampfes/hacs_waste_collection_schedule#readme",
"version": "2.4.0",
"requirements": [
"icalendar",
"recurring_ical_events",
"icalevents>=0.1.26,!=0.1.28",
"beautifulsoup4",
"lxml",
"pycryptodome"
]
}
},
"integration_manifest": {
"after_dependencies": [
"integration",
"utility_meter"
],
"codeowners": [
"bramstroker"
],
"config_flow": true,
"dependencies": [
"light",
"group",
"template",
"select",
"utility_meter"
],
"documentation": "https://docs.powercalc.nl",
"domain": "powercalc",
"iot_class": "calculated",
"issue_tracker": "https://github.com/bramstroker/homeassistant-powercalc/issues",
"name": "Powercalc",
"requirements": [
"numpy>=1.21.1"
],
"version": "v1.15.4",
"is_built_in": false,
"overwrites_built_in": false
},
"setup_times": {
"null": {
"setup": 3.5852293679490685
},
"01JAE3KA1K1PZ14FQYWKT0WFRS": {
"wait_import_platforms": -0.0002492018975317478,
"config_entry_setup": 0.02400808222591877
},
"01JAF7N2YC4D6Y11EFJ69PMY1V": {
"config_entry_setup": 0.01846133079379797
},
"01JAF7PC7HWDC28ATQFZ3E12AW": {
"config_entry_setup": 0.013555796816945076
},
"01JCV4RT42S0988XFR9PFZDGJ4": {
"config_entry_setup": 0.017215249128639698
},
"01JCKS35MYP4ZSHGB66GRPQVVF": {
"config_entry_setup": 0.21734145190566778
},
"01JB71BYHEFZG9GZ6EN810ANTC": {
"config_entry_setup": 0.21940632490441203
},
"01JCKTFAAVJ4KCY8045HNKGKSX": {
"config_entry_setup": 0.2141138301230967
},
"01JCKTKRQMED7WFF3YX71S56MP": {
"config_entry_setup": 0.15739877382293344
},
"01JCKTP4CT0EMTM20W53CZSTJT": {
"config_entry_setup": 0.10215092776343226
}
},
"data": {
"entry": {
"created_at": "2024-11-17T16:30:59.769854+00:00",
"data": {
"name": "15 WP energyconsumption",
"create_utility_meters": true,
"entity_id": "sensor.energy_log_current_power_consumption_32306",
"device": "0341dbb7c2e8bc1c6a11e32799a1cdda",
"utility_meter_types": [
"daily",
"weekly",
"monthly",
"yearly"
],
"utility_meter_tariffs": [],
"utility_meter_net_consumption": false,
"utility_meter_offset": 0.0,
"sensor_type": "real_power"
},
"discovery_keys": {},
"disabled_by": null,
"domain": "powercalc",
"entry_id": "01JCXFD65S69N0VWHNRBAQ4AS7",
"minor_version": 1,
"modified_at": "2024-11-17T16:30:59.769868+00:00",
"options": {},
"pref_disable_new_entities": false,
"pref_disable_polling": false,
"source": "user",
"title": "15 WP energyconsumption",
"unique_id": null,
"version": 4
}
}
}
The text was updated successfully, but these errors were encountered: