SignalK eWeLink plugin
part of MaracaiboSonoff and eWeLink switches as native SignalK — driven direct over the LAN when they are local, through the cloud when they are not.
I have Sonoff relays and metering plugs doing real work, and I wanted them on the SignalK bus as first-class switches rather than behind an MQTT bridge. This plugin does that: a device the server can see on the LAN is driven direct and offline, one it cannot see goes through the eWeLink cloud, and it re-routes on its own as devices come and go. State is pushed, not polled — LAN mDNS plus the eWeLink WebSocket — so a switch thrown from the phone app or by a physical button shows up immediately. Metering plugs publish power, voltage and current alongside their state, and a SignalK PUT to the switch’s .state path throws the relay.
The part worth knowing before you install it: eWeLink needs a free developer account, not your phone-app login, because that is what supplies the device list and the LAN keys — you need it even for LAN-only use. The plugin does the whole OAuth exchange itself now, from the admin page, and keeps tokens and caches in SignalK’s plugin data directory, so an upgrade no longer wipes your authorisation. It degrades rather than dies: no credentials, no authorisation, no devices, a corrupt cache or a half-filled config row all start cleanly and say what is missing in the status line instead of failing quietly.
Under the hood it is the SignalK Python-plugin pattern — a thin index.js spawning a Python worker that owns the LAN crypto, discovery and WebSocket, piping deltas back. On npm as signalk-ewelink (1.0.5) and in the SignalK Appstore: github.com/dennismilton/signalk-ewelink · npm signalk-ewelink.
- Rewritten on canonical plugin scaffolding
- Tokens survive upgrades; docs for real users
- eWeLink bridge becomes a self-contained plugin
No posts from this project yet — they'll gather here as they publish.