starkillerOG / motion-blinds

Python library for interfacing with Motion Blinds
MIT License
22 stars 9 forks source link

Device Type 02000001 for gateway #5

Closed lewisbrown-uk closed 3 years ago

lewisbrown-uk commented 3 years ago

The code is currently using device type 02000002 for the gateway. The API documentation specifies 02000001. I have blinds from another manufacturer, Bloc Blinds, and the controller they supply uses this protocol but device type 02000001. I'm using them with Home Assistant and see the message "DeviceType 02000001 does not correspond to a gateway in parse update function" in the logs when it tries to contact the gateway.

If the library were able to deal with this device type for the gateway, it would make the HA integration more useful as it would support blinds from this manufacturer as well.

starkillerOG commented 3 years ago

I will add the 02000001 as a gateway type to.

Are there any other diffrences in the API?

starkillerOG commented 3 years ago

version 0.4.10 has just been released that adds the 02000001 as a gateway type

lewisbrown-uk commented 3 years ago

Thanks. I’m not sure about other differences as I haven’t got past not being able to recognise the gateway yet. I’ll let you know what I find.

On Sun, 21 Mar 2021 at 11:57, starkillerOG @.***> wrote:

version 0.4.10 has just been released that adds the 02000001 as a gateway type

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/starkillerOG/motion-blinds/issues/5#issuecomment-803564240, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHJHW3AAGNAIB6YFKBOV4PDTEXNLZANCNFSM4ZMRWUKA .

mitchellrj commented 3 years ago

I'm also looking into this @lewisbrown-uk, I haven't received my blinds yet, but have spent a fair bit of time reverse-engineering the app.

@starkillerOG it seems both these products use motors, hubs, and an SDK from Dooya.

lewisbrown-uk commented 3 years ago

The integration has been working perfectly with my blinds after the change to support the gateway device type.

On Sun, 16 May 2021 at 20:20, Richard Mitchell @.***> wrote:

I'm also looking into this @lewisbrown-uk https://github.com/lewisbrown-uk, I haven't received my blinds yet, but have spent a fair bit of time reverse-engineering the app.

@starkillerOG https://github.com/starkillerOG it seems both these products use motors, hubs, and an SDK from Dooya http://www.dooya.com/.

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/starkillerOG/motion-blinds/issues/5#issuecomment-841864342, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHJHW3HOQBLAEHLWPMYXLH3TOALJHANCNFSM4ZMRWUKA .

starkillerOG commented 3 years ago

@mitchellrj, @lewisbrown-uk thanks for the feedback, I will list Bloc Blinds and Dooya as working in the documentation.

lewisbrown-uk commented 3 years ago

The only thing I would add is that auto discovery doesn’t work with my Bloc Blinds hub. Everything seems to work fine once I’ve entered the IP address of the gateway. I haven’t had time to WireShark it to investigate why but will let you know if I find out anything helpful.

Lewis

On Sat, 22 May 2021 at 19:06, starkillerOG @.***> wrote:

@mitchellrj https://github.com/mitchellrj, @lewisbrown-uk https://github.com/lewisbrown-uk thanks for the feedback, I will list Bloc Blinds and Dooya as working in the documentation.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/starkillerOG/motion-blinds/issues/5#issuecomment-846443998, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHJHW3DGXYJ23ENT5IZHCPTTO7XCDANCNFSM4ZMRWUKA .

mitchellrj commented 3 years ago

@lewisbrown-uk how did you get the API key for the bloc blinds hub? Tapping the about page on the android app as with motion blinds doesn't work for me.

lewisbrown-uk commented 3 years ago

Strange - that’s exactly how I got it.

Press on the three horizontal bars at the top left, then the gear icon, then tap the screen five times and it popped up a dialog with the key and the option to copy it. I have version 1.2.1(1023) of the app in case you have anything different.

On Mon, 19 Jul 2021 at 13:13, Richard Mitchell @.***> wrote:

@lewisbrown-uk https://github.com/lewisbrown-uk how did you get the API key for the bloc blinds hub? Tapping the about page on the android app as with motion blinds doesn't work for me.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/starkillerOG/motion-blinds/issues/5#issuecomment-882498486, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHJHW3H6PEYH6ANCWRQHKMDTYQJGDANCNFSM4ZMRWUKA .

lewisbrown-uk commented 3 years ago

Oh, but I’m using the iOS app, maybe that’s the difference.

On Mon, 19 Jul 2021 at 14:34, Lewis Brown @.***> wrote:

Strange - that’s exactly how I got it.

Press on the three horizontal bars at the top left, then the gear icon, then tap the screen five times and it popped up a dialog with the key and the option to copy it. I have version 1.2.1(1023) of the app in case you have anything different.

On Mon, 19 Jul 2021 at 13:13, Richard Mitchell @.***> wrote:

@lewisbrown-uk https://github.com/lewisbrown-uk how did you get the API key for the bloc blinds hub? Tapping the about page on the android app as with motion blinds doesn't work for me.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/starkillerOG/motion-blinds/issues/5#issuecomment-882498486, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHJHW3H6PEYH6ANCWRQHKMDTYQJGDANCNFSM4ZMRWUKA .

haXs commented 2 years ago

@mitchellrj - I was in the same boat, the official Bloc Blinds app doesn't seem to hand out the API key on Android, I was on version 1.1.0729(10).

I was able to recover my API key by installing a packet capture app on my phone and watching some traffic, you will see some connections along with a string starting: accessToken= , its the first 16 characters of this ( including - ), after I put this in the blind controls worked.

starkillerOG commented 2 years ago

@haXs I would be intrested in those packet captures, it might tell me how to retrieve the accessToken automatically for Bloc Blinds. Of course make sure to mask any security information in the captures before posting them here, please change the tokens etc in XXX-XX-XXX or something, but keep the amount of characters visable.

haXs commented 2 years ago

Sure, hopefully this is what you are after - So this was ran on my phone with the app open and me sending an open command to the blind:

POST /userCenter/deviceService/deviceControl HTTP/1.1 Connection: close Content-Type: application/x-www-form-urlencoded Content-Length: 161 Host: connectoreu.shadeconnector.com:8091 Accept-Encoding: gzip User-Agent: okhttp/4.7.2 accessToken=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&mac=XXXXXXXXXXXXXXXX&msgId=XXXXXXXXXXXXXXXXX&deviceType=XXXXXXXX&operation=X

HTTP/1.1 200 OK Server: Apache-Coyote/1.1 Content-Type: application/json;charset=UTF-8 Content-Length: 47 Date: Thu, 23 Dec 2021 17:25:53 GMT Connection: close {"msgId":"20211223172554896","retCode":"20000"}

starkillerOG commented 2 years ago

@haXs thanks for sharing the captures, unfortunately this is communication to the internet servers where they get the token from. I was hoping to get the token directly from the gateway.

Anyway thank you for your help.

richjhart commented 1 year ago

It does (now) provide the API key in the Android app: Three bars > Gear Icon > About > Tap five time on the bloc blinds icon in the middle