From d03e67ad8e144ffe167b9df109f51fe4666ae291 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Mon, 16 Sep 2019 21:50:09 +0300 Subject: [PATCH 1/4] Modernize Huawei LTE, add config entry support, unauthenticated mode etc --- source/_integrations/huawei_lte.markdown | 187 +++++++++-------------- 1 file changed, 70 insertions(+), 117 deletions(-) diff --git a/source/_integrations/huawei_lte.markdown b/source/_integrations/huawei_lte.markdown index 601d271afc72..2cd3719a30e4 100644 --- a/source/_integrations/huawei_lte.markdown +++ b/source/_integrations/huawei_lte.markdown @@ -1,6 +1,6 @@ --- -title: "Huawei LTE Routers" -description: "Instructions on how to integrate Huawei LTE routers with Home Assistant." +title: "Huawei LTE" +description: "Instructions on how to integrate Huawei LTE router and modem devices with Home Assistant." logo: huawei.svg ha_category: - Network @@ -11,18 +11,57 @@ ha_release: 0.79 ha_iot_class: Local Polling --- -The Huawei LTE router integration for Home Assistant allows you to observe and control [Huawei LTE routers](https://consumer.huawei.com/en/smart-home/). +The Huawei LTE router and modem integration for Home Assistant allows you to observe and control [Huawei LTE devices](https://consumer.huawei.com/en/smart-home/). -There is currently support for the following device types within Home Assistant: +There is currently support for the following platforms within Home Assistant: -- [Presence Detection](#presence-detection) - a device tracker for connected devices -- [Notifications](#notifications) -- [Sensor](#sensor) - with device, signal, and traffic information - -All platform requires you to have set up the [Huawei LTE component](#configuration). +- Presence detection - device tracker for connected devices +- Notifications - via SMS +- Sensors - device, signal, and traffic information ## Configuration +The integration can be enabled in two ways, either using the frontend, +or using YAML. + +The integration can be run with or without +authentication. Authenticated mode enables all available integration +features, but may interfere with accessing the device web interface +from another source such as a browser while the integration is active, +or vice versa. The exact list of features requiring authentication to +work varies by device and firmware version. The integration will try +to use all configured ones and fail gracefully if it detects one +requiring authentication in unauthenticated mode. + +Newly discovered entities from this integration are disabled by +default. This is because the target provide for a large amount of +entities, and fetching info for all of them requires multiple HTTP API +calls to the device. To keep the number of these calls at minimum, +keeping also in mind the above mentioned authentication conflicts they +may cause, API accesses are made only for enabled entities. + +Support for different categories of information and thus available +entities varies by device model and firmware version. + +### Configuration via the frontend + +Menu: **Configuration** -> **Integrations**. + +Click on the `+` sign to add an integration and click on **Huawei +LTE**, and follow the configuration flow. After finishing, the Huawei +LTE integration will be available. + +To use unauthenticated mode, leave username and password empty. The +integration will then attempt to first use empty strings to +authenticate, and fall back to unauthenticated mode in case that +fails. If this process does not yield desired results, the YAML +configuration (see below) is available for more fine grained control. + +Default list of notification recipient phone numbers can be set using +the integration's configuration options. + +### Configuration via YAML + To enable the component, add the following lines to your `configuration.yaml` file: @@ -32,130 +71,44 @@ huawei_lte: - url: http://192.168.100.1/ username: YOUR_USERNAME password: YOUR_PASSWORD + notify: + recipient: "+15105550123" ``` +For routers configured via the UI, each configuration item for the +same router in YAML overrides and updates the values set in UI +whenever the YAML configuration values are introduced or updated. {% configuration %} url: - description: URL of the router web interface. + description: URL of the device web interface. Typically http://192.168.100.1/ or http://192.168.1.1/ required: true type: string username: - description: The username used for the router web interface. - required: true + description: The username used for the device web interface in authenticated mode. Typically `admin`, or empty string (`""`) for USB stick modems. To use unauthenticated mode, leave this variable out altogether. + required: false type: string password: - description: The password used for the router web interface. - required: true + description: The password used for the device web interface in authenticated mode. Typically empty string (`""`) for USB stick modems. To use unauthenticated mode, leave this variable out altogether. + required: false type: string +notify: + description: Enable notifications using SMS messages. To use notifications, please see the [getting started with automation page](/getting-started/automation/). + required: false + type: map + keys: + recipient: + description: The phone number of a default recipient or a list with multiple recipients. + required: false + type: [string, list] {% endconfiguration %} -### Tested routers +### Tested devices -Routers we know to be working with this integration based on the documentation of used libraries and reports by users: +Devices we know to be working with this integration based on the [documentation of used libraries](https://github.com/Salamek/huawei-lte-api/#huawei-lte-api) and reports by users: - Huawei B310s-22 - Huawei B525s-23a - Huawei E5186s-22a - Huawei B618 -This is not a complete list. The integration can probably connect to other Huawei LTE routers running similar firmware. - -## Presence Detection - -This platform offers presence detection by looking at connected devices to a [Huawei LTE router](https://consumer.huawei.com/en/smart-home/). - -To enable the sensor, add the following lines to your `configuration.yaml` file: - -```yaml -# Example configuration.yaml entry -device_tracker: - - platform: huawei_lte -``` - -See the [device tracker integration page](/integrations/device_tracker/) for instructions how to configure the people to be tracked. - -## Notifications - -The `huawei_lte` platform allows you to use a Huawei LTE router for notifications from Home Assistant. The messages will be sent as SMS text messages. - -```yaml -# Example configuration.yaml entry -notify: - - platform: huawei_lte - recipient: "+15105550123" -``` - -{% configuration %} -recipient: - description: The phone number of a default recipient or a list with multiple recipients. - required: true - type: [string, list] -name: - description: Setting the optional parameter `name` allows multiple notifiers to be created. The notifier will bind to the service `notify.NOTIFIER_NAME`. - required: false - default: notify - type: string -url: - description: The router to use. Not needed if you only have one. - required: false - type: string -{% endconfiguration %} - -To use notifications, please see the [getting started with automation page](/getting-started/automation/). - -## Sensor - -The `huawei_lte` sensor platform allows you to monitor Huawei LTE routers. - -The names for the item you want to monitor are dot separated paths to information returned by the router. The data set varies by router model. To see what your router provides, set logging level to debug and watch `homeassistant.components.huawei_lte` debug entries. The configuration variable description contains a few example paths just to illustrate the syntax. These may not be available on all routers or their semantics may differ, and there are quite likely many more that are not listed here. - -To enable the sensor, add the following lines to your `configuration.yaml` file: - -```yaml -# Example configuration.yaml entry -sensor: - - platform: huawei_lte - monitored_conditions: - - device_information.SoftwareVersion - - device_signal.rssi - - monitoring_traffic_statistics.CurrentDownloadRate - - monitoring_traffic_statistics.TotalConnectTime -``` - -{% configuration %} -monitored_conditions: - description: Defines the data to monitor as sensors. Defaults to a few generally available data items expected to be available on most boxes. - required: false - default: Below is indicated which conditions are the default. - type: list - keys: - device_information.SoftwareVersion: - description: Software version. - device_information.WanIPAddress: - description: WAN interface IPv4 address. - default: default - device_information.WanIPv6Address: - description: WAN interface IPv6 address. - device_signal.rsrq: - description: The signal RSRQ value. - default: default - device_signal.rsrp: - description: The signal RSRP value. - default: default - device_signal.rssi: - description: The signal RSSI value. - default: default - device_signal.sinr: - description: The signal SINR value. - default: default - monitoring_traffic_statistics.CurrentDownloadRate: - description: Current download rate, bytes/sec. - monitoring_traffic_statistics.CurrentUploadRate: - description: Current upload rate, bytes/sec. - monitoring_traffic_statistics.TotalUpload: - description: Total bytes uploaded since last reset. - monitoring_traffic_statistics.TotalDownload: - description: Total bytes downloaded since last reset. - monitoring_traffic_statistics.TotalConnectTime: - description: Total time connected since last reset. -{% endconfiguration %} +This is not a complete list. The integration can probably connect to other Huawei LTE devices running similar firmware. From 41e7114fc08ace1ddaa72560acf26af84e1933a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Fri, 11 Oct 2019 11:04:45 +0300 Subject: [PATCH 2/4] Note Huawei LTE no longer using known_devices.yaml --- source/_integrations/device_tracker.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/_integrations/device_tracker.markdown b/source/_integrations/device_tracker.markdown index ed6a3b952807..9fc1a6f4dfd6 100644 --- a/source/_integrations/device_tracker.markdown +++ b/source/_integrations/device_tracker.markdown @@ -64,7 +64,7 @@ Multiple device trackers can be used in parallel, such as [Owntracks](/integrati
-As of 0.94 `known_devices.yaml` is being phased out, and no longer used by all trackers. Depending on the integration you use this section may no longer apply. This includes the mobile app, OwnTracks, GeoFency, GPSLogger, and Locative. +As of 0.94 `known_devices.yaml` is being phased out, and no longer used by all trackers. Depending on the integration you use this section may no longer apply. This includes the mobile app, OwnTracks, GeoFency, GPSLogger, Locative, and Huawei LTE.
From 8f0a5da5668c2f4f06cc050d625cd823b245cacd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Thu, 24 Oct 2019 19:40:46 +0300 Subject: [PATCH 3/4] Update info about enabled/disabled entities --- source/_integrations/huawei_lte.markdown | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/source/_integrations/huawei_lte.markdown b/source/_integrations/huawei_lte.markdown index 2cd3719a30e4..d7c4a83998b5 100644 --- a/source/_integrations/huawei_lte.markdown +++ b/source/_integrations/huawei_lte.markdown @@ -26,19 +26,17 @@ or using YAML. The integration can be run with or without authentication. Authenticated mode enables all available integration -features, but may interfere with accessing the device web interface -from another source such as a browser while the integration is active, -or vice versa. The exact list of features requiring authentication to -work varies by device and firmware version. The integration will try -to use all configured ones and fail gracefully if it detects one -requiring authentication in unauthenticated mode. - -Newly discovered entities from this integration are disabled by -default. This is because the target provide for a large amount of -entities, and fetching info for all of them requires multiple HTTP API -calls to the device. To keep the number of these calls at minimum, -keeping also in mind the above mentioned authentication conflicts they -may cause, API accesses are made only for enabled entities. +features and entities, but may interfere with accessing the device web +interface from another source such as a browser while the integration +is active, or vice versa. The exact list of features requiring +authentication to work varies by device and firmware version. The +integration will try to use all configured ones and fail gracefully if +it detects one requiring authentication in unauthenticated mode. + +Only a subset of the entities provided by the target device by +default: WAN IP Address, RSRQ, RSRP, RSSI, and SINR LTE signal +information sensors, and device tracker entries. The rest are added to +the entity registry, but disabled by default. Support for different categories of information and thus available entities varies by device model and firmware version. From 02acad1f99547bbe1c36b517305169ce1ffd9f38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Thu, 24 Oct 2019 23:59:47 +0300 Subject: [PATCH 4/4] Note Huawei LTE mobile data switch support --- source/_integrations/huawei_lte.markdown | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/_integrations/huawei_lte.markdown b/source/_integrations/huawei_lte.markdown index d7c4a83998b5..9ee13f6657d2 100644 --- a/source/_integrations/huawei_lte.markdown +++ b/source/_integrations/huawei_lte.markdown @@ -7,6 +7,7 @@ ha_category: - Presence Detection - Notifications - Sensor + - Switch ha_release: 0.79 ha_iot_class: Local Polling --- @@ -18,6 +19,7 @@ There is currently support for the following platforms within Home Assistant: - Presence detection - device tracker for connected devices - Notifications - via SMS - Sensors - device, signal, and traffic information +- Switch - mobile data on/off ## Configuration