utility_meter.calibrate not working with the generated utility meters of this integration
See original GitHub issueutility_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:
- Created a year ago
- Comments:6 (6 by maintainers)
Top GitHub Comments
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.It’s working. Thanks a lot!