Hi there. I want to contribute a bit to the PSU-Control by adding my solution to the "scripts" part of the Wiki (https://github.com/kantlivelong/OctoPrint-PSUControl/wiki/Scripts ) but I cannot find a way to do that on Github alone, so I try to reach out here.
I have written this:
Tasmota
If you have tasmota that can turn your PSU device on/off (some kind of smart plug), you don't actually need a script.
Let's explain my URL:
http://172.16.21.18/cm?cmnd=Power1%20On
change 172.16.21.18 to the IP of your tasmota device
change Power1 to the channel of that device. regular plugs have just one power that is named power, my device has 3 outlets and they are named power1-3. see tasmota wiki on commands for details.
Now to the setup:
-
Navigate to OctoPrint -> Settings -> PSU Control
-
Set Switching to System Command
-
Set On System Command to:
wget http://172.16.21.18/cm?cmnd=Power1%20On -q
- Set Off System Command to:
wget http://172.16.21.18/cm?cmnd=Power1%20Off -q
-
Set Sensing Method to System Command
-
Set Sensing System Command to:
wget 'http://172.16.21.18/cm?cmnd=Power1' -q -O - | jq -r '.POWER1' | awk '/OFF/{++cnt} END {exit cnt}'