mongoose-os-apps / shelly-homekit

Apple HomeKit firmware for Shelly's
Other
1.8k stars 129 forks source link

Shelly 1PM power consumption #27

Closed sebastien-savalle closed 3 years ago

sebastien-savalle commented 4 years ago

Hi,

I have installed the shelly homekit firmware on a Shelly 1PM. It works well but I can't find power consumption.

Would it be possible to add this feature ?

Thanks a lot.

sebastien-savalle commented 4 years ago

related to https://github.com/cesanta/mongoose-os/issues/531#issuecomment-605852246

sebastien-savalle commented 4 years ago

I’ve ported the Arduino HLW8012 power meter sensor library.

It's working fine with the Shelly 1PM. You can have a look here:

https://github.com/ellavas/mongoose-lib-hlw8012

edgarclerigo commented 4 years ago

Hi guys,

Whats the current status of this ? Anyone with this firmware is not able to see any data about the power consumption, even on the Eve App ?

rojer commented 4 years ago

current state: not supported, no ETA

Dag0d commented 3 years ago

Is this something you've been working on? Would love to see that feature. For the other power measurement Shelly devices which are already supported, do you expose the power consumption to the eve app?

rojer commented 3 years ago

power measurement is only supported on shelly 2.5 at the moment and is only surfaced on the web UI because there is no service or characteristic defined in the HAP protocol for such measurements.

sebastien-savalle commented 3 years ago

@Dag0d you can have a look to the library I have ported. It works fine on shelly 1PM.

https://github.com/ellavas/mongoose-lib-hlw8012

rojer commented 3 years ago

thanks @ellavas this is handy! i'll take a look

freddair commented 3 years ago

@rojer why not exposing power consumption to the eve app which would allow homekit automations like detecting when a washing machine / dish washer / water boiler is ready... would be really handy

rojer commented 3 years ago

Added support for power management for 1PM, Plug and PlugS. Please help test by installing http://rojer.me/files/shelly/2.7.0-alpha4/ - you should see power figures in the web UI. I am especially interested in accuracy, as I only have one of each of the device and cannot tell if coefficients hold across different samples. In theory, 1PM and PlugS should be the same, but mine differ by about 10%

andyblac commented 3 years ago

Added support for power management for 1PM, Plug and PlugS. Please help test by installing http://rojer.me/files/shelly/2.7.0-alpha4/ - you should see power figures in the web UI. I am especially interested in accuracy, as I only have one of each of the device and cannot tell if coefficients hold across different samples. In theory, 1PM and PlugS should be the same, but mine differ by about 10%

whats the minimum power draw required, i have mine just turning the indicator light on a fused spur, but it does not detect any power consumption. (it shows the status of my home alarm, if it is set it turns on the indicator) IMG_0400

Screenshot 2020-12-05 at 11 09 45

rojer commented 3 years ago

that's definitely under 1 watt, you won't see anything. i'd say any kind of accurate reading is from 10W.

Dag0d commented 3 years ago

did you make the power measurement values already persistent to create charts and so on?

rojer commented 3 years ago

no

Dag0d commented 3 years ago

okay thanks, I wondered why this wasn't working, I will continue testing this on my 1PM, till now it seems to run great. this evening I will have time to double check the power consumption measurements. if it is off, should we think about a calibrating process?

rojer commented 3 years ago

correct

Dag0d commented 3 years ago

I´ve tested it a bit further, this firmware shows approx 1 watt more than the original firmware, if I double check with a multimeter, the multimeter value is exactly between this value and the value of the original firmware. I would be fine with that

rojer commented 3 years ago

thank you! indeed, that is acceptable. probably just a matter of rounding.

rojer commented 3 years ago

this is done

masterc09 commented 3 years ago

I've got updated Shelly PlugS with latest shelly-homekit firmware to trigger a scene depending on power consumption like mentioned above from @freddair

@rojer why not exposing power consumption to the eve app which would allow homekit automations like detecting when a washing machine / dish washer / water boiler is ready... would be really handy

Can somebody confirm this functionality? I tried to access the value for power consumption via controller app with no luck, even not in eve app. If this should work could somebody give me a short instruction please? Thanks.

timoschilling commented 3 years ago

@masterc09 this issue is only about the measurement, that providing to HomeKit isn’t part of this issue. There is a other issue about that.

masterc09 commented 3 years ago

@timoschilling Thanks, now I got it.

ingenierodevops commented 1 year ago

Do you hace an y idea to make a workaround to this? maybe launch a web call or similar to HomeKit from the device configured in the web ui

I saw in homebridge someone used light sensor element to import power measurement. Can this be a good idea?