
* build(deps-dev): bump sorbet-runtime from 0.5.11549 to 0.5.11551 (#34487) Bumps [sorbet-runtime](https://github.com/sorbet/sorbet) from 0.5.11549 to 0.5.11551. - [Release notes](https://github.com/sorbet/sorbet/releases) - [Commits](https://github.com/sorbet/sorbet/commits) --- updated-dependencies: - dependency-name: sorbet-runtime dependency-type: indirect update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * build(deps-dev): bump google-protobuf from 4.27.4 to 4.28.0 (#34488) Bumps [google-protobuf](https://github.com/protocolbuffers/protobuf) from 4.27.4 to 4.28.0. - [Release notes](https://github.com/protocolbuffers/protobuf/releases) - [Changelog](https://github.com/protocolbuffers/protobuf/blob/main/protobuf_release.bzl) - [Commits](https://github.com/protocolbuffers/protobuf/commits) --- updated-dependencies: - dependency-name: google-protobuf dependency-type: indirect update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add limitations section to Enmax integration (#34493) Enmax Energy only publishes monthly data via Opower, make a note in the documentation * build(deps-dev): bump ruby-lsp from 0.17.16 to 0.17.17 (#34496) Bumps [ruby-lsp](https://github.com/Shopify/ruby-lsp) from 0.17.16 to 0.17.17. - [Release notes](https://github.com/Shopify/ruby-lsp/releases) - [Commits](https://github.com/Shopify/ruby-lsp/compare/v0.17.16...v0.17.17) --- updated-dependencies: - dependency-name: ruby-lsp dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * build(deps-dev): bump sorbet-runtime from 0.5.11551 to 0.5.11553 (#34497) Bumps [sorbet-runtime](https://github.com/sorbet/sorbet) from 0.5.11551 to 0.5.11553. - [Release notes](https://github.com/sorbet/sorbet/releases) - [Commits](https://github.com/sorbet/sorbet/commits) --- updated-dependencies: - dependency-name: sorbet-runtime dependency-type: indirect update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Locked out: add screencast of auth reset (#34499) * Locked out: add screencast of auth reset * Update steps to point to Green and Yellow reset procedures * Fix copy paste error * Update clip * Fix video to show standard port * Fix typo in "default sentences" documentation (#34528) * Add missing quote (#34519) Signed-off-by: Matthias Beyer <mail@beyermatthias.de> * Fix opentherm_gw gpio modes (#34501) * home connect: Update links for registering an app and logging out (#34508) * Update links for registering an app and logging out * Update link * Update source/_integrations/home_connect.markdown Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * tiny tweaks --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: c0ffeeca7 <38767475+c0ffeeca7@users.noreply.github.com> * build(deps-dev): bump rubocop from 1.65.1 to 1.66.0 (#34535) Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.65.1 to 1.66.0. - [Release notes](https://github.com/rubocop/rubocop/releases) - [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop/rubocop/compare/v1.65.1...v1.66.0) --- updated-dependencies: - dependency-name: rubocop dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * build(deps-dev): bump logger from 1.6.0 to 1.6.1 (#34536) Bumps [logger](https://github.com/ruby/logger) from 1.6.0 to 1.6.1. - [Release notes](https://github.com/ruby/logger/releases) - [Commits](https://github.com/ruby/logger/compare/v1.6.0...v1.6.1) --- updated-dependencies: - dependency-name: logger dependency-type: indirect update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * home connect: Add instructions for getting the client ID and secret (#34509) * home connect: Add instructions for getting the client ID and secret * Update home_connect.markdown * Update home_connect.markdown * tiny tweak --------- Co-authored-by: c0ffeeca7 <38767475+c0ffeeca7@users.noreply.github.com> * Document prerequisites for Webmin integration (#34515) * Update webmin.markdown Add details about prerequisites (installing XML::Parser), add additional context for user account creation, update phrasing of existing content * Minor tweaks for verbiage, proper markdown * Additional readability improvements for Webmin * Fix odd wording in Webmin account benefits "allows for" might imply that a separate account is automatically more secure; switching to "can allow for" to instead imply that things can be made more granular if desired. * Update source/_integrations/webmin.markdown Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Tiny style tweaks --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: c0ffeeca7 <38767475+c0ffeeca7@users.noreply.github.com> * ubus.markdown: fix JSON syntax (#34522) * Update unifiprotect.markdown with information about event for doorbell (#34537) * Update unifiprotect.markdown with information about event for doorbell Add more information about the event entity when a doorbell is rang. * Tiny tweak --------- Co-authored-by: c0ffeeca7 <38767475+c0ffeeca7@users.noreply.github.com> * Add Enphase_envoy prerequisites (#34539) * Add Enphase_envoy prerequisites * Implement review suggestions Co-authored-by: c0ffeeca7 <38767475+c0ffeeca7@users.noreply.github.com> * Remove links to custom integrations --------- Co-authored-by: c0ffeeca7 <38767475+c0ffeeca7@users.noreply.github.com> * build(deps-dev): bump rubocop-ast from 1.32.1 to 1.32.2 (#34547) Bumps [rubocop-ast](https://github.com/rubocop/rubocop-ast) from 1.32.1 to 1.32.2. - [Release notes](https://github.com/rubocop/rubocop-ast/releases) - [Changelog](https://github.com/rubocop/rubocop-ast/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop/rubocop-ast/compare/v1.32.1...v1.32.2) --- updated-dependencies: - dependency-name: rubocop-ast dependency-type: indirect update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Enable entity (#34550) * Enable a single entity from device page * Add related topic * Add term ref * Add missing step * Add some background info why entities are disabled by default * Rephrase * Fix typo * Fix typo in google_translate (#34552) * New WWHA blog upload (#34551) * New WWHA blog upload * Update source/_posts/2024-09-03-aqara-joins-works-with-home-assistant.markdown --------- Co-authored-by: Gord <31004434+googanhiem@users.noreply.github.com> * Split august and yale integrations (#33890) * Add yale integration This PR should not merge until the integration branch in https://github.com/home-assistant/core/pull/122253 is complete * Update source/_integrations/yale.markdown * Tiny tweaks * Apply suggestions from code review * review comments * Apply suggestions from code review * Update source/_integrations/yale.markdown * Update source/_integrations/yale.markdown * Apply suggestions from code review * Update source/_integrations/yale.markdown --------- Co-authored-by: c0ffeeca7 <38767475+c0ffeeca7@users.noreply.github.com> * Simple Fin - Add Problem Sensor Documentation (#33979) * Adding the problems ensor * Tweaks --------- Co-authored-by: c0ffeeca7 <38767475+c0ffeeca7@users.noreply.github.com> * Redirect virtual integration yale_home to point to yale (#34482) * Remove Yale (Assa Abloy) devices from the august integration docs (#34484) * Remove Yale (Assa Abloy) devices from the august integration docs The new yale integration should be used for these devices instead * Remove Assa Abloy note since August is now owned by FBIN * Change entity badge display type to 3 booleans : name, state and icon (#34503) * Remove KNX free-online-training paragraph (#34531) * build(deps-dev): bump sorbet-runtime from 0.5.11553 to 0.5.11554 (#34561) Bumps [sorbet-runtime](https://github.com/sorbet/sorbet) from 0.5.11553 to 0.5.11554. - [Release notes](https://github.com/sorbet/sorbet/releases) - [Commits](https://github.com/sorbet/sorbet/commits) --- updated-dependencies: - dependency-name: sorbet-runtime dependency-type: indirect update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * build(deps): bump mustermann from 3.0.2 to 3.0.3 (#34562) Bumps [mustermann](https://github.com/sinatra/mustermann) from 3.0.2 to 3.0.3. - [Commits](https://github.com/sinatra/mustermann/compare/v3.0.2...v3.0.3) --- updated-dependencies: - dependency-name: mustermann dependency-type: indirect update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * build(deps-dev): bump rexml from 3.3.6 to 3.3.7 (#34563) Bumps [rexml](https://github.com/ruby/rexml) from 3.3.6 to 3.3.7. - [Release notes](https://github.com/ruby/rexml/releases) - [Changelog](https://github.com/ruby/rexml/blob/master/NEWS.md) - [Commits](https://github.com/ruby/rexml/compare/v3.3.6...v3.3.7) --- updated-dependencies: - dependency-name: rexml dependency-type: indirect update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * build(deps-dev): bump sass-embedded from 1.77.8 to 1.78.0 (#34564) Bumps [sass-embedded](https://github.com/sass-contrib/sass-embedded-host-ruby) from 1.77.8 to 1.78.0. - [Commits](https://github.com/sass-contrib/sass-embedded-host-ruby/compare/v1.77.8...v1.78.0) --- updated-dependencies: - dependency-name: sass-embedded dependency-type: indirect update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Event docs and integration: add related links (#34569) * State trigger: rephrase (#34571) * State trigger: rephrase * Add intro text to example * Light: add section on states (#34573) * Update release notes for 2024.9 * Update 2024-09-04-release-20249.markdown * Update 2024-09-04-release-20249.markdown * Update 2024-09-04-release-20249.markdown * Update 2024-09-04-release-20249.markdown * update images * address comments * Update 2024-09-04-release-20249.markdown * Apply suggestions from code review Co-authored-by: c0ffeeca7 <38767475+c0ffeeca7@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: c0ffeeca7 <38767475+c0ffeeca7@users.noreply.github.com> * suggestions * Apply suggestions from code review Co-authored-by: c0ffeeca7 <38767475+c0ffeeca7@users.noreply.github.com> --------- Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: Matthias Beyer <mail@beyermatthias.de> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: iomartin <iomartin@users.noreply.github.com> Co-authored-by: c0ffeeca7 <38767475+c0ffeeca7@users.noreply.github.com> Co-authored-by: Stuart Holland <soulc3@gmail.com> Co-authored-by: Matthias Beyer <mail@beyermatthias.de> Co-authored-by: mvn23 <schopdiedwaas@gmail.com> Co-authored-by: Max R <mxr@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: kylehakala <kylehakala@users.noreply.github.com> Co-authored-by: René Kliment <rene@renekliment.cz> Co-authored-by: darkrain-nl <24763370+darkrain-nl@users.noreply.github.com> Co-authored-by: Arie Catsman <120491684+catsmanac@users.noreply.github.com> Co-authored-by: Luca Angemi <luca.angemi@gmail.com> Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com> Co-authored-by: Gord <31004434+googanhiem@users.noreply.github.com> Co-authored-by: J. Nick Koston <nick@koston.org> Co-authored-by: Jeef <jeeftor@users.noreply.github.com> Co-authored-by: Paul Bottein <paul.bottein@gmail.com> Co-authored-by: Matthias Alphart <farmio@alphart.net>
9.3 KiB
title, description, ha_category, ha_release, ha_iot_class, ha_domain, ha_platforms, ha_integration_type, related
title | description | ha_category | ha_release | ha_iot_class | ha_domain | ha_platforms | ha_integration_type | related | |||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
OpenWrt (ubus) | Instructions on how to integrate OpenWRT routers into Home Assistant. |
|
0.7.6 | Local Polling | ubus |
|
integration |
|
This is a presence detection scanner for OpenWrt using ubus. It scans for changes in hostapd.*
, which will detect and report changes in devices connected to the access point on the router.
Before this scanner can be used, you have to install the ubus RPC packages on OpenWrt (versions older than 18.06.x do not require the uhttpd-mod-ubus
package):
opkg update
opkg install rpcd-mod-file uhttpd-mod-ubus
Add a new system user hass
(or do it in any other way that you prefer):
- Add line to /etc/passwd: hass❌10001:10001:hass:/var:/bin/false
- Add line to /etc/shadow: hass❌0:0:99999:7:::
Edit the /etc/config/rpcd
and add the following lines:
config login
option username 'hass'
option password '$p$hass'
list read hass
list read unauthenticated
list write hass
Then, create an ACL file at /usr/share/rpcd/acl.d/hass.json
for the user hass
:
{
"hass": {
"description": "Access role for OpenWrt ubus integration",
"read": {
"ubus": {
"hostapd.*": ["get_clients"],
"uci": ["get"]
}
},
"write": {}
}
}
Restart the services. This ACL file needs to be recreated after updating/upgrading your OpenWrt firmware.
# /etc/init.d/rpcd restart && /etc/init.d/uhttpd restart
Check if the file
namespaces is registered with the RPC server.
# ubus list | grep file
file
After this is done, add the following to your {% term "configuration.yaml
" %} file.
{% include integrations/restart_ha_after_config_inclusion.md %}
# Example configuration.yaml entry
device_tracker:
- platform: ubus
host: ROUTER_IP_ADDRESS
username: YOUR_ADMIN_USERNAME
password: YOUR_ADMIN_PASSWORD
{% configuration %}
host:
description: The IP address of your router, e.g., 192.168.1.1.
required: true
type: string
username:
description: The username of a user with administrative privileges, usually root
.
required: true
type: string
password:
description: The password for your given admin account.
required: true
type: string
dhcp_software:
description: "The DHCP software used in your router: dnsmasq
, odhcpd
, or none
."
required: false
default: dnsmasq
type: string
{% endconfiguration %}
See the device tracker integration page for instructions how to configure the people to be tracked.
Troubleshooting
If you find that this never creates known_devices.yaml
, or if you need more information on the communication chain between Home Assistant and OpenWrt, follow these steps to grab the packet stream and gain insight into what's happening.
Increase log level
-
On your Home Assistant device, stop Home Assistant
-
Adjust {% term "
configuration.yaml
" %} to log more detail for thedevice_tracker
integration.logger: default: warn logs: homeassistant.components.device_tracker: debug
-
In another window, tail the logfile in the configuration directory:
tail -f home-assistant.log | grep device_tracker
-
If you see a Python stack trace like the following, check your configuration for correct username/password.
17-04-28 10:43:30 INFO (MainThread) [homeassistant.loader] Loaded device_tracker from homeassistant.components.device_tracker 17-04-28 10:43:30 INFO (MainThread) [homeassistant.loader] Loaded device_tracker.ubus from homeassistant.components.device_tracker.ubus 17-04-28 10:43:30 INFO (MainThread) [homeassistant.setup] Setting up device_tracker 17-04-28 10:43:31 INFO (MainThread) [homeassistant.components.device_tracker] Setting up device_tracker.ubus 17-04-28 10:43:31 ERROR (MainThread) [homeassistant.components.device_tracker] Error setting up platform ubus File "/opt/homeassistant/venv/lib/python3.4/site-packages/homeassistant/integrations/device_tracker/__init__.py", line 152, in async_setup_platform File "/opt/homeassistant/venv/lib/python3.4/site-packages/homeassistant/integrations/device_tracker/ubus.py", line 36, in get_scanner File "/opt/homeassistant/venv/lib/python3.4/site-packages/homeassistant/integrations/device_tracker/ubus.py", line 58, in __init__ File "/opt/homeassistant/venv/lib/python3.4/site-packages/homeassistant/integrations/device_tracker/ubus.py", line 156, in _get_session_id File "/opt/homeassistant/venv/lib/python3.4/site-packages/homeassistant/integrations/device_tracker/ubus.py", line 147, in _req_json_rpc 17-04-28 10:43:31 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: domain=device_tracker, service=see> 17-04-28 10:43:31 INFO (MainThread) [homeassistant.core] Bus:Handling <Event component_loaded[L]: component=device_tracker>
-
If you see lines like the following repeated at intervals that correspond to the check interval from the configuration (12 seconds by default), then Home Assistant is correctly polling the router, and you'll need to look at what the router is sending back.
17-04-28 10:50:34 INFO (Thread-7) [homeassistant.components.device_tracker.ubus] Checking ARP
Inspect packets with TCPDump
These steps require that tcpdump
is installed on your Home Assistant device, and that you have a utility such as Wireshark for viewing the packets. It also assumes that Home Assistant is communicating with your router over HTTP and not HTTPS.
-
On your Home Assistant device, stop Home Assistant
-
In another shell on your Home Assistant device, start tcpdump
sudo tcpdump -nnvXSs 0 -w /var/tmp/dt.out 'host <router_ip> and port 80'
- In this example we are only looking for traffic to or from port 80, and we are writing the packet stream out to
/var/tmp/dt.out
- In this example we are only looking for traffic to or from port 80, and we are writing the packet stream out to
-
Start Home Assistant
-
After a few seconds you should see a line like
Got xx
wherexx
is an incrementing number. This indicates that it has captured packets that match our filter. After you see this number increment a few times (>20), you can hitCtrl-C
to cancel the capture. -
Transfer
/var/tmp/dt.out
to the machine where you're running Wireshark and either drag/drop it onto the Wireshark window or use File/Open to open the capture file. -
In the window that opens, look for the first line that reads
POST /ubus
. Right click on this line, choose Follow and then HTTP Stream to view just the HTTP stream for this connection. -
The first
POST
will show Home Assistant logging into ubus and receiving a session identifier back. It will look something like this:POST /ubus HTTP/1.1 Host: 10.68.0.1 Accept: */* User-Agent: python-requests/2.13.0 Connection: keep-alive Accept-Encoding: gzip, deflate Content-Length: 161 {"jsonrpc": "2.0", "params": ["00000000000000000000000000000000", "session", "login", {"password": "<password>", "username": "root"}], "method": "call", "id": 1} HTTP/1.1 200 OK Content-Type: application/json Transfer-Encoding: chunked Connection: keep-alive {"jsonrpc":"2.0","id":1,"result":[0,{"ubus_rpc_session":"8b4e1632389fcfd09e96a792e01c332c","timeout":300,"expires":300,"acls":{"access-group":{"unauthenticated":["read"],"user":["read"]},"ubus":{"*":["*"],"session":["access","login"]},"uci":{"*":["read"]}},"data":{"username":"root"}}]}
-
In the response above, the portion that reads
"result":[0,
indicates that ubus accepted the login without issue. If this is not0
, search online for what ubus status corresponds to the number you're receiving and address any issues that it brings to light. -
Otherwise, back in the main Wireshark window click the
x
in the right side of the filter bar where it readstcp.stream eq 0
. Scroll down until you find the nextPOST /ubus
line and view the HTTP stream again. This request is Home Assistant actually requesting information and will look something like the following:POST /ubus HTTP/1.1 Host: 10.68.0.1 Accept: */* User-Agent: python-requests/2.13.0 Connection: keep-alive Accept-Encoding: gzip, deflate Content-Length: 114 {"jsonrpc": "2.0", "params": ["8b4e1632389fcfd09e96a792e01c332c", "hostapd.*", "", {}], "method": "list", "id": 1} HTTP/1.1 200 OK Content-Type: application/json Transfer-Encoding: chunked Connection: keep-alive {"jsonrpc":"2.0","id":1,"result":{}}
-
In this case we are actually receiving a valid response with no data. The request says that we are looking for ARP information from
hostapd.*
, which is the access point on the router. In my environment I don't use the AP on the router, and so it was correctly returning no data. Armed with this information, I know that I cannot use this integration for device tracking or presence.
Cleanup
When you're done troubleshooting, remember to reset your logging configuration and delete any capture files that contain sensitive information.