# Homeyscript Homey.flowToken.getFlowToken value is undefined

**URL:** <https://community.homey.app/t/homeyscript-homey-flowtoken-getflowtoken-value-is-undefined/78807>\
**Category:** Questions & Help\
**Tags:** homeyscript, homey-pro\
**Created:** [April 3, 2023, 6:09am UTC](https://community.homey.app/t/homeyscript-homey-flowtoken-getflowtoken-value-is-undefined/78807 "2023-04-03T06:09:16Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bananamoon](https://avatars.discourse-cdn.com/v4/letter/b/919ad9/32.png) [@Bananamoon](https://community.homey.app/u/Bananamoon)\
**Post date:** [April 3, 2023, 6:09am UTC](https://community.homey.app/t/homeyscript-homey-flowtoken-getflowtoken-value-is-undefined/78807/1 "2023-04-03T06:09:16Z")

</div>

Hello,

I’m new to homey pro and recently was playing around with HomeyScript. I have the new Homey Pro (2023) and I have trouble getting the values from my devices.

When I try to get my devices (even if it is in a loop or one specific device) the value stays undefined and I have no clue why. This script works perfectly on my friend’s old Homey Pro.

I was wondering if this is a bug in the new Homey Pro or if I’m doing something wrong?

Below is an example of what is returned. I redacted some ID’s for security purposes:

t {  
\_\_athom\_api\_type: ‘HomeyAPI.ManagerFlowToken.FlowToken’,  
id: ‘measure\_temperature’,  
ownerId: ‘measure\_temperature’,  
ownerUri: ‘homey:device:ID’,  
ownerName: ‘Weerstation’,  
type: ‘number’,  
title: ‘Temperature’,  
example: null,  
uri: ‘homey:device:ID’,  
uriObj: { name: ‘Weerstation’ },  
**value: undefined**  
}

Thank you for your help!

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [April 3, 2023, 6:19am UTC](https://community.homey.app/t/homeyscript-homey-flowtoken-getflowtoken-value-is-undefined/78807/2 "2023-04-03T06:19:42Z")

</div>

What do you mean by “values from my devices”? Capability values?

If so, why is it showing a flow token?

Also, you’d probably get more responses if you post your actual code rather than just its output.

---

<div class="post-metadata">

**Author:** ![Bananamoon](https://avatars.discourse-cdn.com/v4/letter/b/919ad9/32.png) [@Bananamoon](https://community.homey.app/u/Bananamoon)\
**Post date:** [April 3, 2023, 6:26am UTC](https://community.homey.app/t/homeyscript-homey-flowtoken-getflowtoken-value-is-undefined/78807/3 "2023-04-03T06:26:28Z")

</div>

At my friend’s homey it shows some information from the specific token. In this case it should show the current temperature from the Weerstation under the Value variable in the object.

Please find the code below. The loop is to run through all existing tokens and show some information (including the value of each token). the second piece of code is one specific token. Both return undefined under the value variable.  
_again, the unique identifier in the uri is removed. I’m not sure if this is needed but I’d rather be safe._

console.log(‘\n-------------TOKENS----------’);  
let tokens = await Homey.flowToken.getFlowTokens();  
\_.forEach(tokens, token =\> {  
console.log(‘uri: ’ + token.uri + ’ - id: ’ + token.id)  
console.log(‘uriObj.name: ’ + token.uriObj.name + ’ - ’ + ‘Title: ’ + token.title + ’ Value =\> (’ + token.value +’)’);  
});

console.log(await Homey.flowToken.getFlowToken({  
uri: ‘homey:device:ID’,  
id: ‘measure\_temperature’  
}));

Edit: An image of the second console.log output in the foreach

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/7/6/765d14e0bcd2a31401434a694175040892fc2d6e.png)

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [April 3, 2023, 6:38am UTC](https://community.homey.app/t/homeyscript-homey-flowtoken-getflowtoken-value-is-undefined/78807/4 "2023-04-03T06:38:22Z")

</div>

> [@Bananamoon](#):
>
> In this case it should show the current temperature from the Weerstation under the Value variable in the object.

It doesn’t make sense to use flow tokens for that, just read the device data directly:

```auto
const device = await Homey.devices.getDevice({ id : 'THE_DEVICE_ID' });
console.log( device.capabilitiesObj?.measure_temperature?.value );

```

---

<div class="post-metadata">

**Author:** ![Bananamoon](https://avatars.discourse-cdn.com/v4/letter/b/919ad9/32.png) [@Bananamoon](https://community.homey.app/u/Bananamoon)\
**Post date:** [April 3, 2023, 6:52am UTC](https://community.homey.app/t/homeyscript-homey-flowtoken-getflowtoken-value-is-undefined/78807/5 "2023-04-03T06:52:57Z")

</div>

Thank you! That works indeed 🙂

---

<div class="post-metadata">

**Author:** ![Frank](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/frank/32/60402_2.png) [@Frank](https://community.homey.app/u/Frank)\
**Post date:** [June 20, 2023, 8:02pm UTC](https://community.homey.app/t/homeyscript-homey-flowtoken-getflowtoken-value-is-undefined/78807/6 "2023-06-20T20:02:19Z")

</div>

I need a Token that is produced by another HomeyScript, so it is not available via a Device.

Well now, whenever I print the tokens on my old Homey 2016:

```auto
let tokens = await Homey.flowToken.getFlowTokens();
_.forEach(tokens, token => {
       console.log(token.title+': '+token.value);
    });

```

It neatly returns all keys and values…

```auto
Helderheid: 0.04
Datum: 20-06-2023
Tijd: 21:54
Zonsopkomst: 05:11
Zonsondergang: 22:05
Weer: Gematigde Regen

```

…whereas my brand-spanking-new Homey Pro 2023 renders all values as ‘undefined’ just like Bananamoon’s statement above.

---

<div class="post-metadata">

**Author:** ![Freek\_Smits](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/freek_smits/32/33854_2.png) [@Freek\_Smits](https://community.homey.app/u/Freek_Smits)\
**Post date:** [September 18, 2023, 7:34am UTC](https://community.homey.app/t/homeyscript-homey-flowtoken-getflowtoken-value-is-undefined/78807/7 "2023-09-18T07:34:10Z")

</div>

I have the same problem. Does anyone know a solution yet?

```auto
await tag('TestTagTitle', 'TestTagValue'); 

let flowTokens = await Homey.flowToken.getFlowTokens();

for (const flowToken of Object.values(flowTokens)) {
  if (flowToken.uri == 'homey:app:com.athom.homeyscript' 
      && flowToken.title == 'TestTagTitle') {
     log('flowToken.title: ' + flowToken.title + '; flowToken.value: ' + flowToken.value)
  }  
}

```

Output:  
flowToken.title: TestTagTitle; flowToken.value: undefined

---

<div class="post-metadata">

**Author:** ![bwa](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/bwa/32/17852_2.png) [@bwa](https://community.homey.app/u/bwa)\
**Post date:** [January 4, 2026, 10:18am UTC](https://community.homey.app/t/homeyscript-homey-flowtoken-getflowtoken-value-is-undefined/78807/8 "2026-01-04T10:18:49Z")

</div>

> [@Freek\_Smits](#):
>
> `let flowTokens = await Homey.flowToken.getFlowTokens();`

Hmm, on my Homey Pro 23 and Homey SHS a HomeyScript like this

`let flowTokens = await Homey.flowToken.getFlowTokens();`

returns this

`TypeError: Cannot read properties of undefined (reading 'getFlowTokens')`

So the `flowToken` seems to have vanished …

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [January 4, 2026, 10:28am UTC](https://community.homey.app/t/homeyscript-homey-flowtoken-getflowtoken-value-is-undefined/78807/9 "2026-01-04T10:28:59Z")

</div>

It has been renamed to `flowtoken` for a long time now.

---

<div class="post-metadata">

**Author:** ![bwa](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/bwa/32/17852_2.png) [@bwa](https://community.homey.app/u/bwa)\
**Post date:** [January 4, 2026, 12:40pm UTC](https://community.homey.app/t/homeyscript-homey-flowtoken-getflowtoken-value-is-undefined/78807/10 "2026-01-04T12:40:25Z")

</div>

Funny… I did my homework and search and found it in the forum, but when the search get wrong answer …

flowtoken worked fine

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [January 4, 2026, 12:57pm UTC](https://community.homey.app/t/homeyscript-homey-flowtoken-getflowtoken-value-is-undefined/78807/11 "2026-01-04T12:57:28Z")

</div>

The previous post in this thread was from 2023 😅

In any case, HomeyScript uses the Web API, which is documented [here](https://athombv.github.io/node-homey-api/HomeyAPIV2.ManagerFlowToken.html).
