External Commands Relay On/Off Slider

Hello, 
i know from reading tutorials how to switch GIPO pins of the pi with extcommands.xml

BUT, its very ugly to have one ON and one OFF button for that.
is it possible to use a slider like you have it when using the gpio output over the global settings menu?
I just need a confirmation question when the switch is ON to ask again if i really want to turn off the relay.

How is that easily possible? Do i have to make it with external commands?

best regards, Dominik

Comments

  • Ok that is quite easy. Add it as GPIO output, but do not select to show it in menu. Then the only way is the command shown. Make sure name has no spaces or use quotes on name for command.

    Now you add a quick command in printer configuration->G-Codes->quickcommand.
    There is no way to ask output state at the moment, so you need to present a custom dialog with question on/off instead and put the command on the button. Or just ask for toggle function to switch power.

    Then you need just to run the quick command from the list.
  • Thanks, i will give that a try.
    But then, i have the switch in the printer itself. Is it also possible to have them in the general menu?(gear icon) 

    Its because.im building a Controller which can switch two power sockets via relay and this functionality should be present even if No printer is configured. Because i want to keep it easy for other people using the device later..
    So they dont need to configure the on off funtion themselfes in their printer settings. 
  • Maybe a Feature for later Updates could be to just put a Text field in gpio settings "Security question". Its just too dangerous because one can easily turn off the printer with a single klick by mistake.
  • Quick commands are only in the send dropdown menus and can not be moved. They after all depend on selected printer.
Sign In or Register to comment.