Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/maxgeilert/room-occupancy
Occupancy tracking script for home assistant
https://github.com/maxgeilert/room-occupancy
Last synced: 7 days ago
JSON representation
Occupancy tracking script for home assistant
- Host: GitHub
- URL: https://github.com/maxgeilert/room-occupancy
- Owner: maxgeilert
- Created: 2021-08-07T11:15:12.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-01-22T10:39:54.000Z (almost 3 years ago)
- Last Synced: 2024-08-02T15:45:13.295Z (3 months ago)
- Language: Python
- Homepage:
- Size: 5.86 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# room-occupancy
## why
because I needed an propper way to manage the occupancy of my home. I tried a lot of other projects, but none of them really fits my needs.
## concepts
There are a few components to this script:
- the room that gets controlled (timer)
- entities_toggle: devices that can mark a room as occupied (motion sensors)
- entities_keep: devices that are only allowed to keep a room occupied (room-assistant, input booleans,..)
- active_states: a list of states that should be used to determin the state of a room (depending on your devices, e.g. active, on, True, roomname,..)
- automations to control lights/music (could be extended for hvac for example)The flow goes like this:
- automation triggers the python script every 10 seconds or if the motion sensor for that room gets triggered (the configuration is placed in that automation)
- the script then checks if the room is occupied already (timer is running)
- if yes, it checks every entity for its status and marks the room as occupied
- if not, it only checks entities defined in entities_toggle
- if it finds an active entity, it (re)starts the corresponding timer## stuff you should create
For my setup I use the following helpers and entities:
- timer for each room
- overwrite toggle (input boolean) for each room
- room-assistant with a Pi in every room, measuring distances to our watches via bluetooth
- one or more motion sensors in each room
- automation for each room to run this script
- followup automations which are checking for the timer state and toggle lights/music/whatever you like