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.

Flow variables

EmileEmile Administrator, Athom

Really adding nice little things to Homey, like variables within flows:

Flow 1:

Flow 2:

Variables can be text or a number, and are persistent (survives a power loss)

Comments

  • ErikVanDongenErikVanDongen Member
    edited November 2015

    Nice! Is it possible to calculate with variables? Like:

    • Take the average humidity of all humidity sensors on the first floor and put this in variable1
    • If humidity in bathroom is at least 5% above variable1 then activate bathroom ventilation

    (I use this scenario with my existing controller)

  • EmileEmile Administrator, Athom
    edited November 2015

    That's a great suggestion! I could parse some math, for example by starting a textfield with a '=' symbol like Excel.

  • Clever idea! A proper tweaker function!

  • EmileEmile Administrator, Athom

    Whoop, got math working!

  • Emile said:
    Whoop, got math working!

    Great!! It will save me time writing some tiny specific apps. :).

  • ErikVanDongenErikVanDongen Member
    edited November 2015

    Now you're in a flow.. I think it's handy if we could put datetime or epoch values in a variable. Together with math we can fulfill a lot of the time-scenario requirements.
    Example:

    • flow 1. If person leaves home and everybody is not home then put date/time in variable1
    • flow 2. If person enters home and person is the only person home then put (now - variable1) / 1000 / 60 in variable2
    • flow 3. If variable2 changed then say 'I missed you for ' + variable2 + ' minutes.'
  • EmileEmile Administrator, Athom

    Haha, nice. Little bit complicated though. I'll think about it :-)

    Just got the idea to make variables globally accessible the linux way: $var, but this could also be a system variable like $TIME.. gonna think deeply about this!

  • I assume these variables are available by the API? That way apps can make there variables available for things like this. Well, lets sleep on it. Have a good one!

  • EmileEmile Administrator, Athom

    Nope, not really, they stay within the Flow editor. However, those black tags you see hanging on the cards, those can be supplied by apps!

  • Cool, looks nice and it is so useful :-)

  • If you keep adding stuff like this over time, Homey is gonna be really awesome (or even more awesome then it already is) :-)

  • Maybe I didn't get it but are variables reachable across different flows?

  • RobinVanKekem said:
    Maybe I didn't get it but are variables reachable across different flows?

    Yes, that's what he said. Flow 1 can set a variable, flow 2 can check on it (see also the OP).

  • Global variables might be nice, but you could also use a dummy device to store the variable.

    Example 1: Make the "living room" device and assign a temperature variable to it. When my thermostat temperature or my secondary temperature sensor changes, each would update the living room's temperature variable.

    Example 2: Make a "delta humidity" device with a humidity percentage variable. It will contain the difference between the indoor and outdoor humidity.

    Perhaps some more advanced stuff could be done when manually duplicating each sensor with a neural node sensor which calculates the desired temperature and light setting based on various weighted factors (how many people and who exactly are in the room, what's the indoor/outdoor temperature, what's the time of day, day of the year, etc.) Then, Homey could ask once in awhile if the temperature is right and based on the answer evolve the "AI".

  • Not completely on this topic, but will it be possible to group flowlines so there is more space on the screen. Something like all light/scene for a specific room are on one page and for another room on another page?
    Variables maybe local to the page but also other variable global.

  • EmileEmile Administrator, Athom

    Flows can be grouped in the flow selection dialog. Most (if not all) of Homey's intelligence is provided by flows that we already ship!

  • nice, I have now a razberry and the number of acive flows (apps) is already getting out of hand.
    You see all and the list is long

  • Is it an idea to drop some (screenshots of) scenarios that your team members have created in a thread? Some simple and a few more complex. I am sure it will answer (and maybe raise even more) questions on the flow editor.

  • Will there be a training (document) because there is so much possible?

  • OverlordOverlord Member
    edited November 2015

    Is it possible to group flows etc. Under a device. Like all the flows that the livingroom is using, or the kitchen. So you can dril down to the specific settings into a larger environment?
    (Edit sometimes hate my iPad spellchecker)

  • @overlord: I think your answer is about four posts above yours..

  • I hope Homey won't be a flop ;-)

  • kimror said:
    @overlord: I think your answer is about four posts above yours..

    Only half, but I'll see what they release in the software.
    @Emile - is there a way of getting the software so we can experiment with it?

  • I'm unable to create a flow with my fibaro motion sensor to set my lights in a room when it;'s getting darker???
    Has anyone a suggestion?
    thx for help.
  • WHEN triggercard Luminance for Motion Sensor change
    AND Lux is less then XXX
    THEN lights on

    :)
  • MarcoFMarcoF Member
    edited September 2016
    Damn your are quick and a very good find on the forum ;)
  • always search through google, never use the evil search-page here >:)
Sign In or Register to comment.