2.4 KiB
layout, title, description, date, sidebar, comments, sharing, footer, logo, ha_category, ha_release
layout | title | description | date | sidebar | comments | sharing | footer | logo | ha_category | ha_release |
---|---|---|---|---|---|---|---|---|---|---|
page | OpenWRT | Instructions on how to integrate OpenWRT routers into Home Assistant. | 2018-03-09 12:00 | true | false | true | true | openwrt.png | Presence Detection | pre 0.7 |
There are multiple ways of integrating an OpenWRT router for presence detection. A broad distinction can be made between presence detection methods which actively scan for devices (by default every 12 seconds) and those that are notified by some external service on changes. It is essentially a problem of synchronizing states between two remote machines.
- active scanning
Scan for devices regularly. - passive/event-based
External services which notify Home Assistant of devices via the REST API endpoint.- Advantages:
- devices typically registered in under one second when they connect
- very few network requests
- Disadvantages:
- prone to missed events when connectivity between Home Assistant and the router is not guaranteed
- Examples:
- openwrt_hass_devicetracker
- your own custom script
- Advantages:
{% linkable_title Event-based device tracker %}
This can be achieved by running a simple shell script on the OpenWRT router which calls the appropriate Home Assistant service. An OpenWRT package which does this is listed above. As this method directly calls the service API, no special configuration is necessary on the Home Assistant side, except for ensuring the device_tracker API is running, which is achieved by adding the following to your configuration.yaml
file:
device_tracker:
To get the best of both worlds, you can combine the two approaches, running both a periodic device scanner and an event-based device tracker.
See the device tracker component page for instructions how to configure the people to be tracked.