Check if call service was successful

Hi I'm looking for recommendations for checking that a call service was successful

Yes I can wait 5 min and check the state but I'm looking for a very fast method

Hi @Rhysgh

No one can possibly help with that question - unless we have mind readers?
I use nodes that has functions to "call a service".

With that in mind..

  • What nodes are you using
  • What is a "service call", and is it related to the nodes you're using?

Context is key here!

Apologies, I was intentionally vague as I'm looking for inspiration rather than a fixed answer.

I'm using Node-red in HA, and I'm using a HA call service node, I i suppose, really, as there's no call back then I cant get a handshake to confirm the action is complete.. I guess ill have to wait and check an entity for a state change

Ok...

We have very little HA users here, but I think you answered it already.

One solution...

Create a subflow that executes whatever you need it to (taking an input of some kind)
The same subflow will then, after a predefined time, check the value - and the subflow can return true or false based on the returned value

Can you point me in the direction for the use of subflows? Why / when are they used?

Of course @Rhysgh ...

https://nodered.org/docs/user-guide/editor/workspace/subflows

A subflow is a set of nodes, that can be reused, but represneted as a single node.
I like to refer to a subflow as a 'blueprint' of logic.

each subflow you drag on your main flow, is a new instance of that logic.

Import below:

[{"id":"38b7f1c3f33825ab","type":"subflow","name":"Demo Subflow","info":"","category":"","in":[{"x":95,"y":95,"wires":[{"id":"78b9dbeaf2ea18ea"}]}],"out":[{"x":405,"y":95,"wires":[{"id":"78b9dbeaf2ea18ea","port":0}]}],"env":[{"name":"Name","type":"str","value":""}],"meta":{},"color":"#DDAA99"},{"id":"78b9dbeaf2ea18ea","type":"function","z":"38b7f1c3f33825ab","name":"function 5","func":"return {payload:`${msg.payload} is ${env.get('Name')}`}","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":235,"y":95,"wires":[[]]},{"id":"e703a32b10267363","type":"tab","label":"Flow 2","disabled":false,"info":"","env":[]},{"id":"06dce03e6ce072e8","type":"subflow:38b7f1c3f33825ab","z":"e703a32b10267363","name":"","env":[{"name":"Name","value":"Marcus","type":"str"}],"x":475,"y":210,"wires":[["409d1943f7071a81"]]},{"id":"6fbd9041dfff7e5a","type":"inject","z":"e703a32b10267363","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"My name is : ","payloadType":"str","x":200,"y":215,"wires":[["06dce03e6ce072e8"]]},{"id":"409d1943f7071a81","type":"debug","z":"e703a32b10267363","name":"debug 4","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":730,"y":210,"wires":[]},{"id":"34aeedbbe962b4b4","type":"subflow:38b7f1c3f33825ab","z":"e703a32b10267363","name":"","env":[{"name":"Name","value":"Davies","type":"str"}],"x":470,"y":280,"wires":[["46647b63c51bb06c"]]},{"id":"5430c409fa325651","type":"inject","z":"e703a32b10267363","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"My surname is : ","payloadType":"str","x":205,"y":285,"wires":[["34aeedbbe962b4b4"]]},{"id":"46647b63c51bb06c","type":"debug","z":"e703a32b10267363","name":"debug 5","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":725,"y":280,"wires":[]}]

Your subflow will do the heavy lifting, and finally return true or false based on its internal logic