Open Tinwelint78 opened 2 years ago
Maybe this is being addressed by #473?
I have this working, for both LocalTuya and Xiaomi integration smart plugs. If it's still not working for you, let me know and I can share some config.
I managed to use total energy by defining the sensor as "device_class:energy". I haven't been successfull in reading voltage/current meters though, so if you can share a config for doing this I'll be grateful!
I haven't been successfull in reading voltage/current meters though
It took me quite some time to work out what you mean by this, sorry. I didn't realise that the integration doesn't support your device fully!
I believe the values you are trying to get are not yet supported by this integration. The PR you linked (#473) or something similar is needed.
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
I'm trying to get energy meter from a tuya wifi smart meter. I have succesfully added total energy in kWh, but I cannot select this sensor in the energy panel, so I was trying the "integral" method, as described in #536, but even if I see the current/voltage sensor values from Tuya IoT, I cannot see them from DP dump.
Environment
Steps to reproduce
Configuration
configuration.yaml
orconfig_flow
DP dump
Provide Home Assistant taceback/logs
Additional information
Here is the dump from the "Get Device details" in Tuya IoT API explorer:
Current and voltage values are there, how can I get them? Alternatively, How can I make Energy panel accept total energy sensor?