Trying to make an automation when tv is on to turn on lights
purchased a energy monitoring plug which uses Tuya
only has one entity for on off
Can’t figure out how to get this to work in an automation based on the wattage or current consumption.
I see it in the statistics in Tuya but not in HA
You can use LocalTuya and you’ll have access to current, voltage and power as attributes of the entity. It’s not very easy to do it but you’ll find tutorials on youtube on how to get the local keys for your devices. DO NOT follow any tutorial that makes you register to the Tuya Developers website because that method doesn’t work anymore. I personally did it with the rooted-Android method installing BlueStacks.
The instructions for LocalTuya (installed through HACS) can be found in HACS itself.
I recommend NOT using the UI to add the devices but edit the configuration.yaml yourself as instructed on LocalTuya’s page (on github too)
The only thing that confused me is choosing the “entity id” when adding the device. Basically every Tuya device can have more than one entity and some of them are dummy. Try to work out from their values what they are. For instance I had a simple smart plug with IDs:
ID 1 - True
ID 9 - 0
ID 1 is True when the plug is on, False when it’s off. ID 9 is always 0 so it probably doesn’t do anything or it may be an input and if you force it to 1 resets the plug (I don’t know I did not try).
The plugs that have energy monitoring had 5 IDs. The first True/False is the state of the switch, the second again was dummy always zero but then the other ones were numbers and represented the current, the voltage, and the power consumption