I’m guessing this plugin is long dead and won’t be getting a Python 3 update? I’d actually completely forgotten I had one of these which is still in use.. testament to how reliable it’s been I guess!
Sent from my iPhone using Tapatalk Pro
<key>ServerApiVersion</key>
<string>2.0</string>
<key>ServerApiVersion</key>
<string>3.0</string>
/Frameworks/Python.framework/Versions/3.10/lib/python3.10/telnetlib.py", line 288, in write
type: 'in <string>' requires string as left operand, not bytes
8 Channel Network Relay Error plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)
8 Channel Network Relay Error Error in plugin execution runConcurrentThread:
File "plugin.py", line 129, in runConcurrentThread
File "plugin.py", line 320, in set_device_states
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/telnetlib.py", line 288, in write
type: 'in <string>' requires string as left operand, not bytes
8 Channel Network Relay Error plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)
8 Channel Network Relay Error Error in plugin execution runConcurrentThread:
File "plugin.py", line 129, in runConcurrentThread
File "plugin.py", line 320, in set_device_states
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/telnetlib.py", line 288, in write
type: 'in <string>' requires string as left operand, not bytes
8 Channel Network Relay Error plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)
8 Channel Network Relay Error Error in plugin execution runConcurrentThread:
File "plugin.py", line 129, in runConcurrentThread
File "plugin.py", line 320, in set_device_states
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/telnetlib.py", line 288, in write
type: 'in <string>' requires string as left operand, not bytes
import requests
myURL1 = "http://admin:1Dc333@192.168.0.61/relay_en.cgi?relayoff1=off"
myURL2 = "http://admin:1Dc333@192.168.0.61/relay_en.cgi?relayoff2=off"
myURL3 = "http://admin:1Dc333@192.168.0.61/relay_en.cgi?relayoff3=off"
myURL4 = "http://admin:1Dc333@192.168.0.61/relay_en.cgi?relayon4=on"
myURL5 = "http://admin:1Dc333@192.168.0.61/relay_en.cgi?relayon5=on"
myURL6 = "http://admin:1Dc333@192.168.0.61/relay_en.cgi?relayoff6=off"
myURL7 = "http://admin:1Dc333@192.168.0.61/relay_en.cgi?relayoff7=off"
myURL8 = "http://admin:1Dc333@192.168.0.61/relay_en.cgi?relayoff8=off"
requests.get(myURL1)
requests.get(myURL2)
requests.get(myURL3)
requests.get(myURL4)
requests.get(myURL5)
requests.get(myURL6)
requests.get(myURL7)
requests.get(myURL8)
FlyingDiver wrote:That should work, but the better option for Python3 is:
- Code: Select all
import requests
myURL1 = "http://admin:1Dc333@192.168.0.61/relay_en.cgi?relayoff1=off"
myURL2 = "http://admin:1Dc333@192.168.0.61/relay_en.cgi?relayoff2=off"
myURL3 = "http://admin:1Dc333@192.168.0.61/relay_en.cgi?relayoff3=off"
myURL4 = "http://admin:1Dc333@192.168.0.61/relay_en.cgi?relayon4=on"
myURL5 = "http://admin:1Dc333@192.168.0.61/relay_en.cgi?relayon5=on"
myURL6 = "http://admin:1Dc333@192.168.0.61/relay_en.cgi?relayoff6=off"
myURL7 = "http://admin:1Dc333@192.168.0.61/relay_en.cgi?relayoff7=off"
myURL8 = "http://admin:1Dc333@192.168.0.61/relay_en.cgi?relayoff8=off"
requests.get(myURL1)
requests.get(myURL2)
requests.get(myURL3)
requests.get(myURL4)
requests.get(myURL5)
requests.get(myURL6)
requests.get(myURL7)
requests.get(myURL8)
Users browsing this forum: No registered users and 1 guest