maximkulkin / esp-homekit-demo

Demo of Apple HomeKit accessory server library
MIT License
803 stars 233 forks source link

Sonoff power and library HLW8012 #178

Open oremic opened 5 years ago

oremic commented 5 years ago

hi. There are ways to have the HLW8012 library to get the EVE power meter via apple homekit. for th10 and th16 thank you

maximkulkin commented 5 years ago

Ok, I guess this is a question, not a statement and it's about supporting power measurement on some Sonoff models (a good writeup by author of HLW8012 library for ESP8266 on ArduinoCore). Although I couldn't find evidence that HLW8012 is installed on Sonoff TH10/TH16 models.

I checked the library and I think it can be easily ported to esp-open-rtos: you just need to replace digitalWrite() and always use interrupts instead of doing busy waiting counting pulse width in pulseIn() function.

As of Elgato EVE support for exposing that data, here is reverse engineered list of EVE custom characteristics.

oremic commented 5 years ago

Hello There was a question. It would be really nice to have consumption, for sonoffs. Eve allows to have a series of information on consumption. I could test it if you can make a port. thank you.

seritos commented 4 years ago

Hi @maximkulkin,

Many devices now have integrated this power meter. In example, the cost effective Houzetek AW7PL has the HWL8012 and the device is apparently great, as has several GPIOS free to add it aditional functionalities.

Would be possible to integrate it?

Many thanks!

HomeKidd commented 4 years ago

@maximkulkin I'm also interested in HWL8012 library for esp-open-rtos 😄

Also keep in mind that HWL8012 needs to be calibrated for proper measurements. 😄

Kristian8606 commented 4 years ago

As Maximkulkin said, this library will be easily modified. The question is, did anyone manage to create custom features? @Maximkulkin would you build these features for us users?

HomeKidd commented 4 years ago

Yes, i have but without the Eve characteristics and HomeKit data type it will not work. HomeKit data type is added to esp-homekit, but its not that easy to work with like an int/float based characteristic like Temp Sensor etc.😄 But i'm still working on it 😄

Kristian8606 commented 4 years ago

Can you share the code? I think maximkulkin added the data type.

HomeKidd commented 4 years ago

HLW8012_BL0937_ESP-master.zip As i've said, data type is added because i've requested it but currently on static data is working. But its way more complicated since other types......i'm working on this since december

Kristian8606 commented 4 years ago

In another post you mentioned that you were able to show the story, can you share code?

HomeKidd commented 4 years ago

In another post you mentioned that you were able to show the story, can you share code?

I was not able to show any history with esp-homekit, only with HomeKit Accessory Simulator and only one time. So theres no code currently!

maccoylton commented 4 years ago

I already did a port.. it's here:- https://github.com/maccoylton/HLW8012_BL0937_ESP Example of a device using it it here:- https://github.com/maccoylton/esp-homekit-gosund-up111

Feedback welcome