From be004de5879e8e3c74238a57a6d1ec174147c2a8 Mon Sep 17 00:00:00 2001 From: Oscar Calvo <2091582+ocalvo@users.noreply.github.com> Date: Tue, 11 Feb 2020 11:05:56 -0800 Subject: [PATCH 1/2] Update sms.markdown --- source/_integrations/sms.markdown | 35 +++++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/source/_integrations/sms.markdown b/source/_integrations/sms.markdown index 7791e5b3eec3..64ab83b12916 100644 --- a/source/_integrations/sms.markdown +++ b/source/_integrations/sms.markdown @@ -65,21 +65,44 @@ You will need a USB GSM stick modem. - [Huawei E3372-510](https://www.amazon.com/gp/product/B01N6P3HI2/ref=ppx_yo_dt_b_asin_title_o00_s00?ie=UTF8&psc=1)( Need to unlock it using [this guide](http://blog.asiantuntijakaveri.fi/2015/07/convert-huawei-e3372h-153-from.html)) - +- [Huawei E3531](https://www.amazon.com/Modem-Huawei-Unlocked-Caribbean-Desbloqueado/dp/B011YZZ6Q2/ref=sr_1_1?keywords=Huawei+E3531&qid=1581447800&sr=8-1) [List of modems that may work](https://www.asus.com/event/networks_3G4G_support/) -### Note about Raspberry PI 4 +### NOTE regarding certain modems from Huawei and certain devices like RPI +For some unknown reason, the rule that converts these modems from storage devices into serial devices does not run automatically. +To work-around this problem follow the procedure to create udev rule in a configuration USB stick for the device to switch to serial mode. -On Raspberry PI 4, you need a udev rule in the config USB stick, for the [Huawei E3372-510 stick](https://www.amazon.com/gp/product/B01N6P3HI2/ref=ppx_yo_dt_b_asin_title_o00_s00?ie=UTF8&psc=1) for it to be recognized. +1. Run `lsusb`, its output looks like this: + +```bash +bus 000 device 001: ID 1FFF:342a +bus 001 device 005: ID 12d1:15ca <-------- Huawei is usally 12d1 +bus 000 device 002: ID 2354:5352 +bus 000 device 002: ID 1232:15ca +``` +Identify the brand for your GSM modem, copy the `brand_Id` and `product_id` (In this case `brand_id = 12d1` and `product_Id = 15ca`) Set this content in file `udev\10-gsm-modem.rules` in the configuration USB: +(Replace `brand_Id` and `product_id` for the numbers reported by `lsusb`) -```txt +```bash +ACTION=="add" \ +, ATTRS{idVendor}=="brand_Id" \ +, ATTRS{idProduct}=="product_Id" \ +, RUN+="/sbin/usb_modeswitch -X -v brand_Id -p product_Id" +``` +Here is a sample configuration file: +```bash ACTION=="add" \ , ATTRS{idVendor}=="12d1" \ -, ATTRS{idProduct}=="14fe" \ -, RUN+="/sbin/usb_modeswitch -X -v 12d1 -p 14fe" +, ATTRS{idProduct}=="15ca" \ +, RUN+="/sbin/usb_modeswitch -X -v 12d1 -p 15ca" ``` +Plug the USB stick, reboot the device, run `lsusb` again. +The resulting product id now should be different and the brand id should be the same. +And `ls -l /dev/*USB*` should now report your device. + +If the device is still not recognized, remove the parameter -X from the usb_modesiwtch command and reboot again. ## More details: From f5a28528dd1edb9f61e78b960ef8781924630d0f Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Wed, 12 Feb 2020 08:38:08 +0100 Subject: [PATCH 2/2] :pencil2: Tweaks --- source/_integrations/sms.markdown | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/source/_integrations/sms.markdown b/source/_integrations/sms.markdown index 64ab83b12916..dfd8bf976ed7 100644 --- a/source/_integrations/sms.markdown +++ b/source/_integrations/sms.markdown @@ -13,6 +13,7 @@ ha_codeowners: The `sms` integration allows having a local execution SMS notification via [Gammu](https://wammu.eu/gammu/). This is ideal when the internet is offline or when the power goes out. This integration provides the following platforms: + - Notify ## Configuration @@ -32,6 +33,7 @@ notify: name: sms_person2 recipient: PHONE_NUMBER ``` + {% configuration %} device: description: The gsm modem device. @@ -41,21 +43,21 @@ device: To use notifications, please see the [getting started with automation page](/getting-started/automation/). -If the integration is used in HassOS then version [3.6](https://github.com/home-assistant/hassos/releases/tag/3.6) or higher is required. +If the integration is used with the Home Assistant Operating System, then version [3.6](https://github.com/home-assistant/hassos/releases/tag/3.6) or higher is required. -For installations not running on Hass.io or Docker, you must install `gammu-dev` package: +For installations not running on Home Assistant or Home Assistant Core using Docker, you must install `gammu-dev` package: ```bash sudo apt-get install libgammu-dev ``` -Before running for the first time, check that the modem is recognized by the system by running: +Before running for the first time, check that the system recognizes the modem by running: ```bash ls -l /dev/*USB* ``` -Note: In Hass.io you need to install the SSH add-on. +Note: When running Home Assistant, you need to install the SSH add-on. ## Required Hardware @@ -66,20 +68,22 @@ You will need a USB GSM stick modem. - [Huawei E3372-510](https://www.amazon.com/gp/product/B01N6P3HI2/ref=ppx_yo_dt_b_asin_title_o00_s00?ie=UTF8&psc=1)( Need to unlock it using [this guide](http://blog.asiantuntijakaveri.fi/2015/07/convert-huawei-e3372h-153-from.html)) - [Huawei E3531](https://www.amazon.com/Modem-Huawei-Unlocked-Caribbean-Desbloqueado/dp/B011YZZ6Q2/ref=sr_1_1?keywords=Huawei+E3531&qid=1581447800&sr=8-1) + [List of modems that may work](https://www.asus.com/event/networks_3G4G_support/) -### NOTE regarding certain modems from Huawei and certain devices like RPI -For some unknown reason, the rule that converts these modems from storage devices into serial devices does not run automatically. -To work-around this problem follow the procedure to create udev rule in a configuration USB stick for the device to switch to serial mode. +### Huawei modems on Raspberry Pi (and similar) devices + +For some unknown reason, the rule that converts these modems from storage devices into serial devices does not run automatically. To work around this problem, follow the procedure to create `udev` rule on a configuration USB stick for the device to switch to serial mode. 1. Run `lsusb`, its output looks like this: ```bash bus 000 device 001: ID 1FFF:342a -bus 001 device 005: ID 12d1:15ca <-------- Huawei is usally 12d1 +bus 001 device 005: ID 12d1:15ca <-------- Huawei is usually 12d1 bus 000 device 002: ID 2354:5352 bus 000 device 002: ID 1232:15ca ``` + Identify the brand for your GSM modem, copy the `brand_Id` and `product_id` (In this case `brand_id = 12d1` and `product_Id = 15ca`) Set this content in file `udev\10-gsm-modem.rules` in the configuration USB: @@ -91,13 +95,16 @@ ACTION=="add" \ , ATTRS{idProduct}=="product_Id" \ , RUN+="/sbin/usb_modeswitch -X -v brand_Id -p product_Id" ``` + Here is a sample configuration file: + ```bash ACTION=="add" \ , ATTRS{idVendor}=="12d1" \ , ATTRS{idProduct}=="15ca" \ , RUN+="/sbin/usb_modeswitch -X -v 12d1 -p 15ca" ``` + Plug the USB stick, reboot the device, run `lsusb` again. The resulting product id now should be different and the brand id should be the same. And `ls -l /dev/*USB*` should now report your device.