I want to set up a time triggered template to calculate the money i saved with my pv every day. This involves a subtraction of two sensor values first and then a multiplication of the result with another value. If I only include the subtraction, everythings works fine, but adding the multiplication always breaks it. Could anyone please point out to me what I’m doing wrong?
This is how it looks:
template:
- trigger:
- platform: time
at: "23:59:55"
sensor:
- name: "PV-Ersparnis am Tag"
unique_id: "pv_ersparnis_am_tag"
state_class: total
unit_of_measurement: "€"
state: "{{ (states('sensor.tagliche_hauseinspeisung_wr')|float (0) - states('sensor.tagliche_netzeinspeisung')|float (0)) * states(input_number.aktueller_strompreis)|float (0) }}"