Get Octoprint PSUControl running with Philips Hue SmartPlug

Hey there,

I couldn't find an existing solution for this, so it took me some time to figure out how to use a SmartPlug connected to Philips Hue with the PSUControl plugin.
Works well on my Octopi. Hope this is helpful :slight_smile:

First, create a user on your Hue Bridge and find out the light id of you SmartPlug, as described here:
https://developers.meethue.com/develop/get-started-2/

Replace the variables in the URLs with your data.
For example, if your Hue Bridges IP is 192.168.178.20, your User ID 1028d66426293e821ecfd9ef1a0731d and the light ID of your SmartPlug 10, your URL will be

http://192.168.178.20/api/1028d66426293e821ecfd9ef1a0731df/lights/10/state

Set up the plugin like this:
Commands are one line each, though they are displayed here with a line break! Copy the whole entry.

Switching/Switching Method -> System Command

On System Command

curl -X PUT -d '{"on":true}' http://<HUE_BRIDGE_IP>/api/<HUE_USER_ID>/lights/<LIGHT_ID>/state

Off System Command

curl -X PUT -d '{"on":false}' http://<HUE_BRIDGE_IP>/api/<HUE_USER_ID>/lights/<LIGHT_ID>/state

Sensing/Sensing Method -> System Command

Sensing System Command (no /state at the end!)

curl -silent -X GET http://<HUE_BRIDGE_IP>/api/<HUE_USER_ID>/lights/<LIGHT_ID>/ | grep '"on":true'

Polling Interval -> 10 secs seems to be enough

1 Like