vroy / python-sengled-client

A simple Python client to control Sengled [light] accessories.
MIT License
23 stars 4 forks source link

WiFi Lights not found #2

Open SlimeQ opened 4 years ago

SlimeQ commented 4 years ago

login returns this:

{'ret': 0, 'msg': 'success', 'jsessionid': 'f30831c4-62df-496c-ba4f-77fe18ebc0d2', 'appServerAddr': 'https://us-elements.cloud.sengled.com:9000/zigbee/', 'ucenterAddr': 'https://us-ucenter.cloud.sengled.com:443/user/', 'gret': 0, 'serverVersionMin': '3', 'serverVersionNow': '3', 'nick_name': '<my email>, 'user_id': <my user id>}

but get_device_details() returns an empty deviceInfos

I only have wifi lights on my account, wondering if that has something to do with it.

vroy commented 4 years ago

I think you might be right. I unfortunately only have classic bulbs that work with the sengled hub and I'm not able to test wifi lights.

SlimeQ commented 4 years ago

I just used mitmproxy to intercept network traffic from the android app and it appears as though wifi lights go through the "life2" server instead of elements. This url lists them: https://life2.cloud.sengled.com/life2/device/list.json

I'm not sure if the json format returned is the same as zigbee lights (because I don't have any). When I actually perform an action it seems to connect via https://us-mqtt.cloud.sengled.com/mqtt and then open a socket connection. Might be a dead end as far as reverse engineering the thing

vroy commented 4 years ago

This line has a copy of the details of a classic light if you want to compare: https://github.com/vroy/python-sengled-client/blob/master/sengled/sengled.py#L56

Yeah, I'm definitely not sure how to go about going through mqtt for actions. If you find anything more on that, I'll be open to contributions. Good luck!

smitp415 commented 3 years ago

I just used mitmproxy to intercept network traffic from the android app and it appears as though wifi lights go through the "life2" server instead of elements. This url lists them: https://life2.cloud.sengled.com/life2/device/list.json

I'm not sure if the json format returned is the same as zigbee lights (because I don't have any). When I actually perform an action it seems to connect via https://us-mqtt.cloud.sengled.com/mqtt and then open a socket connection. Might be a dead end as far as reverse engineering the thing

Have you made any progress on this? I'm just getting started trying to work on this so any help is appreciated. When I look into the life2 device list, this is the response I get

{'ret': '100', 'msg': 'not logged in'}
vroy commented 3 years ago

I have not personally made any progress on this, sorry.

Oricul commented 3 years ago

Came across this while trying to write a script to work with Huginn. It's not much to add, but at the very least, trying to log into life2 with the same headers is a no-go. Can't even identify if the headers are correct myself as my Android version is too high for self-signed certificates to be used to intercept traffic...