athombv / homey-web-api-issues

This issue tracker is for Homey Developers using the Web API.
4 stars 1 forks source link

Unable to call Homey.rf.emulate from HomeyScript: You have no access to do this #8

Closed sherland closed 5 years ago

sherland commented 5 years ago

I'm trying to send ir-commands by using HomeyScript When I run this script in the HomeyScript console:

let data = [545,1696,535 /* dummy-data */] 
await Homey.rf.emulate({frequency: 'ir', data: data});

... I get this error:

----------------
Script Error:
You have no access to do this.

One strange(?) thing is that if I run this in the api-playgound, I don't get any errors, or 'ok' for that matter... (I had to remove 'await' for some reason):

let data = [545,1696,535 /* dummy-data */] 
Homey.rf.emulate({frequency: 'ir', data: data});
jeroenvollenbrock commented 5 years ago

Homey.rf.emulate does not send ir commands, instead it pretends it just received the specified raw data. This is a developer API meant for the creation of new apps and signals, and is therefore not available within homeyscript.