I made a template.yaml which is included in configuration.yaml with this template:
- sensor:
- name: Differenzverbrauch
unique_id: Differenzverbrauch
unit_of_measurement: 'W'
state: '{{ states("sensor.shellyem3_c45bbe6be51f_channel_a_power") |float(0) |round(2)
+ states("sensor.shellyem3_c45bbe6be51f_channel_b_power") |float(0) |round(2)
+ states("sensor.shellyem3_c45bbe6be51f_channel_c_power") |float(0) |round(2) }}'
device_class: energy
4 Likes
330chauf
(330chauf)
April 16, 2022, 1:53pm
22
Hi @dirksenrdh
Can I conclude that you are using Iungo?
grtz chauf
niro1987
(Niels)
April 16, 2022, 1:55pm
23
3 Likes
can someone explain to me how to create the sensor.energy_consumption_tarif_1?
does this have anything to do with mqtt?
Hi all,
Can some help me to calculate only the energy consumption if it is >0?
My template now is following:
- platform: template
sensors:
energie_totaal:
friendly_name: Vermogen (totaal)
unit_of_measurement: "kWh"
value_template: '{{ states("sensor.youless_consumption_high" )| float + states("sensor.youless_consumption_low") | float }}'
1 Like
amamoh
(Amamoh)
August 26, 2022, 11:43am
26
Maybe this will guide you.
value_template: >
{% if is_state('switch.sonoff_1000bee815', 'on') %}
{{ ((states('sensor.sonoff_1000bee0f9_temperature')|float
(states('sensor.sonoff_1000bee815_temperature')|float))
|float | round(1) }}
{% else %} 0.0 {% endif %}
I am trying hard to assign a value to a sensor depending on the state of an entity (Delta T: if the pump runs = calc and 0 if the pump doesn’t run. This is what I did:
- platform: template
sensors:
delta_t_solar_heating:
friendly_name: Delta T
unit_of_measurement: °C
value_template: {% if is_state('switch.sonoff_1000bee815', 'on') %}
{{ (( states('sensor.sonoff_1000bee0f9_temperature') | float ) - ( states('sensor.sonoff_1000bee815_…
usbrit
(Usbrit)
August 30, 2022, 9:52pm
27
I have the following template that appears to work:
But I’m getting errors in the yaml config check.
I’m new to yaml but after a lot of research can’t figure out what I’m doing wrong! Can someone help please?
Ascotg
(Ascotg)
July 19, 2023, 1:04pm
28
I believe there’s an error in the indentation and " vs ’
- sensor:
- name: "house_cons_in_w"
unique_id: "sensor.house_cons_in_W"
unit_of_measurement: "W"
device_class: power
state: "{{ states('sensor.p1_meter_grid_power_W') | float + states('sensor.pv_total_instant_solar_power_w') | float }}"
anjimene
(Angel Jimenez Oteiza)
January 9, 2024, 4:35pm
29
Hi all,
I am trying to make a subtraction from an energy value. I do the operations in Jinja2 templating and the result is ok.
But I write the lines in the condifuraion.yaml and give me errors:
Error loading /config/configuration.yaml: invalid key: “{‘states(sensor.es0021000013482086rn_accumulated_consumption) |float - (24991)|float’: None}”
in “/config/configuration.yaml”, line 198, column 0
Somebody can help me, please? Thanks a lot.