How to send a push confirmation from homeyscript

Hi all,

I’m trying to get a push confirmation working from HomeyScript.
The script does not return an error… I use it in Adv.Flow card “And - homeyscript run script”
Sending a push message works fine, but the confirm version does not work yet.
Any thoughts?

// send push confirmation to user
Homey.flow.runFlowCardAction({
        uri: 'homey:manager:mobile',
        id: 'push_confirm',
        args: {
			    user: {
			    athomId:  'myAthomIDhere'
		    	},
		    text: 'Test push confirmation test-push_confirmation.js'
        },
      });
  return(true);

.
This script works OK:


// send push msg to user
Homey.flow.runFlowCardAction({
        uri: 'homey:manager:mobile',
        id: 'push_text',
        args: {
			    user: {
			    athomId: 'myAthomIDhere'
		    	},
		    text: 'Test push notification test_pushmessage.js'
        },
      });

(Note: The AthomID of users can be found by running
Homey.users.getUsers();
in web-api playground)

The push confirmation isn’t an action card (THEN column) but a condition card (AND column), not sure that is possible.

You need to add await before Homey.flow.runFlowCardAction. The script is erroring after it is done executing so your wont be able to see the error.

Thanks Jeroen, tried earlier and got the error as well.
But, nów I suddenly get the “action” part, thanx Caseda.
While that card is a condition card, the “run flowcard” has to be the condition type as well :crazy_face:

Very nice, this works now:

const response = await Homey.flow.runFlowCardCondition({
        uri: 'homey:manager:mobile',
        id: 'push_confirm',
        args: {
			    user: {
			    athomId: MyUserAthomID
		    	},
		    text: 'Test push confirmation from HomeyScript, now choose Yes to confirm; for No, just ignore this:'
        },
      });
  log (response);    
  return(true);

.
A follow up question:
Replying the pushmessage with either yes or no, results in yes and the flow continues. Is that as designed?
Because, when the message is sent, and I don’t respond to the question, the flow stops.
So now we have a “Should I do action A, press Yes; if not, don’t respond” option.
I was expecting a
-Yes: do this
-No: do nothing, or do something else