Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

power_meter device profiles detect too many entities #2866

Open
RubenKelevra opened this issue Dec 28, 2024 · 7 comments
Open

power_meter device profiles detect too many entities #2866

RubenKelevra opened this issue Dec 28, 2024 · 7 comments
Labels
autodiscovery bug Something isn't working

Comments

@RubenKelevra
Copy link
Contributor

Devices listed in the library as power_meter will show up with every of their sensor:* entity in the auto detection:

Screenshot_20241228_132617

Originally posted by @RubenKelevra in #2834 (comment)

@bramstroker
Copy link
Owner

As discussed.
This is due to the device having 4 "sensor." entities.
Powercalc discovers per entity, and for power meters this is all entities of sensor domain.

Working on a per device discovery now, which is ideal for self usage of IoT devices.

Have working draft ready now.
#2868

Needs some final polishing.

But we can add "discovery_type": "device" to the model.json.

This will also cause the powercalc profile to only be discovered once per device, as it's not bounded to specific entities.

@bramstroker bramstroker added autodiscovery bug Something isn't working labels Dec 28, 2024
@bramstroker
Copy link
Owner

@RubenKelevra Fixes for this was released in latest v1.17 beta versions.
Are you able to test?

@RubenKelevra
Copy link
Contributor Author

@bramstroker I got the beta 2 installed, but those messages did not disappear. But would they? Or are they once send out by Powercalc permanent, even through reboots?

Screenshot_2025-01-03-14-38-07-163-edit_io homeassistant companion android

@bramstroker
Copy link
Owner

I see. discovery messages are not persistent. Forgot to actually add the new discovery_by attribute to shelly pm mini profile.
Done with af510c1.

Give it another restart and it should work correctly now hopefully.

@RubenKelevra
Copy link
Contributor Author

I've updated to beta 4 and rebooted:

Screenshot_2025-01-03-15-38-15-098-edit_io homeassistant companion android

@bramstroker
Copy link
Owner

Strange. Could you try with these log lines added and enable debug logging?
f02b2c1

You can overwrite / modify config/custom_components/powercalc/discovery.py on your system.

@RubenKelevra
Copy link
Contributor Author

Strange. Could you try with these log lines added and enable debug logging? f02b2c1

You can overwrite / modify config/custom_components/powercalc/discovery.py on your system.

Here's the log:

�[36m2025-01-08 22:35:49.114 DEBUG (MainThread) [custom_components.powercalc.discovery] sensor.shellypmminig3_ecda3bc656a0_power: Found model information on device (manufacturer=Shelly, model=Shelly PM Mini Gen3, model_id=S3PM-001PCEU16)�[0m
�[36m2025-01-08 22:35:49.128 DEBUG (MainThread) [custom_components.powercalc.discovery] Found power profile: shelly/shelly pm mini gen3, discovery_by: entity�[0m
�[36m2025-01-08 22:35:49.129 DEBUG (MainThread) [custom_components.powercalc.discovery] sensor.shellypmminig3_ecda3bc656a0_power: Initiating discovery flow, unique_id=pc_ECDA3BC656A0-pm1:0-power_pm1�[0m
�[36m2025-01-08 22:35:49.129 DEBUG (MainThread) [custom_components.powercalc.discovery] sensor.shellypmminig3_ecda3bc656a0_voltage: Found model information on device (manufacturer=Shelly, model=Shelly PM Mini Gen3, model_id=S3PM-001PCEU16)�[0m
�[36m2025-01-08 22:35:49.129 DEBUG (MainThread) [custom_components.powercalc.discovery] Found power profile: shelly/shelly pm mini gen3, discovery_by: entity�[0m
�[36m2025-01-08 22:35:49.129 DEBUG (MainThread) [custom_components.powercalc.discovery] sensor.shellypmminig3_ecda3bc656a0_voltage: Initiating discovery flow, unique_id=pc_ECDA3BC656A0-pm1:0-voltage_pm1�[0m
�[36m2025-01-08 22:35:49.129 DEBUG (MainThread) [custom_components.powercalc.discovery] sensor.shellypmminig3_ecda3bc656a0_energy: Found model information on device (manufacturer=Shelly, model=Shelly PM Mini Gen3, model_id=S3PM-001PCEU16)�[0m
�[36m2025-01-08 22:35:49.130 DEBUG (MainThread) [custom_components.powercalc.discovery] Found power profile: shelly/shelly pm mini gen3, discovery_by: entity�[0m
�[36m2025-01-08 22:35:49.130 DEBUG (MainThread) [custom_components.powercalc.discovery] sensor.shellypmminig3_ecda3bc656a0_energy: Initiating discovery flow, unique_id=pc_ECDA3BC656A0-pm1:0-energy_pm1�[0m
�[36m2025-01-08 22:35:49.130 DEBUG (MainThread) [custom_components.powercalc.discovery] sensor.shellypmminig3_ecda3bc656a0_frequency: Found model information on device (manufacturer=Shelly, model=Shelly PM Mini Gen3, model_id=S3PM-001PCEU16)�[0m
�[36m2025-01-08 22:35:49.130 DEBUG (MainThread) [custom_components.powercalc.discovery] Found power profile: shelly/shelly pm mini gen3, discovery_by: entity�[0m
�[36m2025-01-08 22:35:49.130 DEBUG (MainThread) [custom_components.powercalc.discovery] sensor.shellypmminig3_ecda3bc656a0_frequency: Initiating discovery flow, unique_id=pc_ECDA3BC656A0-pm1:0-freq_pm1�[0m

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autodiscovery bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants