Tuya smart Plug energy tracking

Hi,

Recently I got problems with local tuya and therefore I deleted it and reinstalled.

Now I can’t get the energy tracking anymore as separate sensor.

I do see in development that there is data when using the washing machine so I wondered if someone could help me out with creating a custom sensor for tracking.

I tried Google but it didn’t find a solution yet.

Thanks

Suppose you want to create template sensor. Considering that attribute current_consumption contains power in Watts try adding something like below to your configuration.yaml (just replace entity_id.of_your_washing_machine with proper entity id :wink: ):

template:
  - sensor:
    - name: "washing machine current consumption"
      unique_id: washing_machine_current_consumption
      state_class: measurement
      device_class: power
      unit_of_measurement: "W"
      state: >-
        {{ float(state_attr('entity_id.of_your_washing_machine', 'current_consumption') | default(0, true)) }}
1 Like

Thanks, that’s exactly what I needed. Working great now.