Switching off using Osram

Hi,

I am running OctoPrint using my Raspberry Pi 3... I do like receiving pushover messages after print jobs are finished.

But, it would be nice to turn off the power of my Ender 3 automatically. I already read a few ways to do this.

At the moment I am looking for a solution to turn off the power using an Osram Smart+, which is connected to a Philips hue bridge version 2.

Some smarthome devices are running in my network, too, like ioBroker and homebridge.

Are there any solutions for this?

Is there a Web-API for controlling the Osram-Plug? Directly or over ioBroker or HueBridge?

Then you can use this approach: https://discourse.octoprint.org/t/delayed-shutdown-after-finished-print-possible/5628/5?u=ollisgit

BR
Olli

If it does have an api call, you could also use the ShutdownPrinter plugin and all changes can be made from the web UI. The approach is a little easier for the non-techie as you don't have to deal with bash scripts, etc.
Specifically this section is what you're looking to set.

The Osram Smart Plug is connected to the Philips hue bridge... so, I think it has to be an hue command for switching a bulb...

Does anyone know the command ?

Is there any update on this? I'd also love to use my Osram Smart Plug to automatically shut down the printer, especially since the TP-Link plug is twice as expensive.
Is this maybe possible using OpenHAB (which I'm also running on my network)?

Hi,

Since I am new I have to split my post because of too many pictures.
unfortunately i've only been using octoprint for two weeks, but i hope that my contribution can still help.

I did it with the OSRAM SMART+ plug and the HUE-Bridge.
A hint from me, if you use more than one OSRAM plug with Philips HUE, gives speaking names for each one, so you know which one it is.
My plug for the 3D printer is called -> Ender3

Well, it's quite simple.

Enter http://[IP-HUE-BRIDGE]/debug/clip.html into your trusted browser.
In my case: http://192.168.178.29/debug/clip.html

You come to a website that looks like this:

Create user:
If you haven't created a user for the HUE-API yet, you have to do the following:
See next post

In the field URL you have to change the value to /api.
in the field Message Body with {"devicetype": "[application_name]#[devicename]"} fill.
Example: {"devicetype": "office#ender_3_admin"}

Before the statemant is executed with the POST button, you have to press the link button on the HUE-bridge.
After you hit the link button you must execute this command within 30 seconds.
Otherwise you get the answer that the link button was not printed.

If you have done everything right, you get a successful response and you have just created a new user.
see next post.


This User-ID must now be noted / copied.
This ID has been entered in a whitelist and is needed to execute commands.

Since the OSRAM SMART+ plugs in HUE are addressed as lights, the lights must be indentified.
In the URL field, change the value to /api/[USER-ID]/lights.
Example: /api/83b7780291a6ceffbe0bd049104df/lights and press the GET button.

You get a list of all devices in the Command Response.
See next post.

Edit: Weโ€™re sorry, but new users are temporarily limited to 3 replies in the same topic.
...
I just can give you the text...

"10": {
		"state": {
			"on": false,
			"alert": "select",
			"mode": "homeautomation",
			"reachable": true
		},
		"swupdate": {
			"state": "notupdatable",
			"lastinstall": "2019-10-11T08:31:21"
		},
		"type": "On/Off plug-in unit",
		"name": "Ender3",
		"modelid": "Plug 01",
		"manufacturername": "OSRAM",
		"productname": "On/Off plug",
		"capabilities": {
			"certified": false,
			"control": {},
			"streaming": {
				"renderer": false,
				"proxy": false
			}
		},
		"config": {
			"archetype": "plug",
			"function": "functional",
			"direction": "omnidirectional"
		},
		"uniqueid": "7c:b0:3e:aa:0a:02:f2:71-03",
		"swversion": "V1.04.12"
	}

Now we have created the preconditions to use the Plugin: ShutdownPrinter.

Approximately in the middle of the Shutdown Printer settings, you will find the Mode API Costum section, where you can see the PUT check box.

Since you want to address the plug directly, the value of the field URL must look like this:
http:// Enter [IP-HUE-BRIDGE]/api/[USER-ID]/lights/[DEVICE-NUMBER]/state
Example: http://192.168.178.41/api/83b7780291a6ceffbe0bd049104df/lights/10/state

The header can remain empty and the body gets the value {"on":false}

Press the test button to test the call. When it worked, change the body to {"on":true} and press the test button again to make the plug active again.
Now change the body to the final state {"on":false} again and save the settings.

Done.

Is there a solution for non hue-bridge users for this?