Hello in the forum,
have a question. I have an Octoprint “Sensor” which shows the time remaining until the end of the print in seconds. I would like to use Node-RED to convert the sensor data into minutes and hours and then send this via voice output.
So far, I can ask the time of the sensor via the “trigger state” function. Here a number is output in the debug. These would then have to be converted into minutes and hours and inserted into the text of the speech output.
Here is a screenshot and then the flow…
[{"id":"5c2d89d8.26eae8","type":"tab","label":"3D-Drucker Restzeit","disabled":false,"info":""},{"id":"f9d72e34.1e91f","type":"inject","z":"5c2d89d8.26eae8","name":"","topic":"","payload":"1","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":170,"y":200,"wires":[["a8f9d9de.077308"]]},{"id":"a8f9d9de.077308","type":"trigger-state","z":"5c2d89d8.26eae8","name":"","server":"a446b7a.18bf248","entityid":"sensor.anycubic_mega_s_time_remaining","entityidfiltertype":"exact","debugenabled":false,"constraints":[],"constraintsmustmatch":"all","outputs":2,"customoutputs":[],"outputinitially":false,"state_type":"str","x":470,"y":360,"wires":[["8ad2f3b8.6d86d","522d28e0.b9fa48"],[]]},{"id":"8ad2f3b8.6d86d","type":"debug","z":"5c2d89d8.26eae8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":870,"y":340,"wires":[]},{"id":"522d28e0.b9fa48","type":"change","z":"5c2d89d8.26eae8","name":"Sprachausgabe","rules":[{"t":"set","p":"payload","pt":"msg","to":"Der Druck dauert noch .......","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":400,"y":680,"wires":[["f30e2257.f01cb"]]},{"id":"f30e2257.f01cb","type":"cast-to-client","z":"5c2d89d8.26eae8","name":"Audioausgabe","url":"","contentType":"","message":"","language":"de","ip":"192.168.178.70","port":"","volume":"50","x":660,"y":680,"wires":[[]]},{"id":"b239de26.82ce9","type":"comment","z":"5c2d89d8.26eae8","name":"to Test","info":"","x":130,"y":160,"wires":[]},{"id":"bd30c7f8.5105a8","type":"comment","z":"5c2d89d8.26eae8","name":"Convert seconds to minutes and hours","info":"","x":590,"y":440,"wires":[]},{"id":"747504f7.83bffc","type":"comment","z":"5c2d89d8.26eae8","name":"Text for speech output","info":"","x":460,"y":520,"wires":[]},{"id":"a7792adc.d1a1a8","type":"comment","z":"5c2d89d8.26eae8","name":"to Test","info":"","x":890,"y":300,"wires":[]},{"id":"a446b7a.18bf248","type":"server","z":"","name":"Home Assistant","legacy":false,"hassio":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true}]
Maybe someone can help or has done something like this before. I’m grateful for any help
Greetings and thanks in advance