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] [Card] 'Everybody is sleeping or not at home'

kukeltjekukeltje Member
edited October 2017 in Questions & Help
I'm trying to create a flow that will turn off the TV and with a delay turn off all lights if 'someone' is the last person to go to sleep (and turn on the individual small light next to the bed).

For more than 2 people this turned out to become rather complex (ok, relatively complex)

There is a `Nobody is sleeping` with the negated `Someone is sleeping` but there is no `Everybody is sleeping` (at least I cannot find anything related to this).

I personally would expect that a `Nobody is sleeping` would negated be `Everybody is sleeping` and that there would be a `Someone is sleeping` with a negated `Someone is **not** sleeping` (or `Someone is awake`)

Having an `Everybody is sleeping` would be an optimization but when I was working on this, I came to the conclusion that not everybody needs to be home to be the last one to go to bed. So the number of permutations (4 people) that I needed to configure in multiple flows grew and while doable, it came to mind that effectively I needed an `Everybody is sleeping or not at home`.

I cannot seem to find apps that already have support for this, so before filing a feature request (or maybe even look if I could implement something like this myself), I thought I'd drop it here to see if someone encounterd the same issue and maybe did find a solution.

(Screendumps not available yet, sorry)


Comments

  • lubbertkramerlubbertkramer Member
    edited October 2017
    If you know how many people need to be a sleep you can count a var/better logic var that does +1 every time you use the card "a specific user went to sleep" in combination with "a specific user is awake/not at home" (note dont know how the english card is exactly because my Homeys are in Dutch).

    Next to that there is a card in the AND column that can be used for "nobody is sleeping/everybody are sleeping" (note also here don't know exactly how the English card looks like)

    But with above you can do IF user X goes to sleep ÄND a specific person is sleeping (your second person) then do your thing (maybe make some OR statements for your flows where you can do X person is sleeping OR x person is not at home :) )
  • Though I understand your question (the inverse of "nobody is sleeping" is "someone is sleeping" in Homey), I think this can easily be accomplished by using "a is sleeping" and "b is sleeping" and "c is sleeping" etc. Unless you're running a youth-hostel this will be the easiest way. You can even use some flows to create a global variable "everybody is sleeping" and use that one.

Sign In or Register to comment.