I am trying to write a Philips Hue script using python that needs to be able to communicate with the bridge from a different network. I have a VPS that the scripts will be running on.
I have already tried thinks like phue but these libraries are only able to control lights in the same network.
I have tried solving the error by adding this:
import logging
logging.basicConfig()
but this didn't work. This is the script:
from phue import Bridge
import time
b = Bridge('192.168.2.3')
b.connect()
b.get_api()
b.set_light(1, 'on', True)
I wanted the lights to turn on using this script, but it gives this error, indicating that it can not find the bridge.
No handlers could be found for logger "phue"
Traceback (most recent call last):
File "hue.py", line 3, in <module>
b = Bridge('192.168.2.3')
File "/usr/local/lib/python2.7/dist-packages/phue.py", line 628, in __init__
self.connect()
File "/usr/local/lib/python2.7/dist-packages/phue.py", line 751, in connect
self.register_app()
File "/usr/local/lib/python2.7/dist-packages/phue.py", line 705, in register_app
response = self.request('POST', '/api', registration_request)
File "/usr/local/lib/python2.7/dist-packages/phue.py", line 660, in request
raise PhueRequestTimeout(None, error)
phue.PhueRequestTimeout