How to make this switch compatible with home assistant? using smart life

I have this smart switch which is probably a local rebrand of some china model and was wondering if it’s possible to get the power data and be able to switch it within home assistant, planning to use it for power consumption too.

https://shopee.com.my/-NEW-Eva-16A-WiFi-Smart-Plug-with-Power-Monitoring-works-with-Tuya-Smart-Life-supports-SmartThings-Alexa-Google-Home-i.33245961.9949077986

i tried to find the closest thing to it and im guessing it might be this one? Teckin SP27 Plug Configuration for Tasmota but not sure on the right way of going around this.

Tuya-convert does not work anymore, so if it is an esp, you might need to open it to flash it to Tasmota.

otherwise:

https://developer.tuya.com/en/docs/iot/Home_Assistant_Integration?id=Kamcjcbvk2mu8

not sure if its an esp, and don’t think I can easily access this somehow. I also dont have the skills or tools to get it open and flash it, i’ll give the 2nd option a try again and see if that works, thanks :slight_smile:

so i tried it again and it showed up automatically, but only one entity which is to switch it on or off. Was hoping maybe i could be able to track the power as well and put that into energy to track how much is being used

well, you can still try localtuya

1 Like

followed some guides and it worked :slight_smile: just one last thing I need to do which is to create a sensor that converts the wattage to kwh so I can use it for home assistant energy monitoring, thanks a lot for the help

Use the riemann integration with the left method.

1 Like

i was trying something else but that didnt work, i gave this a try and seems like it updated after a while but i still cant seem to add it to the energy tab, Electricity grid, ‘add consumption’. only my tplink switch is available which i setup b4

The

device_class: energy

is missing

image

If the source entity has a “power” device_class, the integrated entity will automatically have the “energy” device_class, but the integration code only adds the device_class after the source entity state has been updated at least once.

And you better add

method: left

to your integration sensor.

1 Like

Thanks so much for helping me out, I made another sensor for my 2nd switch to measure kWh and it had device_class: energy which was missing from the first switch. I added device_class: energy to the first switch entity and for some reason, it’s still not showing up in the energy entity list. I have also tried adding method: left to both but they ended up disappearing?

Maybe post (in text between </>, not screenshot) what you have defined now.

all good, i found out that it was caused unit of measurement was kwh instead of kWh, thought I changed it but it didn’t update. Thanks :slight_smile: