Welcome to the Athom Community Forum! This is a place to share ideas, ask for help and discuss about Homey in general.

Please read Welcome to the forum to get started.

[Beta] App for state 'sets'

eriks5eriks5 Member
edited June 22 in Apps
I have just pushed an app I created recently to GitHub and submitted it to the app store.

This app manages sets of states. For example, a state is "there has been motion". Using this app, multiple of these states can be combined in sets and flows triggered when one or more of the states in a set become active. For example, I use this in my flows to combine multiple sensors into a set, and trigger actions based on those sets. I have sets for motion sensors and daylight sensors in various rooms. Lights turn on in rooms when there is at least one motion state active in a motion set, and not all daylight states in the daylight set are active.

I created this because I just recently got a Homey and while converting my home-brew home automation system that I've had running for over 8 years to Homey flows I really missed the option to combine sensors. In my old system, I used sets like this for almost everything.

The GitHub repo can be found here: https://github.com/eriks5/org.scheffers.homey.sets and when approved, the app should also show up in the App store.

It's tagged 'beta' for now, because I'd love some feedback on the app, since it's my first Homey app it's still rough on the edges. It's been running for over a week on my Homey without any issues though.

Update 20-6: The app is now published in the store.

Update 22-6: Version 0.1.1 has been published to the store, this version fixes a crash that occurred when attempting to add a state without entering a name for it. It also adds an "auto restore" feature that restores your sets and states if the app settings get deleted.

Comments

  • eriks5eriks5 Member
    Yes, I have. But you can't easily combine multiple states into a single state with that one. I tried. It blew up in number of states needed. So I wrote this app.

    In most of my flows, some sensors update a set; a set update changes a statecontrol state, and finally statecontrol triggers the flows that update lights etc.
  • phil_sphil_s Member
    Great @eriks5
  • Isn't is a idea to combine those two apps? Probably better for memory and disk usage :)

    Nice app btw!
  • eriks5eriks5 Member
    Isn't is a idea to combine those two apps? Probably better for memory and disk usage :)

    The sets and statecontrol apps serve different purposes. Yes you can use them together, but that holds for most apps in the tools category. Combining them would make the resulting app a lot more complex though, both in implementation and usage. A few small, focused apps is better than one big complex app imho.


  • Nice Simple App - Thanks and much needed

    Looking forward to seeing some examples of how people are using it
  • EternityEternity Member
    @eriks5

    Interesting App!
    I use State Control too, and this will be a nice addition.
    Just installed the App and am able to create a state in the setting.

    What I aim for is to have a state "beweging in huis (movement in the house)", which is activated when 1 of my 5 motion sensors is activated. If that happens *and* nobody is home (as in; no Homey recognized person is home) an alarm is triggered.

    I am struggling to create the flows; would you be so kind to point me in the right direction... Thanks!
  • eriks5eriks5 Member
    What I aim for is to have a state "beweging in huis (movement in the house)", which is activated when 1 of my 5 motion sensors is activated. If that happens *and* nobody is home (as in; no Homey recognized person is home) an alarm is triggered.

    I am struggling to create the flows; would you be so kind to point me in the right direction... Thanks!
    Actually for alarms it's probably overkill; state sets are more useful for actions that have a clear "begin" and "end" (motion, but also doors that open, light sensors detecting light above certain threshold), and you want to combine several of these and want to have some actor (lights) enabled when one of the states become active until none of them are active anymore. Or when all of them have become active until some are inactive again. 

    With alarms, you're really just interested in the single event that motion was detected, you don't care when it ends.

    But you can do this by having 5 states in the set, one for each motion sensor. You'll need 5 flows to activate the states in the set (eg. if motion 1 triggers, activate state 'motion 1'). Since it's motion sensors and these usually trigger regularly as long as there is motion, I'd suggest using the "Activate state temporarily" activity, so for example keep the state active for 60 seconds. Because the way the flows are triggered, every time motion is detected, the timer is reset to 60 seconds and starts counting down again.

    If you don't want to use temporarily active states, you'll need 5 more flows to deactivate the individual states when the motion detector they represent stops seeing motion. 

    Then for alarms you'll need one more flow: when a state in the set becomes active, and nobody is home, trigger the alarm.

    For lights, you'll need two flows: one to turn the lights on when a state becomes active, and another to turn the lights off when no states are active in the set anymore.



  • EternityEternity Member
    Thanks! 
  • @eriks5
    I think you will do yourself a favour by doing a few examples in the first post or on github.. think it will save a lot of questions
  • eriks5eriks5 Member
    edited June 19
    @eriks5
    I think you will do yourself a favour by doing a few examples in the first post or on github.. think it will save a lot of questions
    Definitely need some good examples, but I haven't had time for this. In some ways still figuring out what's the best way to use it myself, I've only had my Homey for 3 weeks  B)
  • 0burner00burner0 Member
    Hmm can some one post some screenshots how to use this app in flows.
Sign In or Register to comment.