cozylife / hass_cozylife_local_pull

home asstiant plugin
81 stars 35 forks source link

Energy Monitoring Home Assistant #38

Open wattefuk opened 1 month ago

wattefuk commented 1 month ago

I bought some of these Cozylife Energy Monitoring Wifi Smart Plugs. By default, only with Cozylife App was some Energy information Readable. Integration in Home Assistant was only On-Off Function possible.

I now made it to integrate Energy information into Home Assistant with some reverse engineeting and ready Information with TCP requrst. You may try following TCP request, port 5555.

Data 28 and 29 is Power and Voltae, Request TCP to Port 5555; {"msg":{"attr":[1,2,27,28,29]},"pv":0,"cmd":2,"sn":"1714912908310"}\r\n Answer from Smartplug: {"msg":{"attr":[1,2,27,28,29],"data":{"1":1,"2":0,"27":208,"28":43,"29":239}},"pv":0,"cmd":2,"sn":"1714912908310","res":0}

This Answer package was 43 Watt Power and 329 V Voltage. The Numer 171.. is Time Stamp. I had problems with old time stamp.

Now i am running cylclic TCP Poll of Power Information of all Smar Plugs, convert Information with Node-Red into some MQTT broker and use this in Home Assistant.

Some small issues, as i currently have not figuered out how to make integration of wattage into kWh in Home Assistant. If someone know how to do this, glad to hear from you.

Enjoy

HeyHeyHuppi commented 3 weeks ago

use this: https://github.com/SodaWithoutSparkles/cozylife-outlet-power

BonefaceJohnson commented 1 week ago

use this, even better: https://github.com/rjosantos/hass_cozylife_local_pull_sensor