When I try to run the script from where it is now (a location from which I can run the script fine in Terminal), I get the following error:
Action Collection Error Script file doesn't exist: /usr/local/bin/gkmain_info.sh
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.
ChopOMatic wrote:And BTW, when I copy gkmain_info.sh to /users/chopomatic/ and try to run it from there, the script generates an error that it can't call tplink_smartplug.py. (Which is in /usr/local/bin/
/usr/local/bin/tplink_smartplug.py ...
| grep relay_state | cut -c25
ChopOMatic wrote:Focusing first on getting 'grep' and 'cut' working right...
The code as suggestedis returning the 25th character of the entire results string, ie. "e"
- Code: Select all
| grep relay_state | cut -c25
111111111122222222223
123456789012345678901234567890
"relay_state": 0,
"relay_state": 0,
berkinet$ !cut -c25 <tmpfil
2
5
0
e
/usr/local./bin/tplink_smartplug.py -t 10.0.0.26 -c info | grep relay_state | cut -c29
{"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":-69,"led_off":0,"latitude":30.157556,"longitude":-95.501769}}}
ChopOMatic wrote:Ok. we are getting somewhere. I have added a json pretty printer to the commands (pipeline) to make the output easier to parse (I.e. make it like the output you originally posted). I also added a bit (tr) at the end to remove the line-ending character so Indigo will correctly interpret the 0 or 1 as a boolean. Note the spacing around the pipe characters "|" is just for readability and is not required.Latest: I edited the tplink_smartplug.py script to get rid of the SENT/RECEIVED stuff. Now it returns exactly this:
- Code: Select all
{"system":{"get_sysinfo":{"err_code":0,"sw_ver":"1.2.5 Build 171206 ...
/usr/local./bin/tplink_smartplug.py -t 10.0.0.26 -c info | json_pp | grep relay_state | cut -c26 | tr -d "\n"
/usr/local./bin/tplink_smartplug.py -t 10.0.0.26 -c info | sed -e "s/Received..//" | json_pp | grep relay_state | cut -c26 | tr -d "\n"
ChopOMatic wrote:Well, it is odd the Run Shell Script dialog box does not error on save if it can't find there file? Are you on the same machine as the Indigo server. In other words, are you using screen-sharing to access the Indigo machine?...My last remaining problem can be seen in this screenshot. Not sure why Indigo is claiming the shell script doesn't exist.
Users browsing this forum: No registered users and 1 guest