3D printes power outlet piston, multiple messages


#1

1) Give a description of the problem
Piston send push notifications every time power rises over 30W which means that I get way too many push messages.

Device is 3d printer. When it is on it uses fans and power is something between 11W - 200W but mostly 15W. When nozzle and bed heats up it takes anything between 50W to 300W. When printing starts it takes mostly 50W to 300W but occationally drops even 0.45W. Devices power usage is so complicated that I have hard time to understand how to create piston that works.

2) What is the expected behaviour?
I would like to have just one message when power rises over 30W for the first time. This should happen when printer is on and using its fans. When print is ready it should send “done” message.

3) What is happening/not happening?
It sends multiple messages.

**4) Snapshot


#2

I would incorporate the Printer_running = false variable as a condition in your first IF block so that you’ll only get one push when the power goes above 30W.

The rest, of line 31 down, I’d put it in it’s own IF block. and include the wait in the with Outlet 3dPrinter.


#3

Oh yeah. Stupid me. I’m using variable without really using variable… :slight_smile:
I think I got it now. Going to test later and report how it went.