Hi,
for receiving a Bearer token I have created an HomeyScript. This script returns a variable and is saved as FSRBearerToken. I can see this variable in Homey and can use it in flows.
But now I have created another HomeyScript for collection some data and want to use this variable as well. Have tried several options but no luck. Anybody?
Tried the following:
async function run() {
const token = await Homey.tags.getValue('FSRBearerToken');
if (!token) throw new Error('FSRBearerToken tag empty');
}
And use the HomeyScript card adding an argument
async function run(args) {
const token = args.FSRBearerToken;
if (!token) {
throw new Error('FSRBearerToken argument missing');
}
Using the direct token works perfectly
async function run() {
const token = 'ACTUAL_TOKEN';
if (!token) {
throw new Error('Token not found');
}