Script Idea.. can anyone help please?

Hi All,

I’m wondering if it is possible to have a script that basically has an if then function ( as far as I can see) here is what I want…

for my 3D printer I’m looking for a button that I can press to turn it on but if it is on and running then a press would check the status of the printer and the tool temp and if they are ok then it would turn it off… the way I see it is

check the status of switch.3d_printer
if off then switch.turn_on
if on then check print status
if printing then end (no action or a popup/alexa message saying cannot turn off, printer is busy)
if else then check tool temp
if tool temp > 35 then end (no action or a popup/alexa message saying cannot turn off, the tool is to hot)
if tool temp < 35 then switch.turn_off

but how do I turn that into a script?

any help greatly appretiated

Robin

Choose is what you want to use. I suggest taking a look at all the other options for the script syntax.

1 Like

Likely even consider a Template Switch for this as it has the benefit of combining the automation and state into a single LoveLace entity.