This is the forum archive of Homey. For more information about Homey, visit the Official Homey website.
The Homey Community has been moved to https://community.athom.com.
This forum is now read-only for archive purposes.
The Homey Community has been moved to https://community.athom.com.
This forum is now read-only for archive purposes.
Comments
This can only be achieved by action cards, not by API calls. If you need this functionality via api what you could do (after the next release)
Create a variable MyExternalTrigger
create a variable MyDelayedTrigger
Create flow
If MyExternalTrigger is changed => change value of MyDelayedTrigger with a delay
Then create a second flow
If MyDelayedTrigger is changed => Perform desired action
Please come with suggestions for the next release. I want to implement AND and OR cards for the condition, but ill have to wait until dropdown multiselects are available.
For those who are eager, it is available on github.
Also ability to be able to listen to "any variable" change trigger from other app. In that case upper idea could be new app, acting as an extension for your great better logic app. Not sure if that's even possible currently? Push from app to app? @Emile ?
What I could make is an api that creates a variable. So your app has to call the URL of the api of my app and create the variable. This means though that everyone should install my app if they want to use yours. I think then it would be wise if we prefix this variables with SYSTEM_APPID_MyFirstVar.
With this idea you could:
- Create a trigger on a system variable change
- Create logic on the variable
An other feature I could make is an URL callback event on variable change. So whenever a variable changes, it calls an external URL..?
Example:
new app with trigger when some number variable from your app, difference is [greater/lower/equal] than X.
You can implement api.js to get variables list(for autocomplete), get variable value etc.
Prefix is not necessary. Let user define variables in your app and make autocomplete in new app (using your api).
We could do webhooks (URL callback), but this is coupling. With events parent app does not need to know about anyone who is listening.
The main issue I see how to notify new app variable was changed. We want push here, not poll. So .realtime() from app to new app.
Ideally your app would announce variable change
Homey.trigger('variableChange', {
name: 'counter',
prev: 2,
value: 3
})
new app would simply subscribe to this event
Homey.app('net.i-dev.betterlogic').on('variableChange', function(args) {...})
If you cant wait, fetch it from git. Please let me know what you think.
In all seriousness; what is the frequency of app updates on my Homey? Does the 'update' setting have any impact on updating the apps or is that only for core HomeyOS ? And is there a way to force update an app?
(Edit: a reboot did help updating the app, so that might be one way to force-update an app)
I have no clue... Maybe ask in an other topic?
- the settings page shows you the full list of variables, their current value and the time and date of their last change
- when using cards in a flow, you can simply pick the variables from a picklist, no need to remember them, no chance of typos
- boolean flip saves a lot of work!
Even when you only use a few variables in your flow, this app is well worth it!
Tip: create triggers and actions in separate flows, that greatly reduces the amount of flows you'll end up with, as explained in https://forum.athom.com/discussion/comment/13123.
I have a variable called "Local_Time_Setting" that contains a time and date stamp (2016-03-07T17:30:27+00:00) and I want something to happen when the local time becomes 17:30. So a flow runs a check every minute to see if the current time (hh:mm) matches the time stamp in the variable.
Like this ("time" is the token from the date and time card):
I'm assuming the little red cross, which only shows up when I hit the test button, does not mean "all is well"
To be sure, I wrote the output of the Time token to another variable, and it is just "hh:mm".
@Uranday You already have "text contains" condition flow card, but could you add a "text starts with" condition flow card as well?
In combination with for instance the iCalendar to Voice App that would enable some powerful scheduling. It would help us to create schedules with events that would trigger flows based on their respective summary prefixes.
Can do. Will put it in the next release.
Patrick
Example: a Fibaro Motion sensor also senses the luminance. It's value card (when luminance change) is a string, although containing only numbers. A BetterLogic number will not accept the value.
I'd like to do "greater than" and "less than" comparisons to switch on/off lights based on that.
The Homey built-in logic seems to be able to do the comparisons, but if it can be done in BetterLogic as well, then I can have all my logic into one place. That's more logic ;-)
But for my understanding, are you looking for ad hoc checks... Output of card against an inputted value in the condition? Droptoken => 3.
Or do you want to check the output of a card against a variable? So VarA=3 and a condition that says droptoken => VarA
That's already possible with the set a variable that converts it if possible.
When I add a new variable in BetterLogic, I need to choose between:
"String"
"number"
"Boolean"
String is the only variable that accepts the output of the card. But then I cannot compare it with 'greater than' or 'less than' logic from the BetterLogic app, that only works for numbers.
You can then use that variable in a > or < card.