title: How to control Philips Hue lights using Python script
body: <p>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.</p>
  
  <p>I have already tried thinks like <a href="https://github.com/studioimaginaire/phue" rel="nofollow noreferrer">phue</a> but these libraries are only able to control lights in the same network.</p>
  
  <p>I have tried solving the error by adding this:</p>
  
  <pre class="lang-python prettyprint-override"><code>import logging
  logging.basicConfig()
  </code></pre>
  
  <p>but this didn't work.
  This is the script:</p>
  
  <pre class="lang-python prettyprint-override"><code>from phue import Bridge
  import time
  b = Bridge('192.168.2.3')
  b.connect()
  
  b.get_api()
  
  b.set_light(1, 'on', True)
  </code></pre>
  
  <p>I wanted the lights to turn on using this script, but it gives this error, indicating that it can not find the bridge.</p>
  
  <pre class="lang-none prettyprint-override"><code>No handlers could be found for logger "phue"
  Traceback (most recent call last):
    File "hue.py", line 3, in &lt;module&gt;
      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
  </code></pre>