Closed Vaszago closed 1 year ago
I'm still investigating myself. I'll let you know one if fixed it.
I've extended it a little bit, to check for 0.0
values to avoid division by zero. However, your error message seems to be related to the overall structure: sensor
-> template
-> sensors
-> solarfocus_heat_pump_cop
Below is the structure of my config:
sensor:
- platform: template
sensors:
solarfocus_heat_pump_cop:
friendly_name: "COP"
unit_of_measurement: "W/W"
icon_template: mdi:poll
value_template: >
{% if states("sensor.solarfocus_heat_pump_electrical_power") | int == 0 %}
0.0
{% else %}
{{ '%0.f' | format(float(states('sensor.solarfocus_heat_pump_heating_thermal_power'), 0.0) /
float(states('sensor.solarfocus_heat_pump_electrical_power'), 0.0)
) }}
{%endif%}
I decided to re-introduce the COP calculation to the library and make it more specific:
The only thing that has to be done within HA (due to the missing persistence of the library itself), is the calculation of the Jahresarbeitszahl (JAZ, annual performance number). I'll close this issue, as soon as the release is out.
Hi I had to adjust the code a bit. My query now works correctly.
That would be great if you could tie it in like this.
It would be cool if you could also include the outside temperature of the WP in your query. Then I could delete the manual query via Modbus.
@Vaszago please create a new issue for that. Thanks
@Vaszago COP is now available again. The cop_heating
corresponds to the former coefficient of performance provided by the integration.
Here is the entry in Yaml
But the code works under template
What am I doing wrong
Originally posted by @Vaszago in https://github.com/LavermanJJ/home-assistant-solarfocus/issues/15#issuecomment-1302996779