# HomeyScript started from flow does not use up to date data?

**URL:** <https://community.homey.app/t/homeyscript-started-from-flow-does-not-use-up-to-date-data/15928>\
**Category:** Apps\
**Tags:** homeyscript\
**Created:** [July 23, 2019, 9:01am UTC](https://community.homey.app/t/homeyscript-started-from-flow-does-not-use-up-to-date-data/15928 "2019-07-23T09:01:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dhanjel](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/dhanjel/32/10878_2.png) [@dhanjel](https://community.homey.app/u/dhanjel)\
**Post date:** [July 23, 2019, 9:01am UTC](https://community.homey.app/t/homeyscript-started-from-flow-does-not-use-up-to-date-data/15928/1 "2019-07-23T09:01:09Z")

</div>

I have a simple script to post data about various things to a node-red dashboard, among them the status of my dish washer.

Basically;  
let washer = await Homey.devices.getDevice({id: ‘b74674ee-094b-4941-b193-55bd17191670’});  
let doorOpen = washer.capabilitiesObj.alarm\_contact.value;  
let remainingTime = washer.capabilitiesObj[‘bshc\_string.remaining\_time’].value;  
let progress = washer.capabilitiesObj[‘bshc\_string.progress’].value;  
And then I use fetch to post it.

This works like a charm from the script editor, but then I have created a flow that is triggered every minute to execute the script and push the data. The problem is though, that every time it is executed from the flow, the last values from when I executed it manually in the editor is sent and not the current values.

Have I missed something?

---

<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:** [July 23, 2019, 2:17pm UTC](https://community.homey.app/t/homeyscript-started-from-flow-does-not-use-up-to-date-data/15928/2 "2019-07-23T14:17:43Z")

</div>

> [@Device CapabilitiesObj in HomeyScript stays the same value when triggered in a flow](https://community.homey.app/t/device-capabilitiesobj-in-homeyscript-stays-the-same-value-when-triggered-in-a-flow/14529):
>
> I have a problem with constantly updated values from a device which i’m trying to get in a script. var device\_data = await Homey.devices.getDevice({ id: '45f27858-c506-4d3c-a800-1954d803e3e3' }); console.log(device\_data); When i “Save & Test” in homeyScript the data is constantly updated, more specific the capabilitiesObj capabilitiesObj: { measure\_power: { value: 498, lastUpdated: '2019-06-17T17:41:16.803Z', type: 'number', getable: true, setable: false, title: 'En…

---

<div class="post-metadata">

**Author:** ![dhanjel](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/dhanjel/32/10878_2.png) [@dhanjel](https://community.homey.app/u/dhanjel)\
**Post date:** [July 23, 2019, 3:09pm UTC](https://community.homey.app/t/homeyscript-started-from-flow-does-not-use-up-to-date-data/15928/3 "2019-07-23T15:09:08Z")

</div>

That did seem to do the trick! Bad search skills from my side it seems 🙂

---

<div class="post-metadata">

**Author:** ![Rocodamelshekima](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rocodamelshekima/32/8209_2.png) [@Rocodamelshekima](https://community.homey.app/u/Rocodamelshekima)\
**Post date:** [July 23, 2019, 5:27pm UTC](https://community.homey.app/t/homeyscript-started-from-flow-does-not-use-up-to-date-data/15928/4 "2019-07-23T17:27:06Z")

</div>

Closed on July 23, 2019, 5:27pm UTC


