History sensor problem

Hello, I have total energy sensor but I dont see the history of sensor…
This is the config of sensor I made

template:
  - sensor:
      - name: "צריכת חשמל נוכחית"
        unit_of_measurement: 'W'
        state_class: measurement
        device_class: power
        state: >
          "{{ ( states('sensor.shelly1pm_c45bbe6c4171_power')|float(0) + states('sensor.shelly1pm_d8bfc01a1512_power')|float(0) + states('sensor.shelly1pm_84cca8a824e8_power')|float(0) + states('sensor.shelly1pm_c45bbe6c4171_power')|float(0) + states('sensor.shelly1pm_98cdac1f5218_power')|float(0) + states('sensor.shelly1pm_e8db84d79a44_power')|float(0) + states('sensor.shelly1pm_98cdac1e2174_power')|float(0) + states('sensor.tasmota_energy_power')|float(0) + states('sensor.shelly1pm_e8db84d7a30e_power')|float(0) + states('sensor.tasmota_energy_power_3')|float(0) + states('sensor.shelly1pm_e8db84d79a44_power')|float(0) + states('sensor.tasmota_energy_power')|float(0) + states('sensor.sonoff_1000cab798_power')|float(0) + states('sensor.sonoff_1000cab589_power')|float(0) + states('sensor.tnvr_mqlkht_power')|float(0) + states('sensor.tasmota_energy_power_4')|float(0) )|round(0)|int(0) }}"

and that what I see
a


someone know what can be the problem?
thank you

The value the sensor reports should be numeric, like 832, but it is non-numeric because it includes double-quotes "832".

The reason is because you have defined a multi-line template, which doesn’t require outer quotes like a single-line template, but have included outer double-quotes. As a consequence, the double-quotes become part of the reported value. Remove them and execute Reload Template Entities. You may have to wait several hours for new, numeric data to be reported before it appears in the graph.

I tried to remove this but it still not working

Post the sensor’s revised configuration.

I think im not remove the right quotes
I tried 2 options

1

  - sensor:
      - name: "2צריכת חשמל נוכחית"
        unit_of_measurement: W
        state_class: measurement
        device_class: power
        state: >
          "{{ ( states('sensor.shelly1pm_c45bbe6c4171_power')|float(0) + states('sensor.shelly1pm_d8bfc01a1512_power')|float(0) + states('sensor.tvrh_mqlkht_power')|float(0) + states('sensor.slvn_vpynt_vkl_lvqly_power')|float(0) + states('sensor.dvd_power')|float(0) + states('sensor.shelly1pm_84cca8a824e8_power')|float(0) + states('sensor.shelly1pm_c45bbe6c4171_power')|float(0) + states('sensor.shelly1pm_98cdac1f5218_power')|float(0) + states('sensor.shelly1pm_e8db84d79a44_power')|float(0) + states('sensor.shelly1pm_98cdac1e2174_power')|float(0) + states('sensor.tasmota_energy_power')|float(0) + states('sensor.shelly1pm_e8db84d7a30e_power')|float(0) + states('sensor.tasmota_energy_power_3')|float(0) + states('sensor.shelly1pm_e8db84d79a44_power')|float(0) + states('sensor.tasmota_energy_power')|float(0) + states('sensor.sonoff_1000cab798_power')|float(0) + states('sensor.sonoff_1000cab589_power')|float(0) + states('sensor.tnvr_mqlkht_power')|float(0) + states('sensor.tasmota_energy_power_4')|float(0) )|round(0)|int(0) }}"
         

2

  - sensor:
      - name: "1צריכת חשמל נוכחית"
        unit_of_measurement: W
        state: >
          "{ ( states('sensor.shelly1pm_c45bbe6c4171_power')|float(0) + states('sensor.shelly1pm_d8bfc01a1512_power')|float(0) + states('sensor.tvrh_mqlkht_power')|float(0) + states('sensor.slvn_vpynt_vkl_lvqly_power')|float(0) + states('sensor.dvd_power')|float(0) + states('sensor.shelly1pm_84cca8a824e8_power')|float(0) + states('sensor.shelly1pm_c45bbe6c4171_power')|float(0) + states('sensor.shelly1pm_98cdac1f5218_power')|float(0) + states('sensor.shelly1pm_e8db84d79a44_power')|float(0) + states('sensor.shelly1pm_98cdac1e2174_power')|float(0) + states('sensor.tasmota_energy_power')|float(0) + states('sensor.shelly1pm_e8db84d7a30e_power')|float(0) + states('sensor.tasmota_energy_power_3')|float(0) + states('sensor.shelly1pm_e8db84d79a44_power')|float(0) + states('sensor.tasmota_energy_power')|float(0) + states('sensor.sonoff_1000cab798_power')|float(0) + states('sensor.sonoff_1000cab589_power')|float(0) + states('sensor.tnvr_mqlkht_power')|float(0) + states('sensor.tasmota_energy_power_4')|float(0) )|round(0)|int(0) }"

You should remove the double-quotes enclosing the template.

template:
  - sensor:
      - name: "צריכת חשמל נוכחית"
        unit_of_measurement: 'W'
        state_class: measurement
        device_class: power
        state: >
          {{ ( states('sensor.shelly1pm_c45bbe6c4171_power')|float(0) + states('sensor.shelly1pm_d8bfc01a1512_power')|float(0) + states('sensor.shelly1pm_84cca8a824e8_power')|float(0) + states('sensor.shelly1pm_c45bbe6c4171_power')|float(0) + states('sensor.shelly1pm_98cdac1f5218_power')|float(0) + states('sensor.shelly1pm_e8db84d79a44_power')|float(0) + states('sensor.shelly1pm_98cdac1e2174_power')|float(0) + states('sensor.tasmota_energy_power')|float(0) + states('sensor.shelly1pm_e8db84d7a30e_power')|float(0) + states('sensor.tasmota_energy_power_3')|float(0) + states('sensor.shelly1pm_e8db84d79a44_power')|float(0) + states('sensor.tasmota_energy_power')|float(0) + states('sensor.sonoff_1000cab798_power')|float(0) + states('sensor.sonoff_1000cab589_power')|float(0) + states('sensor.tnvr_mqlkht_power')|float(0) + states('sensor.tasmota_energy_power_4')|float(0) )|round(0)|int(0) }}

Oh ok thank you!!! now its working!
Thank you man!

1 Like