# 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

![](/files/-LtnahAKhbAW1qP6SiEo)

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.

![](/files/-LtnbU9geVx6O-l6PdMS)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://homey.solweb.no/aggregated-state/home-state.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
