# Flow card emulation argumentation help/clarification needed

**URL:** <https://community.homey.app/t/flow-card-emulation-argumentation-help-clarification-needed/104466>\
**Category:** Questions & Help\
**Created:** [February 20, 2024, 12:26pm UTC](https://community.homey.app/t/flow-card-emulation-argumentation-help-clarification-needed/104466 "2024-02-20T12:26:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eko\_taas](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/eko_taas/32/74256_2.png) [@Eko\_taas](https://community.homey.app/u/Eko_taas)\
**Post date:** [February 20, 2024, 12:26pm UTC](https://community.homey.app/t/flow-card-emulation-argumentation-help-clarification-needed/104466/1 "2024-02-20T12:26:30Z")

</div>

As thinking also some other newbees might benefit as well, but not easy to find as no dedicate Topic, making it here…

> [@Get historic variable value](https://community.homey.app/t/get-historic-variable-value/79120/5):
>
> With a little D-tour: The [Device Capabilities app](https://community.homey.app/t/app-pro-device-capabilities-enhance-the-capabilities-of-devices/43287) has the perfect flowcard, and you can emulate it in Hscript Explained: You can emulate most AND & THEN flowcards in Homeyscript. Check example-flowcard-run on how to do that. Now, when you haven’t already, install Device Capabilities app first When you run example-flowcard-list it will return all And & Then cards available on your Homey → you can search for the …

When looking at ready made examples:

> // Run ‘Day Equals’ Flow ‘And’ Card  
> const { result: isWeekend } = await Homey.flow.runFlowCardCondition({  
> uri: ‘homey:manager:cron’,  
> id: ‘day\_equals’,  
> …
> 
> // Run ‘Show Animation’ Flow ‘Then’ Card  
> …  
> await Homey.flow.runFlowCardAction({  
> uri: ‘homey:manager:ledring’,  
> id: ‘show\_animation’,  
> …  
> },  
> });

ids are wrong, that was easy to realize - to be e.g.

> id: '‘homey:manager:cron:day\_equals’,

But when trying to define “args” similarly to e.g. on

> Retrieve the insights value from [[device]] for [[capability]] from [[numberof]] minutes ago

assumed as

> result = await Homey.flow.runFlowCardAction({  
> uri: ‘homey:app:nl.qluster-it.DeviceCapabilities’,  
> id: ‘homey:app:nl.qluster-it.DeviceCapabilities:action\_capability\_log’,  
> args: {  
> **\> device: ‘XXXXXX-467d-47ad-845d-0b248f66bf3a’,**  
> **\> capability: ‘measure\_temperature’,**  
> **\> numberof: 10,},**  
> });

while also tried:

> Calculate trend for [[insight]] based on the last [[range]] [[unit]]

thought to be like:

> result = await Homey.flow.runFlowCardAction({  
> uri: ‘homey:app:com.spkes.insightTrendsReloaded’,  
> id: ‘homey:app:com.spkes.insightTrendsReloaded:calculateTrendWithoutToken’,  
> args: {  
> **\> insight: ‘homey:device:XXXXXXXX-467d-47ad-845d-0b248f66bf3a:measure\_temperature’,**  
> **\> range: 15,**  
> **\> unit: ‘Hours’,},**  
> });

both failing to return data (1st with time-out, 2nd with empty data), while same cards on flow-sheet OK with same sensor…

Anyone?
