This is probably a lot simpler than I’m thinking it is.
When my 3D printer starts, it shifts from Operational
to Printing
. I have a Poll State
node watching for a change every 10 seconds.
When the change occurs, a Switch
node compares the messages. If the message is Operational
down the line it goes to check the temperature of the bed and the extruder.
If it is Printing
then my goal is to have Google Home use TTS to Say Printing is 25% complete
and then Printing is 50% complete
and so on.
I’ve got the announcement worked out. What I can’t figure out is how to get that announcement to fire once
when the state of the progress
is between
two numbers without firing every time the state changes and the value is still between the two numbers. Since the percentage could change 100 times inside of 25 and 26 (25.02, 25.08, etc.) each state change would trigger the announcement.
At present, my only solution seems to be to create boolean switches that are all reset to ON when the print job starts, and are then turned OFF after the announcement is made during that print job. Then, when a new print job starts, the three switches (25% / 50% / 75%) would be turned on again.
Ideas?