but with filezilla I can change it anyway I want but it does not help a bit.
Also made an Sh script on and off that calls the python script on but also, no joy.

Moderator: leecollings
Can't help you with scripting but.. the HS100's just stopped working through domoticz, get an error each time I want to switch them. Strange thing is, I can still switch from the command line...doaerts wrote:Hi guys
I'm trying to get the python script running (on Windows), but no luck so far...
When using python 3, I get the error message:
"could not connect to host <ip> 9999 "
I also tried using python 2.7, which gives me the error message:
"AttributeError: 'module' objest has no attribute 'inet_pton'"
I'm not a Python expert, could anyone point me in the right direction?
@MikeFMikeF wrote:I have now created a python script to send energy data from the TP-Link HS110 Smart Plug to Domoticz:
Create a virtual sensor with sensor type 'Electric (Instant+Counter)', and insert its IDx and the IP addresses of your HS110 and Domoticz server in the script. Then set up a crontab entry to run the script every 5 or 10 minutes, as you prefer.
- Spoiler: show
It will appear in the Utilities page - here's an example:
@reddoreddo wrote:Can't help you with scripting but.. the HS100's just stopped working through domoticz, get an error each time I want to switch them. Strange thing is, I can still switch from the command line...doaerts wrote:Hi guys
I'm trying to get the python script running (on Windows), but no luck so far...
When using python 3, I get the error message:
"could not connect to host <ip> 9999 "
I also tried using python 2.7, which gives me the error message:
"AttributeError: 'module' objest has no attribute 'inet_pton'"
I'm not a Python expert, could anyone point me in the right direction?
Changed nothing, updated nothing, just happened..
I've never used authorisation on Domoticz, so don't know, I'm afraid - try without?rebelo wrote: Getting though as 401 error even when run from the command line.
Script copied/ edited via nano and chmoded a+x.
Believe it is something regarding authorization but can not find solution.
Any hint from You?
Tks but what i ment by authorization was abt the error, 401, i get in the command line.MikeF wrote:I've never used authorisation on Domoticz, so don't know, I'm afraid - try without?rebelo wrote: Getting though as 401 error even when run from the command line.
Script copied/ edited via nano and chmoded a+x.
Believe it is something regarding authorization but can not find solution.
Any hint from You?
~/Desktop $ python tplink-smartplug.py -c on
Traceback (most recent call last):
File "tplink-smartplug.py", line 63, in <module>
power = jsonData['emeter']['get_realtime']['power']
KeyError: 'get_realtime'
Can you explain how to do that? Because when I create the virtual sensor and put the script in /script/ I don't know what else to do.MikeF wrote:I have now created a python script to send energy data from the TP-Link HS110 Smart Plug to Domoticz:
Create a virtual sensor with sensor type 'Electric (Instant+Counter)', and insert its IDx and the IP addresses of your HS110 and Domoticz server in the script. Then set up a crontab entry to run the script every 5 or 10 minutes, as you prefer.
- Spoiler: show
It will appear in the Utilities page - here's an example:
Users browsing this forum: No registered users and 1 guest