Open JiriPrchal opened 3 months ago
This has nothing to do with this integration ... f.e. I'm using automation with trigger on binary_sensor.energy_tariff change to set the correct distribution price ( number helper )
This has nothing to do with this integration ... f.e. I'm using automation with trigger on binary_sensor.energy_tariff change to set the correct distribution price ( number helper )
Example please. I don't understand why automation. Template sensor (number helper?) evaluates as inputs changes.
OK, I got it, you are using a template for buy price in the configuration for this integration. I thought it was a common HA template. Then I have no answer for you, just a workaround tip to calculate it in HA ( not using the integration )
Yes, this workaround:
template:
- sensor:
- name: "current spot electricity buy price fixed"
unit_of_measurement: "Kč/kWh"
icon: "mdi:cash"
state: "{{ (states ('sensor.current_spot_electricity_price') | float (0) + 0.35 + iif (is_state ('binary_sensor.energy_tariff', 'on'), 0.45043, 0.6443) + 0.21282 + 0.495 + 0.0283) * 1.21 }}"
The template for buy price i evaluated only once an hour. But the distribution cost can change at any time. For example my template:
{{ (value + 0.35 + iif (is_state ('binary_sensor.energy_tariff', 'on'), 0.45043, 0.6443) + 0.21282 + 0.495 + 0.0283) * 1.21 }}