Questions about hardware that can be controlled by Indigo (but not through the interfaces and plugins listed). If Indigo doesn't support some bit of hardware you're interested in, and you don't find a 3rd Party Plugin for it, add it to this forum. Be sure to include links to as much information as you can find about it.
Note: adding it here does not mean we're going to add it - in fact it's possible one of our 3rd party developers may decide to write a plugin for it. We add hardware/features based on a lot of different factors beyond just having a request for it.
Usage
./tplink-smartplug.py -t <ip> [-c <cmd> || -j <json>]
kg23 wrote:Dumb Question. How do you determine the ip address of the TP-Link switch for use in the command-line script?
- Code: Select all
Usage
./tplink-smartplug.py -t <ip> [-c <cmd> || -j <json>]
{
"system": {
"get_sysinfo": {
"err_code": 0,
"sw_ver": "1.2.5 Build 171206 Rel.085954",
"hw_ver": "1.0",
"type": "IOT.SMARTPLUGSWITCH",
"model": "HS110(US)",
"mac": "50:C7:BF:00:40:51",
"deviceId": "8006E9DC881A5D7A3227882E4D3B0B7616C73011",
"hwId": "60FF6B258734EA6880E186F8C96DDC61",
"fwId": "00000000000000000000000000000000",
"oemId": "FFF22CFF774A0B89F7624BFC6F50D5DE",
"alias": "GK",
"dev_name": "Wi-Fi Smart Plug With Energy Monitoring",
"icon_hash": "",
"relay_state": 0,
"on_time": 0,
"active_mode": "none",
"feature": "TIM:ENE",
"updating": 0,
"rssi": -65,
"led_off": 0,
"latitude": 30.157556,
"longitude": -95.501769
}
}
}
ChopOMatic wrote:How do I extract the value for just the relay_state?
results['system']['get_sysinfo']['relay_state']
#!/bin/sh
python tplink_smartplug.py -t 10.0.0.26 -c info
ChopOMatic wrote:All I want to do is populate an ON or OFF status in Indigo.
#import json
# do the http request
reply = requests.get('python tplink_smartplug.py -t 10.0.0.26 -c info')
# convert the text result to Python dictionary
data = json.loads(result_json)
# extract the state
state = data['system']['get_sysinfo']['relay_state']
# update the variable (put in the correct variable ID)
indigo.variable.updateValue(1234567, value=state)
Users browsing this forum: No registered users and 2 guests