> For the complete documentation index, see [llms.txt](https://homey.solweb.no/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://homey.solweb.no/aggregated-state/home-state.md).

# Home state

One of the most important states of my home is whether or not there is anyone at home.

I've created a boolean logic variable `home`for this purpose.

### Person presence

I got one boolean presence variable for each person with the Homey app. See more information on [Person presence](/aggregated-state/person-presence.md).

### Guests

Often we have guests that stays for several days, and they may be at home even if none of us are present.

I've added a **virtual device** for Guests present. Each morning I get a notification if the visitor flag is turned on, to make sure I flip it off if the guests are gone. I've mapped the virtual device for guests to a boolean flag along with the other boolean presence variables.

### Aggregated state

![](https://1587494504-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Ltn3vQOSB-YGC6qLZu_%2F-Ltn_GQa-ANFYJmzEJik%2F-LtnahAKhbAW1qP6SiEo%2FSkjermbilde%202019-11-16%20kl.%2010.45.54.png?alt=media\&token=2bdd28df-0071-4fb2-b69d-d6723dd145f6)

Note: `presence-besok`, is norwegian, and it translates to presence-guests.

### Fall back when someone arrives home

As a fall back if someone arrives back at home, without the presence working properly, or if the kids enter home before the parents, I explicitly flip `home` to true always when the door lock opens.

![](https://1587494504-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Ltn3vQOSB-YGC6qLZu_%2F-Ltn_GQa-ANFYJmzEJik%2F-LtnbU9geVx6O-l6PdMS%2FSkjermbilde%202019-11-16%20kl.%2010.49.18.png?alt=media\&token=4fb78094-9f14-475e-8359-5503956f3a0f)
