Dashboard notification while exec

Hello, sorry for my english, I can't get the notification to show while the exec node is working (it's a python file with a simple sleep). If the execution takes 10 seconds, the notification should last the same time.

image

[{"id":"53c407dd.c4ad18","type":"exec","z":"ce7d7a5e.e05188","command":"python3 /home/pi/Desktop/prueba.py","addpay":false,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"test.py","x":370,"y":620,"wires":[["2f472800.b00728"],["f893bf08.28af"],["e5454a65.3e2d38"]]},{"id":"2f472800.b00728","type":"debug","z":"ce7d7a5e.e05188","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":510,"y":580,"wires":[]},{"id":"f893bf08.28af","type":"debug","z":"ce7d7a5e.e05188","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":530,"y":620,"wires":[]},{"id":"e5454a65.3e2d38","type":"debug","z":"ce7d7a5e.e05188","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":530,"y":660,"wires":[]},{"id":"dd732cd9.fb5dd","type":"inject","z":"ce7d7a5e.e05188","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":200,"y":620,"wires":[["53c407dd.c4ad18","385fb860.196408"]]},{"id":"385fb860.196408","type":"ui_toast","z":"ce7d7a5e.e05188","position":"top right","displayTime":"","highlight":"","sendall":true,"outputs":0,"ok":"OK","cancel":"","raw":true,"topic":"my notification","name":"my notification","x":400,"y":520,"wires":[]},{"id":"66f95947.dd9488","type":"ui_button","z":"ce7d7a5e.e05188","name":"","group":"14481a72.7bb546","order":9,"width":0,"height":0,"passthru":false,"label":"button","tooltip":"","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"topic","topicType":"msg","x":190,"y":560,"wires":[["53c407dd.c4ad18","385fb860.196408"]]},{"id":"14481a72.7bb546","type":"ui_group","name":"Capturar y mostrar","tab":"558b9018.852f3","order":2,"disp":false,"width":"8","collapse":false},{"id":"558b9018.852f3","type":"ui_tab","name":"Visual Inspec","icon":"dashboard","order":1,"disabled":false,"hidden":false}]

Welcome to the forum @TutanJamon.

In the help text for the notification node, down the bottom, it tells you how you can clear the notification:
"Sending a blank payload will remove any active dialog without sending any data."
So if you add a Change node connected between output 3 of the exec node and the notification node, configured like this

image

Then when a message appears on output 3 it will clear the notification. Use output 3 as that is guaranteed to return something even if there is error.
So your flow should look like this.

Hello Colin and thanks you. I keep trying but the notification ends before the process executed. I need the notification to stay visible for the duration of the execution.

[{"id":"53c407dd.c4ad18","type":"exec","z":"ce7d7a5e.e05188","command":"python3 /home/pi/Desktop/prueba.py","addpay":false,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"test.py","x":370,"y":620,"wires":[["2f472800.b00728"],["f893bf08.28af"],["e5454a65.3e2d38","6766f436.a80a9c"]]},{"id":"2f472800.b00728","type":"debug","z":"ce7d7a5e.e05188","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":530,"y":520,"wires":[]},{"id":"f893bf08.28af","type":"debug","z":"ce7d7a5e.e05188","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":550,"y":560,"wires":[]},{"id":"e5454a65.3e2d38","type":"debug","z":"ce7d7a5e.e05188","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":550,"y":600,"wires":[]},{"id":"dd732cd9.fb5dd","type":"inject","z":"ce7d7a5e.e05188","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":200,"y":620,"wires":[["53c407dd.c4ad18","385fb860.196408"]]},{"id":"385fb860.196408","type":"ui_toast","z":"ce7d7a5e.e05188","position":"top right","displayTime":"","highlight":"","sendall":false,"outputs":0,"ok":"OK","cancel":"","raw":true,"topic":"my notification yes","name":"my notification","x":420,"y":740,"wires":[]},{"id":"66f95947.dd9488","type":"ui_button","z":"ce7d7a5e.e05188","name":"","group":"14481a72.7bb546","order":9,"width":0,"height":0,"passthru":false,"label":"button","tooltip":"","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"topic","topicType":"msg","x":190,"y":560,"wires":[["53c407dd.c4ad18","385fb860.196408"]]},{"id":"6766f436.a80a9c","type":"change","z":"ce7d7a5e.e05188","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":560,"y":680,"wires":[["385fb860.196408"]]},{"id":"14481a72.7bb546","type":"ui_group","name":"Capturar y mostrar","tab":"558b9018.852f3","order":2,"disp":false,"width":"8","collapse":false},{"id":"558b9018.852f3","type":"ui_tab","name":"Visual Inspec","icon":"dashboard","order":1,"disabled":false,"hidden":false}]

Do you see anything from the bottom debug node at the moment the notifcation clears?
It is a good idea to give the debug nodes names then you can see which is which in the debug pane, but for this exercise just disable the top too so you only have the bottom one. Then run your script and see if the notification clears before the debug node outputs anything

When I do a debugging everything works the same as before, bad. I see the notification for a few seconds, then it disappears, and when the execution finishes the notification appears again (less than a second). The string "antes despues" are prints from my python file, it's not important.

@dceejay It seems there is a negative feature in the Notification node (2.28.0). If you don't specify a timeout it appears to default to a couple of seconds. Perhaps this is intentional, but I would have expected it to default to no timeout if it is left blank.

@TutanJamon set the timeout in the notification to much longer than you expect your script to take and try again.

In this way, the notification is first maintained but restarted at the end. I don't know if there is another node that does a similar function, but I can't find anything. I need the user to be informed at all times, with this or another method, if you know another you can tell me if you want. Thanks.

It is intentional - Originally there was no option to set it and it defaulted to that. (and still does).

If you always want the operator to see it set it as an OK/Cancel dialog so they have to acknowledge it.

Well this works for me. The top inject pops it up and the second clears it. If it doesn't work for you then perhaps you need to update the dashboard node.

image

[{"id":"6309027f.3ffcdc","type":"inject","z":"37f5b818.697af8","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"hello","payload":"xxx","payloadType":"str","x":230,"y":140,"wires":[["d0f2c477.fcd2e"]]},{"id":"53360a67.f8721c","type":"inject","z":"37f5b818.697af8","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"str","x":220,"y":240,"wires":[["d0f2c477.fcd2e"]]},{"id":"d0f2c477.fcd2e","type":"ui_toast","z":"37f5b818.697af8","position":"top right","displayTime":"1000","highlight":"","sendall":true,"outputs":0,"ok":"OK","cancel":"","raw":false,"topic":"","name":"","x":400,"y":200,"wires":[]}]

I will continue investigating, you have helped me a lot. Thanks a lot. It was my first time on this forum and I loved it, a very good community.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.