Closed magtimmermans closed 1 year ago
Hi @magtimmermans, thank you for reporting this issues. It indeed seems to be a bug. Could you please provide some more information about how and when this bug seems to occur? Perhaps you could share your Flow.
@RobinBol I think this happens when the Logic Variable has been deleted, but the variable's tag is still used in the Flow card's argument. Should be easy to reproduce.
Yes tried that but could not reproduce, in my test case the Flow card action is not executed but gives an error (flowtoken_not_found).
Hi,
The flow token was their. It was from the logic and was used in my Sunevents app. Sdk 2 homey 6 release.
This logic var was not a number when getting it as state back.
@magtimmermans could you share the exact Flow with which you have experienced this issue?
It is whenever I use a trigger with a tag value. This is for example with the sunevents app.
I'm going to close this because we currently don't have enough information to reproduce this issue. If you are still experiencing this please open another issue with a description of the specific apps, devices and Flows that trigger this issue for you.
Please re-open. I am using the function of FlowCardTrigger object: https://apps-sdk-v2.developer.athom.com/FlowCardTrigger.html#getArgumentValues
Walking to the arguments gives me and object instead of the value.
Can you share a complete code example? The one you've shared before doesn't include getArgumentValues()
Okay I managed to reproduce the behaviour, but this is a very tricky issue.
In some ways this behaviour is intended: FlowCard#getArgumentValues()
works together with FlowCard.on('update')
so that you can retrieve the values that are passed to your Flow card. However if you are using a token this value can change without an "update"
event to notify your app of this change.
Additionally there are "local Flow tokens" where the actual value is only known when the Flow is run. So there is no way FlowCard#getArgumentValues()
can return a value in that case.
This is somewhat problematic because Apps may expect getArgumentValues()
to always return the actual values and not the "Token URI". Especially if the argument is a string this can cause unexpected behaviour that would be very difficult to work around.
This is something we will discuss further internally, thank you for reporting and your patience 🙂
Great you found it. I am also happy with another function that can get the details on the result of getArgumentValues().
I encountered this issue (a valid variable is not taken into account by the Solar Events app) and it's a real limit... The Flow I generated is the following: WHEN event "nadir" with offset (variable in minutes, entered as 780 without any other flow calculating it, for test-purpose) THEN send a notification Won't work. If instead of (variable in minutes) I directly enter the same value, it works fine
Why is it closed? In which release is this fixed?
Why is it closed? In which release is this fixed?
This is the way it works some tokens have runtime values so you would never get a value from that in getArgumentValues and this is not something we can fix.
If it was a logic var how would your app even update if the var changed?
2 years ago it I defined as a bug. Abd suddenly it works as expected?? I expect that when I use thi function I got the current state of this tag.
If this isn't working it should also not be possible in the ui.
Hi, I have a trigger card and someone entered a tag as an argument. So the state.offset (in my case) get's an object and how can I retrieve the value behind this?? let rainStartTrigger = new Homey.FlowCardTrigger('rain_start'); rainStartTrigger .registerRunListener(( args, state ) => { args, this is the user input the state parameter, as passed in trigger() // If true, this flow should run return Promise.resolve( args.offset === state.offset); }) .register() I get as state.offset : '[[homey:manager:logic|034e762c-da6f-4345-8a31-0508f9ae37b9]]'? but I expect a number... Is this a bug as I expect that homey will parse this? (SDK-2 by the way)