howanghk / homebridge-ewelink

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

Issues with latest build. [Error: Parsing error : Unexpected token < in JSON at position 0, body= <html> <head><title>503 Service Temporarily Unavailable</title></head> <body bgcolor="white"> #101

Closed warrendt closed 4 years ago

warrendt commented 4 years ago

Have refreshed and killed cached accessories.

[6/8/2020, 14:40:33] [eWeLink] An error was encountered while requesting a list of devices while interrogating power status. Error was [Error: Parsing error : Unexpected token < in JSON at position 0, body=

503 Service Temporarily Unavailable

503 Service Temporarily Unavailable


openresty
at Object.parseBody (/usr/lib/node_modules/homebridge-ewelink-max/node_modules/request-json/main.js:67:19)
at Request._callback (/usr/lib/node_modules/homebridge-ewelink-max/node_modules/request-json/main.js:148:26)
at Request.self.callback (/usr/lib/node_modules/homebridge-ewelink-max/node_modules/request/request.js:185:22)
at Request.emit (events.js:310:20)
at Request.<anonymous> (/usr/lib/node_modules/homebridge-ewelink-max/node_modules/request/request.js:1161:10)
at Request.emit (events.js:310:20)
at IncomingMessage.<anonymous> (/usr/lib/node_modules/homebridge-ewelink-max/node_modules/request/request.js:1083:12)
at Object.onceWrapper (events.js:416:28)
at IncomingMessage.emit (events.js:322:22)
at endReadableNT (_stream_readable.js:1187:12)]
warrendt commented 4 years ago

2-3 Gangs are being picked up as fans.

Snowblu commented 4 years ago

Same error as above as well as Fan accessories (2 Gang shows one switch as light and one switch as fan). Both accessories however do successfully turn on switches.

bwp91 commented 4 years ago

The issue I found was with this change: https://github.com/howanghk/homebridge-ewelink/commit/89a17456bee405fd2fcfd10889dee49882660d37 Where the || deviceToAdd.extra.extra.model === "PSF-B04-GL" has been added. In my case I don't have any sonoff fans so deleting this change is sufficient for me.

howanghk commented 4 years ago

Hi @warrendt The 503 error is returned by eWeLink server, it means their service is temporarily unavailable, this have nothing to do with this plugin.

bwp91 commented 4 years ago

I had the same error until I deleted the code i mentioned above

warrendt commented 4 years ago

Hi @warrendt The 503 error is returned by eWeLink server, it means their service is temporarily unavailable, this have nothing to do with this plugin.

Happy with that. It was just in the logs I pasted. However since adding the parsing in for additional fan devices. My 2-3 gangs don’t work.

In previous releases. Fan device causes complete crash. I will remove the new fan device support as the other user said and see what happens.

warrendt commented 4 years ago

I had the same error until I deleted the code i mentioned above

Thanks for the advise. I do have a fan01 device that’s was causing crashes before this release. I will check if it pops up after making this change.

Thanks again

bwp91 commented 4 years ago

Hi @warrendt The 503 error is returned by eWeLink server, it means their service is temporarily unavailable, this have nothing to do with this plugin.

Happy with that. It was just in the logs I pasted. However since adding the parsing in for additional fan devices. My 2-3 gangs don’t work.

In previous releases. Fan device causes complete crash. I will remove the new fan device support as the other user said and see what happens.

Try the new release (0.1.24) see if that works