How do I run a FlowCardAction for other devices from an app?

If I use the web api playground to run the following code it works smoothly:

Homey.flow.runFlowCardAction({
      uri: 'homey:device:ccxvb-xvb-bv-bcv-ccxxxxxxxxx',
      id: 'target_temperature_set',
      args: {target_temperature:11}
    });

However, running the same from an app using HomeyAPIApp like this:

await this.homeyApi.flow.runFlowCardAction({
      uri: 'homey:device:ccxvb-xvb-bv-bcv-ccxxxxxxxxx',
      id: 'target_temperature_set',
      args: {target_temperature:11}
    })

only give me “Permission denied”

I found no permissions to set to enable this. Are there no ways to run this?

I was wondering if it was possible to use a HTTP request to http://localhost/api/manager/flow/xxx to do the same thing like I did when bypassing permission denied for public api calls. But I can’t figure out how the API call should be constructed as runFlowCardAction does not seem to be documented… And I figure it probably will not work anyway since this command is not marked as public like I did with the app API.

Any ideas how to get the flow started?

This works using HomeyScript

// send push confirmation to user
const responseC = await Homey.flow.runFlowCardCondition({
        uri: 'homey:manager:mobile',
        id: 'push_confirm',
        args: {
			    user: {
			    athomId: 'YourAthomID'
		    	},
		    text: 'Test push confirmation from HomeyScript'
        },
      });
console.log(responseC);
//return(true);

// -----------

// send push msg to user
const responseA = await Homey.flow.runFlowCardAction({
        uri: 'homey:manager:mobile',
        id: 'push_text',
        args: {
			    user: {
			    athomId: 'YourAthomID'
		    	},
		    text: 'Test push notification from HomeyScript'
        },
      });
console.log(responseA);
return(true);

Yes, thanks for the reply, but HomeyScript use the same commands as the web API playground so I suspected that would work, but that is not where the problem occurs. My problem is when you try to do this with an app, which works a little bit differently.

Ah I see… I only know the playground has more permissions than HScript or apps

Yeah, it’s quite annoying. Why let us play with it if we can’t get permission to do it elsewhere?

Numbers… when you fiddle with playground, you only have a chance to ‘demolish’ your own homey.
But when 5000 instances of your app are installed…
Take a look at h.o.o.p. app It uses a ‘creative’ rights elevator. However, because of that, It’s not allowed to the official store. This app can change device names on the spot for instance :wink:

But it’s weird you cannot just set a target temperature using an app? That shouldn’t need extra permissions imho.
Maybe Björn knows a thing or two about that:

I can write to the capability for temperature yes… however this was only an example.
The real problem is that I encountered an app that does not have any writeable capabilities. The only way to change the state of the device is to use Action cards… So either I must find a way to trigger the action cards for the other app from within my app or I have to insist on the other app to change to meet my needs, which is a kind of approach I only see as a last resort :wink: