TP-Link HS110 history not updating

What is wrong in my configuration that HS110 is not updated in history view? I just see straight line.

Here is my configuration.yaml:

history:
  include:
    domains:
      - device_tracker
      - switch
    entities:
      - sensor.plug_current_a
      - sensor.plug_voltage
      - sensor.plug_current_power_w
      - sensor.plug_today_energy_kwh
      - sensor.plug_total_energy_kwh

- platform: template
    sensors:
      # TP HS110 Switch Plug  
      plug_voltage:
        entity_id: sensor.plug_voltage
        value_template: '{{ states.switch.plug.attributes.voltage }}'
        unit_of_measurement: 'V'
        icon_template: mdi:flash-circle
      plug_current_a:
        entity_id: sensor.plug_current_a
        value_template: '{{ states.switch.plug.attributes.current_a }}'
        unit_of_measurement: 'A'
        icon_template: mdi:current-ac
      plug_total_energy_kwh:
        entity_id: sensor.plug_total_energy_kwh
        value_template: '{{ states.switch.plug.attributes.total_energy_kwh }}'
        unit_of_measurement: 'kW'
        icon_template: mdi:power-socket-eu
      plug_current_power_w:
        entity_id: sensor.plug_current_power_w
        value_template: '{{ states.switch.plug.attributes.current_power_w }}'
        unit_of_measurement: 'W'
        icon_template: mdi:power
      plug_today_energy_kwh:
        entity_id: sensor.plug_today_energy_kwh
        value_template: '{{ states.switch.plug.attributes.today_energy_kwh }}'
        unit_of_measurement: 'kW'
        icon_template: mdi:power-socket-eu

customize.yaml:

sensor.plug_current_a:
  friendly_name: Current
sensor.plug_voltage:
  friendly_name: Voltage
sensor.plug_current_power_w:
  friendly_name: Current Power
sensor.plug_today_energy_kwh:
  friendly_name: Today Energy
sensor.plug_total_energy_kwh:
  friendly_name: Total Energy

groups.yaml:

switch:
  name: Switch
  view: no
  entities:
    - switch.plug
    - sensor.plug_current_a
    - sensor.plug_voltage
    - sensor.plug_current_power_w
    - sensor.plug_today_energy_kwh
    - sensor.plug_total_energy_kwh

Your sensors aren’t updating because the entity_id you are referencing to tell them when to update are themselves. They should all be switch.plug by the looks.

Still don’t understand what and where I have to change? Can you explain it in more detail.

Remove the entity_id lines, they are not needed.

2 Likes