Open JesusRo opened 3 years ago
I can confirm this, I have a bucket load of the Kogan AU energy meter smart plugs (they have the WB25), have these in tuya cloud as well as in tuya local (18,19,20). I have noticed that this energy meter does have extra options (21,22,23,24,25,26,41,42) What they corelate to in regards to KWh day totals or overall KWh totals is anybody's guess.
I also have a TP-Link Energy Monitor HS110(AU) and this is selectable in the Energy dash as i've include the sensor template to get the "Current Consumption" and "Total Consumption"
I'm using a work around using the Rieman sum integration and this code for each switch in my sesnors.yaml
homeassistant:
customize:
sensor.smart_plug_1_energy:
device_class: energy
last_reset: '1970-01-01T00:00:00+00:00'
state_class: measurement
sensor:
platform: template sensors: smart_plug_1_voltage: value_template: '{{ state_attr("switch.smart_plug_1", "voltage")| int }}' unit_of_measurement: 'V' smart_plug_1_current: value_template: '{{ state_attr("switch.smart_plug_1", "current")| int /1000}}' unit_of_measurement: 'A' smart_plug_1_power: value_template: '{{ state_attr("switch.smart_plug_1", "current_consumption")| int }}' unit_of_measurement: 'W'
platform: integration source: sensor.smart_plug_1_power name: smart_plug_1_energy unit_prefix: k round: 2
another way is in the sensor.py add following
from homeassistant.components.sensor import DEVICE_CLASSES, DOMAIN, STATE_CLASS_MEASUREMENT, SensorEntity
class LocaltuyaSensor(LocalTuyaEntity, SensorEntity):
**@property
def state_class(self):
return STATE_CLASS_MEASUREMENT**
The problem
Energy sensor devices are not available on new energy consumption panel They don´t show on the list and refers to https://www.home-assistant.io/more-info/statistics/ https://developers.home-assistant.io/docs/core/entity/sensor#long-term-statistics
Environment
Steps to reproduce
Go to the new panel and try to add wifi plugs existing via local tuya integration
Additional information
Just opened with the info HA says as I didn´t found issue open already for this