Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for RE270K? #15

Open
unm4sk1g opened this issue Sep 28, 2017 · 11 comments
Open

Support for RE270K? #15

unm4sk1g opened this issue Sep 28, 2017 · 11 comments

Comments

@unm4sk1g
Copy link

I'm wondering if this Wi-FI Range Extender + SmartPlug is supported? Using setPowerState doesn't work. Also ._type property is device and alot of stuff differs from standard plug or bulb.

@plasticrake
Copy link
Owner

Can you run the hs100-api details <ip>(the device's IP) and paste the output? If I keep some example data I can add support.

@unm4sk1g
Copy link
Author

unm4sk1g commented Oct 1, 2017

Will do it tomorrow. Also, what's the minimal version of node required for this library to work?

@plasticrake
Copy link
Owner

6.5, as specified in the package.json

@plasticrake plasticrake self-assigned this Oct 1, 2017
@unm4sk1g
Copy link
Author

unm4sk1g commented Oct 2, 2017

Is there something in the lib that requires 6.5 or? Since NAS devices don't support node v6. Also, my colleague took the Wi-Fi Range Extender home so I'll tell him to send the details tonight and I'll put them here.

@plasticrake
Copy link
Owner

Now that I'm using babel on this project I may be able to support v4 with minimal changes. I'll see what I can do.

@unm4sk1g
Copy link
Author

unm4sk1g commented Oct 3, 2017

{ sysInfo: { plug: { feature: 'TIM', relay_status: 'ON', on_time: 285025, next_action: { type: -1 } }, err_code: 0, 'rangeextender.wireless': { w5g_client_count: 0, w2g_uplink_time: 128975, w5g_uplink_enabled: true, w5g_rssi: -256, w5g_uplink_time: 0, w2g_mac: '50:C7:BF:C8:5E:DE', w2g_uplink_enabled: true, w2g_downlink_enabled: true, w5g_downlink_enabled: true, w2g_client_count: 0, w5g_uplink_connected: false, w2g_rssi: -73, w5g_mac: '50:C7:BF:C8:5E:DD', w2g_uplink_connected: true }, system: { ethernet_mac: '50:C7:BF:C8:5E:DE', type: 'IOT.RANGEEXTENDER.SMARTPLUG', oemId: 'A4551BD7CF274B28C532A79E87B9FFB5', icon_hash: '', system_time: 1506983062, updating: false, deviceId: '801773997DCEC2F8134A9673D74C296318C860BA', sw_ver: '1.1.8 Build 20170317 rel.37472', hwId: '5AC4CF9E3183C16825EB28BC3C27059C', longitude: 17.79082, led_status: 'ON', model: 'RE270K(EU)', hw_ver: '1.0.0', latitude: 43.351783, alias: 'Hi-fi', dev_name: 'AC750 Wi-Fi Range Extender with Smart Plug' } }, cloudInfo: { err_msg: 'method not support', err_code: -1 }, consumption: { err_msg: 'method not support', err_code: -1 }, scheduleNextAction: { err_msg: 'method not support', err_code: -1 } }

There's the data for RE270K

@plasticrake
Copy link
Owner

plasticrake commented Oct 4, 2017

I was able to configure babel and get this working on node 4.8 (will release a version of hs100-api soon). It looks like TPLINK keeps slightly tweaking the API for each device, I would need to know the commands that are sent to control it.

This is how to control HS* devices:
{"system":{"set_relay_state":{"state":1)}}}}

I noticed that RE270K they have moved sys_info.system.relay_state to sys_info.plug.relay_status. Without having a dump of the network traffic its hard for me to know which commands to send to control it.

You could try running different versions of the command to see if any work:
hs100-api send <ip> '{"system":{"set_relay_status":{"state":1)}}}'
hs100-api send <ip> '{"plug":{"set_relay_status":{"state":"ON")}}}'
hs100-api send <ip> '{"plug":{"set_relay_state":{"state":1)}}}'
hs100-api send <ip> '{"plug":{"set_relay_state":"ON"}}'
hs100-api send <ip> '{"system":{"plug":{"set_relay_state":{"state":1)}}}}}'
hs100-api send <ip> '{"system":{"plug":{"set_relay_status":{"state":1)}}}}}'
hs100-api send <ip> '{"system":{"plug":{"set_relay_status":{"status":1)}}}}}'
hs100-api send <ip> '{"system":{"plug":{"set_relay_status":{"status":"ON")}}}}}'
etc...

If you find anything let me know!

If you or anyone else with access to that model could dump the traffic I can add updates to support it. Here's an example: https://github.com/softScheck/tplink-smartplug

@plasticrake
Copy link
Owner

I used your sysinfo and my simulator to try to mimic your device and spy on the Kasa app traffic. One thing this device does different is Kasa tries to login to the router. That is where I hit a roadblock.

  • Kasa sends out a discovery message UDP broadcast port 9999
  • RE270k responds with sysinfo (same as other devices)
  • In Kasa I see the device, when I try to add it asks for the "admin password" (other devices don't require this)
  • I type in a password and submit.
  • Kasa connects to RE270k HTTPS port 10433 and POSTs to /data/LINKIE.json with {"smartlife.common.system":{"get_sysinfo":{}}} (but "tplink" encrypted), this is not something done with the other plugs/bulbs.
  • Kasa shows "Your admin password is incorrect"

So this is where I'm stuck. I'm not sure what Kasa is expecting when it sends that POST. If I knew whatever authorization its doing I could maybe replicate.

If anyone has any more info please let know!

@unm4sk1g
Copy link
Author

My colleague (who owns this model) is out of country until Wednesday, so nothing until then.

@DarwinsBuddy
Copy link

I tried also to reach it, but in another way.
Assume 192.168.1.1 is the ip address of your RE270K

  1. I first configured the plug via the Kasa app with particular password. Afterwards I logged in via /data/json.htmland observed the developer console's network log of chrome, where I found the provided formdata and my password but somehow encrypted.

  2. POST http://192.168.1.1/data/login.json
    with following Header:
    Content-Type:application/x-www-form-urlencoded
    and following Form-Data:

operation:login
encoded: admin:<pw-somehow-encrypted>
nonce:
  1. In the response you get a Cookie, which may help you contact the endpoint anew, but this time to get the specs or turn the plug on/off.

Unfortunately, I have not more information than that. Maybe someone else has an idea how to contact the smartplug endpoint (different from the webinterface for configuring the wifi extender).

@DaveGut
Copy link

DaveGut commented Feb 7, 2019

The only way I could get it to work in SmartThings was to use IFTTT to turn on / off and the standard commands to get the status. Better than just using IFTTT (since you get a return status). I am still looking for a full solution (I want it for the Hubitat Enviroment UDP control.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants