Hi
I want the watts currently being used be devided by 1000 and multiplied by an inputnumber(The costs per kWh)
The watts are an entity with
state_class: measurement
unit_of_measurement: W
icon: mdi:calculator
friendly_name: TotaalVermogen
and a state that represents the current watts (70.0)
The input_number.stroom_normaaltarief
initial: null
editable: true
min: 0
max: 10
step: 0.001
mode: box
unit_of_measurement: EUR/kWh
icon: mdi:cash-marker
friendly_name: Stroom_Normaaltarief
It looked to me as a very easy thing to do. Create a sensor in confiuguration.yaml and divide and multiply.
Somehow i can’t get it to work
Current code is.
template:
- sensor:
- name: HobbyUurprijs
unit_of_measurement: "Euro"
state: "{{(state('sensor.TotaalVermogen_Elitedesk_Monitoren')|float(0)/1000) * state(input_number.stroom_normaaltarief)}}"