merdok / homebridge-miot

Homebridge plugin for devices supporting the Xiaomi miot protocol
MIT License
386 stars 61 forks source link

cuco.plug.sp5 (Gosund Smart Power Strip) Unable to connect. #229

Closed minhquan313 closed 2 years ago

minhquan313 commented 2 years ago

I just bought a gosund smart socket, even though it supports connecting to homebridge, it has problems when connecting again. I use the product completely normally on the mi home app. But when connecting to homebridge, there is a problem but the picture is described below. I'm sure the ip and token are correct

Screen Shot 2022-02-21 at 20 49 57

Thanks for reading the post

merdok commented 2 years ago

Hi,

the device is marked as not micloud required but I suspect that it might be wrong. The error indicates that this might be the case. You would need to add a micloud section into the config for your device and set the forceMiCloud property to true there. Also you need to specify your micloud credentials. Please try that out and let me know if that works and I will later correct that in the device definition.

minhquan313 commented 2 years ago

I tried but unfortunately it still has the old error..

Screen Shot 2022-03-05 at 16 37 58
merdok commented 2 years ago

What does the log say after you set up the micloud connection?

joyzainzy commented 2 years ago

[4/2/2022, 11:45:46 AM] [miot] [排插] Successfully created a Outlet device! It is a Gosund Smart Power Strip. [4/2/2022, 11:45:46 AM] [miot] [排插] Initializing accessory! [4/2/2022, 11:45:46 AM] [miot] [排插] Accessory successfully initialized! [4/2/2022, 11:45:46 AM] [miot] [排插] Registering 1 accessories! [4/2/2022, 11:45:46 AM] [miot] [排插] Everything looks good! Initiating property polling! [4/2/2022, 11:45:46 AM] [miot] [排插] Device found: cuco.plug.sp5 [4/2/2022, 11:45:46 AM] [miot] [排插] Setting up miot device! [4/2/2022, 11:45:46 AM] [miot] [排插] Device requires MiCloud! Trying to connect! [4/2/2022, 11:45:47 AM] [miot] [排插] Successfully connected to MiCloud! [4/2/2022, 11:45:47 AM] [miot] [排插] Getting device info from MiCloud! [4/2/2022, 11:45:47 AM] [miot] [排插] Device setup finished! Miot device ready! [4/2/2022, 11:45:47 AM] [miot] [排插] Connected to device: cuco.plug.sp5 [4/2/2022, 11:45:47 AM] [miot] [排插] Doing initial property fetch. [4/2/2022, 11:45:49 AM] [miot] [排插] Starting property polling. [4/2/2022, 11:46:31 AM] [miot] [排插] Poll failed 4 times in a row! Stopping polling and trying to reconnect! Reason: FetchError: network timeout at: https://api.io.mi.com/app/miotspec/prop/get

joyzainzy commented 2 years ago

360截图18720119788190

merdok commented 2 years ago

Seems the device won't allow connection from outside. Not sure why you are getting timeouts...

joyzainzy commented 2 years ago

I try to use MI clound connection and local connection, both will fail to connect, and the device will restart infinitely, uncontrollable

merdok commented 2 years ago

Without me having access to that physical device there is nothing really i can do. From your feedback it seems to me that the device will not allow remote control...

fbi007130 commented 2 years ago

the same issue....

fbi007130 commented 2 years ago

How to disable the unnecessary service for sp5 so that the outlet could be lighter in the connection pressure。

fbi007130 commented 2 years ago

While I remove indicator light service from js ,the issue seem to be fixed. `diff ./lib/node_modules/homebridge-miot/lib/modules/outlet/devices/cuco.plug.sp5.js ./lib/node_modules/homebridge-miot/lib/modules/outlet/devices/cuco.plug.sp5.js.bak 46a47

this.createServiceByString('{"siid":10,"type":"urn:cuco-spec:service:indicator-light:00007806:cuco-sp5:3","description":"indicator-light"}');

58a60,63 this.addPropertyByString('indicator-light:on', '{"siid":10,"piid":1,"type":"urn:cuco-spec:property:on:00000001:cuco-sp5:3","description":"on","format":"bool","access":["read","notify","write"]}'); this.addPropertyByString('indicator-light:mode', '{"siid":10,"piid":2,"type":"urn:cuco-spec:property:mode:00000002:cuco-sp5:3","description":"mode","format":"bool","access":["read","notify","write"]}'); this.addPropertyByString('indicator-light:start-time', '{"siid":10,"piid":3,"type":"urn:cuco-spec:property:start-time:00000003:cuco-sp5:3","description":"start-time","format":"uint16","access":["read","notify","write"],"unit":"minutes","valueRange":[0,1440,1]}'); this.addPropertyByString('indicator-light:end-time', '{"siid":10,"piid":4,"type":"urn:cuco-spec:property:end-time:00000004:cuco-sp5:3","description":"end-time","format":"uint16","access":["read","notify","write"],"unit":"minutes","valueRange":[0,1440,1]}');`

merdok commented 2 years ago

Oh, that is interesting. Did you update your outlet to the latest firmware? It might be that this service was added recently via a software update.

fbi007130 commented 2 years ago

Oh, that is interesting. Did you update your outlet to the latest firmware? It might be that this service was added recently via a software update.

Verion:2.1.3_0013.The outlet is delivered yesterday, so I do not know whether it has been upgrade.

merdok commented 2 years ago

You should be able to check for firmware updates in the xiaomi home app or the dedicated outlet app.

fbi007130 commented 2 years ago

Sure,it is the latest version in xiaomi home app.

merdok commented 2 years ago

Ok, interesting... not sure why that service is in the spec but does not actually work...

merdok commented 2 years ago

As of version 1.2.0 services are of devices are initially reduced to minimum which should help here out!