howanghk / homebridge-ewelink

Homebridge plugin to control Sonoff relays with OEM firmware
MIT License
81 stars 46 forks source link

LAN mode #41

Open rob0101 opened 4 years ago

rob0101 commented 4 years ago

So ewelink has a new LAN mode.

It would be great if someone could figure out how to use this so we don't have to connect to their remote server all the time.

dhutchison commented 4 years ago

I've built a sample plugin which for the few devices I own works with lan mode. Where a device isn't in DIY mode (or doesn't support it), this requires device keys to be retrieved from the ewe link api first (not in my sample - needs to be defined in the config, I got the values from some extra log output I added to this plugin). After this though all control would be lan only.

It is all in Typescript (as that is where I'm more comfortable), but I'm aiming to try porting this across to this plugin. I've only got an S26 and Micro to test this out with (that covers the "plug" and "strip" device types - even if incorrectly).

The branch with all the features is here: https://github.com/dhutchison/homebridge-sonoff-lan/tree/feat/basic-switch-support