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.
How to get access to "time" in the "then" part of a flow
hekstman
Member
I am trying to get homey say the time at the end of a flow and do not seem to be able to see how to do that.
Very simple I start a flow with saying "goodmorning" and I want homey to come back with "Goodmorning the time is 'time'"
I know there is a buildin command to get the time, but is there a way to get access to the buildin time variable in a flow? It seems you get only access to the "time" variable if you use the 'watch' flow element as the initiator of the flow but that is not what I want.
Thanks for any help
Very simple I start a flow with saying "goodmorning" and I want homey to come back with "Goodmorning the time is 'time'"
I know there is a buildin command to get the time, but is there a way to get access to the buildin time variable in a flow? It seems you get only access to the "time" variable if you use the 'watch' flow element as the initiator of the flow but that is not what I want.
Thanks for any help
Comments
Flow 1:
When: Date & Time card, every 1 minute
Then: Set a variable "time" <time token from D&T card in the When column>
Flow 2:
When: You said something, "Good morning"
Then: Say something, "Good morning, the time is {{$time}}"
Here I got a long string of numbers incrementing by one, maybe we shouldn't call the variable "time", so try a different name. But I'm sure it's something along the lines of the above two flows. Have fun!
https://forum.athom.com/discussion/comment/18949/#Comment_18949
But time isn't an integer so don't know if that works?
So we have to get rid of the colon somehow
Edit: almost there, if you put this: "The time is {{$Time[0]}}" it reads out the time, followed by a 0.
I would have expected it to read out the first member of the array (so the hour), but no.
So square bracket open, square bracket close after $Time. That reads out the correct time.
"de tijd is dollar time komma"
What am i doin wrong?
Maybe something goes wrong with creating the variable. While creating the variable all my varaible's was gone!
So made a new variable. First created a number variable but that did not get the time stamp right. It got 14 instead of 14:22. Then i made a string variable .
Use the built in Logic card in Flow 1.
Cheers m8!
It still says the komma btw
Check Flow 1 where you fill the Time variable and make sure it doesn't have a comma at the end.
It now say's: "de tijd is nul negen komma"
Now is say's: "de tijd is vijftien uur komma"
And now: "de tijd is vijftien uur dertien komma"
It could also be a localization issue - my Homey is set to English.
My Homey is set to dutch, maybe that's an issue. Gonna try it in english setup.
Weird.
<edit> When set back to dutch the komma is back.
And not goin to open a ticket for it, they have better things to do atm me guess.
<<edit>> That works, cheers!
Things like temperature, wind and hourly forecasts you can get from wunderground.com (go there and get a free API key) and then query with a HTTP flow chart (install https://apps.athom.com/app/com.internet).
Here's an example on how to get the current temperature:
Flow 1:
When: Every Hour
Then:
Get Variable Step 1:
Box 1: http://api.wunderground.com/api/<your key>/conditions/q/<your location>.json
Box 2: {}
Box 3: $.current_observation.temp_c
Box 4: updateTemp
Flow 2:
When: Get Variable Step 2 , updateTemp
Then: Logic <yourTempVariable> <value token from Get Variable Step 2 in the When column>
You can then use {{$yourTempVariable}} to use the current temperature at your location.
To see all the other weather based information you can get, have a look at https://www.wunderground.com/weather/api/d/docs?d=index.
In Dutch too?
Can you post a screenshot of the flow(s) ?
Flow 1
Flow 2
My Flow 1 gets three components (weather forecast, temperature and what the temperature feels like), so your flow may have a different number of items in the Then column
From any other flow, you can use {{$varYouUsedInFlow2ThenColumn}} to access the value of the variable you populated in Flow 2 (homeyTemperature in my example).
Gonna install that when my Homey is back online.