[PSU-Control] want to improve wiki with tasmota shell command

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:

  1. Navigate to OctoPrint -> Settings -> PSU Control

  2. Set Switching to System Command

  3. Set On System Command to:


wget http://172.16.21.18/cm?cmnd=Power1%20On -q

  1. Set Off System Command to:

wget http://172.16.21.18/cm?cmnd=Power1%20Off -q    

  1. Set Sensing Method to System Command

  2. 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}'

1 Like

BTW my OctoPrint-Tasmota plugin can handle all this for you as well directly with all the same features of PSU Control.

1 Like