Closed galaxydpw closed 4 years ago
Hi,
I also have some issues with SONOFF MICRO - 5V WIRELESS USB SMART ADAPTOR. Link: https://www.itead.cc/sonoff-micro-5v-usb-smart-adaptor.html
To elaborate on this:
1) It adds the device with no issues to homebridge and to homekit but it does not work.
2) If I toggle the switch from homebridge or homekit it toggles but does not change the state of the physical device. i.e device stays in whatever state it currently is.
3) If I toggle the switch from the eWeLink app device changes state as normal but homebridge logs problems see below. Not sure why it is trying to add 4ch when it's only 1 micro switch.
Same issue here :(
This is just a note that I've got a bit of tidying up to do before submitting a PR, but I've got it to work with a few changes to the plugin. Half these changes are additional debug logging. It does report from the API as a 4 channel device, with only channel 1 actually controlling the switch state. It doesn't feel right showing 3 useless devices in Home.
I'll likely take another look at this over the next few days to see if I can tidy it up.
A diff of my current changes is below.
index 09dfeb3..dcbbd00 100644
--- a/index.js
+++ b/index.js
@@ -1034,6 +1034,8 @@ eWeLink.prototype.getPowerState = function (accessory, callback) {
this.webClient.get('/api/user/device?' + this.getArguments(), function (err, res, body) {
+ platform.log(body)
+
if (err) {
if ([503].indexOf(parseInt(res.statusCode)) !== -1) {
// callback('An error was encountered while requesting a list of devices to interrogate power status for your device');
@@ -1081,6 +1083,8 @@ eWeLink.prototype.getPowerState = function (accessory, callback) {
if (device.deviceid === deviceId) {
+ platform.log(device.params)
+
if (device.online !== true) {
accessory.reachable = false;
platform.log("Device [%s] was reported to be offline by the API", accessory.displayName);
@@ -2062,6 +2066,7 @@ eWeLink.prototype.getDeviceTypeByUiid = function (uiid) {
56: "RGB_BALL_LIGHT_4",
57: "MONOCHROMATIC_BALL_LIGHT",
59: "MEARICAMERA",
+ 77: "MICRO",
1001: "BLADELESS_FAN",
1002: "NEW_HUMIDIFIER",
1003: "WARM_AIR_BLOWER"
@@ -2079,6 +2084,7 @@ eWeLink.prototype.getDeviceChannelCountByType = function (deviceType) {
SOCKET_POWER: 1,
GSM_SOCKET: 1,
POWER_DETECTION_SOCKET: 1,
+ MICRO: 4,
SOCKET_2: 2,
GSM_SOCKET_2: 2,
SWITCH_2: 2,
Hi dhutchison, Thank you for having a look at it, i have no idea how to fix it or make it work. Looking forward to having it work finally. Let us know please when you manage it. Cheers
I have merged the pull request from dhutchison and released a new version 0.1.21. Thank you.
Thank you so much guys i just update, it works. it added all 4 channels and only channel 1 is controlling it as dhutchison mentioned in previous message. great job.
It just fails with sonoff micro. It is populated into homekit, but with an error icon