question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

utility_meter.calibrate not working with the generated utility meters of this integration

See original GitHub issue

utility_meter.calibrate not working with the generated utility meters of this integration

Do you have any clue? I only get

Unable to find referenced entities sensor.foo_energy_counter_daily or it is/they are currently not available

Whereas, the same service-call with a utility meter from the plain utility meter integration is working

service: utility_meter.calibrate
data:
  value: "2"
target:
  entity_id:
    - sensor.bar_energy_counter_daily

The only difference I see, but is most probably causing the error above is

"platform": "utility_meter",

vs

"platform": "powercalc",

of the sensors in the entity registry.

And I think that this is the root cause of the not existing utility_meter.calibrate service for the other user in the community as well, because I think the service is only existing with sensors existing in the platform and working if the sensor is in the platform.

But this is only gut feeling.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
bramstrokercommented, Aug 14, 2022

Yes you are correct, I have stepped through the code and an entity service only allows entities created by the same integration (domain) to be provided to the service. In this case utility_meter. The utility meters created by powercalc are registered to the powercalc domain which makes them not allowed to be used by the calibrate service. There is not really a workaround I think, because all this code and limitation is in the core codebase. Only thing I can do is replicate the calibrate service as a new service for powercalc. I think I am ok with that as it’s only 2 lines of code.

0reactions
emufancommented, Aug 14, 2022

It’s working. Thanks a lot!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Utility meter fails cali · Issue #33998 · home-assistant/core
The problem Setting intial values for utility_meters value calling service utility_meter.calibrate fails: ". 'TariffSelect' object has no ...
Read more >
Utility Meter - Home Assistant
The Utility Meter integration provides functionality to track consumptions of various utilities (e.g., energy, gas, water, heating). From a user perspective ...
Read more >
Use Utility Meter integration to Track gas, power and water
EDIT: With Home Assistant 2021.8 and addition of Energy dashboard this integration is helping you track your energy with more detail.
Read more >
Is Your Electric Utility Meter Calibrated Correctly?
If it's not, you could be spending much more on your electrical bills than you should be. Why should I care if my...
Read more >
Utility Meter Setup Guide The University of North Carolina at ...
A. Integration of Utility Meter Readings into UNCG's Building Automation ... The MAC addresses for the Shark 200 meters are NOT provided on...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found