Send SMS with USB GSM modem when alarm triggered

Hello,
first of all thanks @Oscar_Calvo for the great plugin! Over the last days I was trying to make my raspberry pi’s Supervised Installation communicate over SMS using the SMS Integration. The problem was that Home Assistant couldn’t talk to the device (ERR_TIMEOUT). The GSM Device I am using is the Geeethech GPRS Shield based on SIM900, connected over Serial. After spending some time reading the Gammu manual, I noticed that there is the ability to manually set the baud rate in the connection string. Replacing in config_flow.py line 24, and in init.py line 42, the Connection string from at to at19200 solved the problem and now I am able to use it!

I wonder if it’s possible in a future update to include a property in the configuration for the connection (let the default be at) as well, to avoid user interaction with the source code.

For anyone else with similar issues, you can read how to connect the Geeetech Shield to Raspberry PI and integrate it with Home Assistant in my blog.

Thanks for the feedback, please file a new issue with the details, this should be fairly easy to fix.

Thanks for the immediate response! I will fill a new issue now!

Hi @Oscar_Calvo, I have a device that doesn’t allowing setting the SMSC (via command or dialer system you linked above). I’ve had luck sending messages using -smscnumber +4474XXXXXXX in command line gammu, is there a way to manually set it?
I’ve tried editing the notify.py line 62 to encoded_message["SMSC"] = {"Number": "+4474XXXXXXX"} but continue to get the ERR_GETTING_SMSC

Put the SIM in a phone and configure it using the phone. Make sure the phone can send and receive messages before using it with home-assistant.

Nevermind, I’ve fixed the issue. If anyone else can’t set a SMSC on their device and are getting the ERR_GETTING_SMSC (this seems common when using a phone as a modem as they perform the SMSC via software not via the sim… especially old Android phones), they can do so manually,

  1. Create a custom_components folder in your HA config (if you don’t have one already) and in that create a sms folder and place the SMS github files in the folder
  2. Edit notify.py line 62 to encoded_message["SMSC"] = {"Number": "+4474XXXXXXX"} adding in your carriers Message Centre number (also called a service centre number)
  3. Edit the manifest.json file adding in "version": "0.0.1", between lines 2 and 3

Restart HA and it should work. Do note that the integration will no longer update automatically.

Another tip if using an android phone, is enable USB debugging in the developer settings. None of the phones I tested worked otherwise.

Works great, thanks @Oscar_Calvo for all your hard work on this!

1 Like

Hi,
I found the way to create /etc/udev/rules.d/10-gsm-modem.rules and now I have 3 USB new ports:
/dev/ttyUSB1
/dev/ttyUSB2
/dev/ttyUSB3

why 3 ports?

I tried to use them in SMS integration but I receive always problem to connection to device…how I can solve?

I have to insert before SIM card in HUAWEI E3531 key?

Hi, did you have any luck getting this to work? Mine worked fine until about october 2021, since then it has the same problem as yours.

Not yet, I will try again.
I just re-installed the HAO
I will keep you posted

@Oscar_Calvo hi. Can you give us some help here? It is a USB device with SIM800C like the one you have in the list of compatible devices. It worked like a charm until a few months ago, it configured by integration and it worked fine. Now through the integration it is not detected, if you manually add it to config.yaml, the notification of a new device appears in HA but it always fails to connect when trying to configure it.
Thanks

@Oscar_Calvo
I bought the SIM800C as linked from the docs.
unfurtunately i get this error when i am trying to add it.

  • Failed to initialize, error ERR_TIMEOUT
  • Failed to initialize, error ERR_DEVICEOPENERROR

I have tried adding it by it’s ID, /dev/ttyUSB3 and /dev/gsm-modem as created in my 10.local.rules, but still geting this issue.
If i remove the simcard i get error for no simcard and no operator instead.

ls -l /dev/

crw-------    1 root     root       10,  61 Oct 12 15:24 ashmem
crw-r--r--    1 root     root       10, 235 Oct 12 15:24 autofs
drwxr-xr-x    2 root     root           760 Oct 12 15:24 block
drwxr-xr-x    2 root     root            60 Jan  1  1970 bsg
crw-------    1 root     root       10, 234 Oct 12 15:24 btrfs-control
drwxr-xr-x    3 root     root            60 Jan  1  1970 bus
crw-------    1 root     root       10,  62 Oct 12 15:24 cachefiles
drwxr-xr-x    2 root     root          3160 Feb  3 14:15 char
crw-------    1 root     root        5,   1 Feb  3 13:11 console
crw-------    1 root     root       10,  60 Oct 12 15:24 cpu_dma_latency
crw-------    1 root     root       10, 203 Oct 12 15:24 cuse
drwxr-xr-x    8 root     root           160 Oct 12 15:24 disk
drwxr-xr-x    2 root     root            80 Jan  1  1970 dma_heap
lrwxrwxrwx    1 root     root            13 Oct 12 15:24 fd -> /proc/self/fd
crw-rw-rw-    1 root     root        1,   7 Oct 12 15:24 full
crw-rw-rw-    1 root     root       10, 229 Oct 12 15:24 fuse
crw-------    1 root     root      254,   0 Oct 12 15:24 gpiochip0
crw-------    1 root     root      254,   1 Oct 12 15:24 gpiochip1
crw-------    1 root     root      254,   2 Oct 12 15:24 gpiochip2
crw-------    1 root     root      245,   0 Oct 12 15:24 gpiomem
lrwxrwxrwx    1 root     root             7 Feb  3 14:15 gsm-modem -> ttyUSB3
crw-------    1 root     root       10, 183 Oct 12 15:24 hwrng
crw-------    1 root     root       89,   0 Oct 12 15:24 i2c-0
crw-------    1 root     root       89,   1 Oct 12 15:24 i2c-1
crw-------    1 root     root       89,  10 Oct 12 15:24 i2c-10
crw-------    1 root     root       89,  22 Oct 12 15:24 i2c-22
drwxr-xr-x    2 root     root            60 Jan  1  1970 input
crw-r--r--    1 root     root        1,  11 Oct 12 15:24 kmsg
crw-rw-rw-    1 root     kvm        10, 232 Oct 12 15:24 kvm
lrwxrwxrwx    1 root     root            28 Oct 12 15:24 log -> /run/systemd/journal/dev-log
crw-rw----    1 root     disk       10, 237 Oct 12 15:24 loop-control
brw-rw----    1 root     disk        7,   0 Oct 12 15:24 loop0
brw-rw----    1 root     disk        7,   1 Oct 12 15:24 loop1
brw-rw----    1 root     disk        7,   2 Oct 12 15:24 loop2
brw-rw----    1 root     disk        7,   3 Oct 12 15:24 loop3
brw-rw----    1 root     disk        7,   4 Oct 12 15:24 loop4
brw-rw----    1 root     disk        7,   5 Oct 12 15:24 loop5
brw-rw----    1 root     disk        7,   6 Oct 12 15:24 loop6
brw-rw----    1 root     disk        7,   7 Oct 12 15:24 loop7
drwxr-xr-x    2 root     root            60 Oct 12 15:24 mapper
crw-rw----    1 root     video     251,   0 Oct 12 15:24 media0
crw-rw----    1 root     video     251,   1 Oct 12 15:24 media1
crw-r-----    1 root     kmem        1,   1 Oct 12 15:24 mem
drwxrwxrwt    2 root     root            40 Jan  1  1970 mqueue
drwxr-xr-x    2 root     root            60 Jan  1  1970 net
crw-rw-rw-    1 root     root        1,   3 Oct 12 15:24 null
crw-r-----    1 root     kmem        1,   4 Oct 12 15:24 port
crw-------    1 root     root      108,   0 Oct 12 15:24 ppp
crw-rw-rw-    1 root     tty         5,   2 Feb  3 14:25 ptmx
drwxr-xr-x    2 root     root             0 Oct 12 15:24 pts
brw-rw----    1 root     disk        1,   0 Oct 12 15:24 ram0
brw-rw----    1 root     disk        1,   1 Oct 12 15:24 ram1
brw-rw----    1 root     disk        1,  10 Oct 12 15:24 ram10
brw-rw----    1 root     disk        1,  11 Oct 12 15:24 ram11
brw-rw----    1 root     disk        1,  12 Oct 12 15:24 ram12
brw-rw----    1 root     disk        1,  13 Oct 12 15:24 ram13
brw-rw----    1 root     disk        1,  14 Oct 12 15:24 ram14
brw-rw----    1 root     disk        1,  15 Oct 12 15:24 ram15
brw-rw----    1 root     disk        1,   2 Oct 12 15:24 ram2
brw-rw----    1 root     disk        1,   3 Oct 12 15:24 ram3
brw-rw----    1 root     disk        1,   4 Oct 12 15:24 ram4
brw-rw----    1 root     disk        1,   5 Oct 12 15:24 ram5
brw-rw----    1 root     disk        1,   6 Oct 12 15:24 ram6
brw-rw----    1 root     disk        1,   7 Oct 12 15:24 ram7
brw-rw----    1 root     disk        1,   8 Oct 12 15:24 ram8
brw-rw----    1 root     disk        1,   9 Oct 12 15:24 ram9
crw-rw-rw-    1 root     root        1,   8 Oct 12 15:24 random
drwxr-xr-x    2 root     root            60 Jan  1  1970 raw
crw-rw-r--    1 root     root       10, 242 Oct 12 15:24 rfkill
crw-------    1 root     root      236,   0 Oct 12 15:24 rpivid-h264mem
crw-------    1 root     root      238,   0 Oct 12 15:24 rpivid-hevcmem
crw-------    1 root     root      237,   0 Oct 12 15:24 rpivid-intcmem
crw-------    1 root     root      235,   0 Oct 12 15:24 rpivid-vp9mem
brw-rw----    1 root     disk        8,   0 Oct 12 15:24 sda
brw-rw----    1 root     disk        8,   1 Oct 12 15:24 sda1
brw-rw----    1 root     disk        8,   2 Oct 12 15:24 sda2
brw-rw----    1 root     disk        8,   3 Oct 12 15:24 sda3
brw-rw----    1 root     disk        8,   4 Oct 12 15:24 sda4
brw-rw----    1 root     disk        8,   5 Oct 12 15:24 sda5
brw-rw----    1 root     disk        8,   6 Feb  3 13:12 sda6
brw-rw----    1 root     disk        8,   7 Oct 12 15:24 sda7
brw-rw----    1 root     disk        8,   8 Oct 12 15:24 sda8
drwxr-xr-x    4 root     root            80 Oct 12 15:24 serial
lrwxrwxrwx    1 root     root             7 Oct 12 15:24 serial1 -> ttyAMA0
drwxrwxrwt    2 root     root            40 Oct 12 15:24 shm
drwxr-xr-x    3 root     root           140 Oct 12 15:24 snd
lrwxrwxrwx    1 root     root            15 Oct 12 15:24 stderr -> /proc/self/fd/2
lrwxrwxrwx    1 root     root            15 Oct 12 15:24 stdin -> /proc/self/fd/0
lrwxrwxrwx    1 root     root            15 Oct 12 15:24 stdout -> /proc/self/fd/1
crw-rw-rw-    1 root     tty         5,   0 Oct 12 15:24 tty
crw--w----    1 root     tty         4,   0 Oct 12 15:24 tty0
crw--w----    1 root     tty         4,   1 Feb  3 13:12 tty1
crw--w----    1 root     tty         4,  10 Oct 12 15:24 tty10
crw--w----    1 root     tty         4,  11 Oct 12 15:24 tty11
crw--w----    1 root     tty         4,  12 Oct 12 15:24 tty12
crw--w----    1 root     tty         4,  13 Oct 12 15:24 tty13
crw--w----    1 root     tty         4,  14 Oct 12 15:24 tty14
crw--w----    1 root     tty         4,  15 Oct 12 15:24 tty15
crw--w----    1 root     tty         4,  16 Oct 12 15:24 tty16
crw--w----    1 root     tty         4,  17 Oct 12 15:24 tty17
crw--w----    1 root     tty         4,  18 Oct 12 15:24 tty18
crw--w----    1 root     tty         4,  19 Oct 12 15:24 tty19
crw--w----    1 root     tty         4,   2 Oct 12 15:24 tty2
crw--w----    1 root     tty         4,  20 Oct 12 15:24 tty20
crw--w----    1 root     tty         4,  21 Oct 12 15:24 tty21
crw--w----    1 root     tty         4,  22 Oct 12 15:24 tty22
crw--w----    1 root     tty         4,  23 Oct 12 15:24 tty23
crw--w----    1 root     tty         4,  24 Oct 12 15:24 tty24
crw--w----    1 root     tty         4,  25 Oct 12 15:24 tty25
crw--w----    1 root     tty         4,  26 Oct 12 15:24 tty26
crw--w----    1 root     tty         4,  27 Oct 12 15:24 tty27
crw--w----    1 root     tty         4,  28 Oct 12 15:24 tty28
crw--w----    1 root     tty         4,  29 Oct 12 15:24 tty29
crw--w----    1 root     tty         4,   3 Oct 12 15:24 tty3
crw--w----    1 root     tty         4,  30 Oct 12 15:24 tty30
crw--w----    1 root     tty         4,  31 Oct 12 15:24 tty31
crw--w----    1 root     tty         4,  32 Oct 12 15:24 tty32
crw--w----    1 root     tty         4,  33 Oct 12 15:24 tty33
crw--w----    1 root     tty         4,  34 Oct 12 15:24 tty34
crw--w----    1 root     tty         4,  35 Oct 12 15:24 tty35
crw--w----    1 root     tty         4,  36 Oct 12 15:24 tty36
crw--w----    1 root     tty         4,  37 Oct 12 15:24 tty37
crw--w----    1 root     tty         4,  38 Oct 12 15:24 tty38
crw--w----    1 root     tty         4,  39 Oct 12 15:24 tty39
crw--w----    1 root     tty         4,   4 Oct 12 15:24 tty4
crw--w----    1 root     tty         4,  40 Oct 12 15:24 tty40
crw--w----    1 root     tty         4,  41 Oct 12 15:24 tty41
crw--w----    1 root     tty         4,  42 Oct 12 15:24 tty42
crw--w----    1 root     tty         4,  43 Oct 12 15:24 tty43
crw--w----    1 root     tty         4,  44 Oct 12 15:24 tty44
crw--w----    1 root     tty         4,  45 Oct 12 15:24 tty45
crw--w----    1 root     tty         4,  46 Oct 12 15:24 tty46
crw--w----    1 root     tty         4,  47 Oct 12 15:24 tty47
crw--w----    1 root     tty         4,  48 Oct 12 15:24 tty48
crw--w----    1 root     tty         4,  49 Oct 12 15:24 tty49
crw--w----    1 root     tty         4,   5 Oct 12 15:24 tty5
crw--w----    1 root     tty         4,  50 Oct 12 15:24 tty50
crw--w----    1 root     tty         4,  51 Oct 12 15:24 tty51
crw--w----    1 root     tty         4,  52 Oct 12 15:24 tty52
crw--w----    1 root     tty         4,  53 Oct 12 15:24 tty53
crw--w----    1 root     tty         4,  54 Oct 12 15:24 tty54
crw--w----    1 root     tty         4,  55 Oct 12 15:24 tty55
crw--w----    1 root     tty         4,  56 Oct 12 15:24 tty56
crw--w----    1 root     tty         4,  57 Oct 12 15:24 tty57
crw--w----    1 root     tty         4,  58 Oct 12 15:24 tty58
crw--w----    1 root     tty         4,  59 Oct 12 15:24 tty59
crw--w----    1 root     tty         4,   6 Oct 12 15:24 tty6
crw--w----    1 root     tty         4,  60 Oct 12 15:24 tty60
crw--w----    1 root     tty         4,  61 Oct 12 15:24 tty61
crw--w----    1 root     tty         4,  62 Oct 12 15:24 tty62
crw--w----    1 root     tty         4,  63 Oct 12 15:24 tty63
crw--w----    1 root     tty         4,   7 Oct 12 15:24 tty7
crw--w----    1 root     tty         4,   8 Oct 12 15:24 tty8
crw--w----    1 root     tty         4,   9 Oct 12 15:24 tty9
crw-rw----    1 root     dialout   204,  64 Feb  3 13:10 ttyAMA0
crw-rw----    1 root     dialout   188,   0 Feb  3 14:25 ttyUSB0
crw-rw----    1 root     dialout   188,   1 Feb  3 13:12 ttyUSB1
crw-rw----    1 root     dialout   188,   3 Feb  3 14:23 ttyUSB3
crw-------    1 root     root        5,   3 Oct 12 15:24 ttyprintk
crw-------    1 root     root       10, 239 Oct 12 15:24 uhid
crw-------    1 root     root       10, 223 Oct 12 15:24 uinput
crw-rw-rw-    1 root     root        1,   9 Oct 12 15:24 urandom
drwxr-xr-x    3 root     root            60 Oct 12 15:24 v4l
crw-------    1 root     root      247,   0 Oct 12 15:24 vc-mem
crw-------    1 root     root      241,   0 Oct 12 15:24 vchiq
crw-------    1 root     root      246,   0 Oct 12 15:24 vcio
crw-rw----    1 root     tty         7,   0 Oct 12 15:24 vcs
crw-rw----    1 root     tty         7,   1 Oct 12 15:24 vcs1
crw-rw----    1 root     tty         7,   2 Feb  3 13:10 vcs2
crw-rw----    1 root     tty         7,   3 Feb  3 13:10 vcs3
crw-rw----    1 root     tty         7,   4 Feb  3 13:10 vcs4
crw-rw----    1 root     tty         7,   5 Feb  3 13:10 vcs5
crw-rw----    1 root     tty         7,   6 Feb  3 13:10 vcs6
crw-rw----    1 root     tty         7, 128 Oct 12 15:24 vcsa
crw-rw----    1 root     tty         7, 129 Oct 12 15:24 vcsa1
crw-rw----    1 root     tty         7, 130 Feb  3 13:10 vcsa2
crw-rw----    1 root     tty         7, 131 Feb  3 13:10 vcsa3
crw-rw----    1 root     tty         7, 132 Feb  3 13:10 vcsa4
crw-rw----    1 root     tty         7, 133 Feb  3 13:10 vcsa5
crw-rw----    1 root     tty         7, 134 Feb  3 13:10 vcsa6
crw-rw-rw-    1 root     root       10,  59 Oct 12 15:24 vcsm-cma
crw-rw----    1 root     tty         7,  64 Oct 12 15:24 vcsu
crw-rw----    1 root     tty         7,  65 Oct 12 15:24 vcsu1
crw-rw----    1 root     tty         7,  66 Feb  3 13:10 vcsu2
crw-rw----    1 root     tty         7,  67 Feb  3 13:10 vcsu3
crw-rw----    1 root     tty         7,  68 Feb  3 13:10 vcsu4
crw-rw----    1 root     tty         7,  69 Feb  3 13:10 vcsu5
crw-rw----    1 root     tty         7,  70 Feb  3 13:10 vcsu6
crw-------    1 root     root       10,  63 Oct 12 15:24 vga_arbiter
crw-------    1 root     root       10, 137 Oct 12 15:24 vhci
crw-rw-rw-    1 root     kvm        10, 238 Oct 12 15:24 vhost-net
crw-rw----    1 root     video      81,   0 Oct 12 15:24 video10
crw-rw----    1 root     video      81,   5 Oct 12 15:24 video11
crw-rw----    1 root     video      81,   6 Oct 12 15:24 video12
crw-rw----    1 root     video      81,   1 Oct 12 15:24 video13
crw-rw----    1 root     video      81,   2 Oct 12 15:24 video14
crw-rw----    1 root     video      81,   3 Oct 12 15:24 video15
crw-rw----    1 root     video      81,   4 Oct 12 15:24 video16
crw-rw----    1 root     video      81,   7 Oct 12 15:24 video18
crw-------    1 root     root       10, 130 Oct 12 15:24 watchdog
crw-------    1 root     root      249,   0 Oct 12 15:24 watchdog0
lrwxrwxrwx    1 root     root             7 Oct 12 15:24 z-wave-usb -> ttyUSB1
crw-rw-rw-    1 root     root        1,   5 Oct 12 15:24 zero
lrwxrwxrwx    1 root     root             7 Oct 12 15:24 zigbee-usb -> ttyUSB0
brw-rw----    1 root     disk      254,   0 Oct 12 15:24 zram0
brw-rw----    1 root     disk      254,   1 Oct 12 15:24 zram1
brw-rw----    1 root     disk      254,   2 Oct 12 15:24 zram2
# ls -l /dev/*USB*
crw-rw----    1 root     dialout   188,   0 Feb  3 14:25 /dev/ttyUSB0
crw-rw----    1 root     dialout   188,   1 Feb  3 13:12 /dev/ttyUSB1
crw-rw----    1 root     dialout   188,   3 Feb  3 14:23 /dev/ttyUSB3
# lsusb
Bus 001 Device 007: ID 1a86:7523
Bus 001 Device 001: ID 1d6b:0002
Bus 001 Device 004: ID 1a86:7523
Bus 001 Device 003: ID 05e3:0608
Bus 001 Device 002: ID 2109:3431
Bus 002 Device 002: ID 174c:1156
Bus 002 Device 001: ID 1d6b:0003
Bus 001 Device 005: ID 10c4:ea60
# ls -l /dev/*tty*
crw-rw-rw-    1 root     tty         5,   0 Oct 12 15:24 /dev/tty
crw--w----    1 root     tty         4,   0 Oct 12 15:24 /dev/tty0
crw--w----    1 root     tty         4,   1 Feb  3 13:12 /dev/tty1
crw--w----    1 root     tty         4,  10 Oct 12 15:24 /dev/tty10
crw--w----    1 root     tty         4,  11 Oct 12 15:24 /dev/tty11
crw--w----    1 root     tty         4,  12 Oct 12 15:24 /dev/tty12
crw--w----    1 root     tty         4,  13 Oct 12 15:24 /dev/tty13
crw--w----    1 root     tty         4,  14 Oct 12 15:24 /dev/tty14
crw--w----    1 root     tty         4,  15 Oct 12 15:24 /dev/tty15
crw--w----    1 root     tty         4,  16 Oct 12 15:24 /dev/tty16
crw--w----    1 root     tty         4,  17 Oct 12 15:24 /dev/tty17
crw--w----    1 root     tty         4,  18 Oct 12 15:24 /dev/tty18
crw--w----    1 root     tty         4,  19 Oct 12 15:24 /dev/tty19
crw--w----    1 root     tty         4,   2 Oct 12 15:24 /dev/tty2
crw--w----    1 root     tty         4,  20 Oct 12 15:24 /dev/tty20
crw--w----    1 root     tty         4,  21 Oct 12 15:24 /dev/tty21
crw--w----    1 root     tty         4,  22 Oct 12 15:24 /dev/tty22
crw--w----    1 root     tty         4,  23 Oct 12 15:24 /dev/tty23
crw--w----    1 root     tty         4,  24 Oct 12 15:24 /dev/tty24
crw--w----    1 root     tty         4,  25 Oct 12 15:24 /dev/tty25
crw--w----    1 root     tty         4,  26 Oct 12 15:24 /dev/tty26
crw--w----    1 root     tty         4,  27 Oct 12 15:24 /dev/tty27
crw--w----    1 root     tty         4,  28 Oct 12 15:24 /dev/tty28
crw--w----    1 root     tty         4,  29 Oct 12 15:24 /dev/tty29
crw--w----    1 root     tty         4,   3 Oct 12 15:24 /dev/tty3
crw--w----    1 root     tty         4,  30 Oct 12 15:24 /dev/tty30
crw--w----    1 root     tty         4,  31 Oct 12 15:24 /dev/tty31
crw--w----    1 root     tty         4,  32 Oct 12 15:24 /dev/tty32
crw--w----    1 root     tty         4,  33 Oct 12 15:24 /dev/tty33
crw--w----    1 root     tty         4,  34 Oct 12 15:24 /dev/tty34
crw--w----    1 root     tty         4,  35 Oct 12 15:24 /dev/tty35
crw--w----    1 root     tty         4,  36 Oct 12 15:24 /dev/tty36
crw--w----    1 root     tty         4,  37 Oct 12 15:24 /dev/tty37
crw--w----    1 root     tty         4,  38 Oct 12 15:24 /dev/tty38
crw--w----    1 root     tty         4,  39 Oct 12 15:24 /dev/tty39
crw--w----    1 root     tty         4,   4 Oct 12 15:24 /dev/tty4
crw--w----    1 root     tty         4,  40 Oct 12 15:24 /dev/tty40
crw--w----    1 root     tty         4,  41 Oct 12 15:24 /dev/tty41
crw--w----    1 root     tty         4,  42 Oct 12 15:24 /dev/tty42
crw--w----    1 root     tty         4,  43 Oct 12 15:24 /dev/tty43
crw--w----    1 root     tty         4,  44 Oct 12 15:24 /dev/tty44
crw--w----    1 root     tty         4,  45 Oct 12 15:24 /dev/tty45
crw--w----    1 root     tty         4,  46 Oct 12 15:24 /dev/tty46
crw--w----    1 root     tty         4,  47 Oct 12 15:24 /dev/tty47
crw--w----    1 root     tty         4,  48 Oct 12 15:24 /dev/tty48
crw--w----    1 root     tty         4,  49 Oct 12 15:24 /dev/tty49
crw--w----    1 root     tty         4,   5 Oct 12 15:24 /dev/tty5
crw--w----    1 root     tty         4,  50 Oct 12 15:24 /dev/tty50
crw--w----    1 root     tty         4,  51 Oct 12 15:24 /dev/tty51
crw--w----    1 root     tty         4,  52 Oct 12 15:24 /dev/tty52
crw--w----    1 root     tty         4,  53 Oct 12 15:24 /dev/tty53
crw--w----    1 root     tty         4,  54 Oct 12 15:24 /dev/tty54
crw--w----    1 root     tty         4,  55 Oct 12 15:24 /dev/tty55
crw--w----    1 root     tty         4,  56 Oct 12 15:24 /dev/tty56
crw--w----    1 root     tty         4,  57 Oct 12 15:24 /dev/tty57
crw--w----    1 root     tty         4,  58 Oct 12 15:24 /dev/tty58
crw--w----    1 root     tty         4,  59 Oct 12 15:24 /dev/tty59
crw--w----    1 root     tty         4,   6 Oct 12 15:24 /dev/tty6
crw--w----    1 root     tty         4,  60 Oct 12 15:24 /dev/tty60
crw--w----    1 root     tty         4,  61 Oct 12 15:24 /dev/tty61
crw--w----    1 root     tty         4,  62 Oct 12 15:24 /dev/tty62
crw--w----    1 root     tty         4,  63 Oct 12 15:24 /dev/tty63
crw--w----    1 root     tty         4,   7 Oct 12 15:24 /dev/tty7
crw--w----    1 root     tty         4,   8 Oct 12 15:24 /dev/tty8
crw--w----    1 root     tty         4,   9 Oct 12 15:24 /dev/tty9
crw-rw----    1 root     dialout   204,  64 Feb  3 13:10 /dev/ttyAMA0
crw-rw----    1 root     dialout   188,   0 Feb  3 14:25 /dev/ttyUSB0
crw-rw----    1 root     dialout   188,   1 Feb  3 13:12 /dev/ttyUSB1
crw-rw----    1 root     dialout   188,   3 Feb  3 14:23 /dev/ttyUSB3
crw-------    1 root     root        5,   3 Oct 12 15:24 /dev/ttyprintk
# ls -l /etc/udev/rules.d/*.rules
-rw-r--r--    1 root     root           315 Feb  3 12:21 /etc/udev/rules.d/10.local.rules
# ls -l /dev/serial/by-id/
lrwxrwxrwx    1 root     root            13 Feb  3 14:15 usb-1a86_USB2.0-Serial-if00-port0 -> ../../ttyUSB3
lrwxrwxrwx    1 root     root            13 Oct 12 15:24 usb-1a86_USB_Serial-if00-port0 -> ../../ttyUSB0
lrwxrwxrwx    1 root     root            13 Oct 12 15:24 usb-Silicon_Labs_CP2102N_USB_to_UART_Bridge_Controller_8a1e26945584e911877a4992d6f3a178-if00-port0 -> ../../ttyUSB1

Also it is worth mentioning i am on a RPi4-4gb using Home Assistant OS

Edit: After closer inspection, i figured that the SIM800C wasn’t supplied with enough power and powercycled, added a powered USB hub and it works.

Hi, all !

I purchased a SIM800C USB modem and planned to use it to send/receive SMS. But after connecting to Synology’s USB port, I still couldn’t connect the device.
Command lsusb -l in Synology shows the connected device, just like a Docker container does.

Telnet Synology:
LOGIN@HOST:/dev$ lsusb -i
|__usb1 1d6b:0002:0404 09 2.00 480MBit/s 0mA 1IF (Linux 4.4.180+ xhci-hcd xHCI Host Controller 0000:00:15.0) hub
|__1-1 1a86:7523:0264 ff 1.10 12MBit/s 98mA 1IF ( ffffffd8ffffffb9ffffffd0ffffffa2)
** 1-1:1.0 (IF) ff:01:02 3EPs ()**

Container in Docker:
bash-5.1# lsusb -i
Bus 001 Device 009: ID 1a86:7523
Bus 001 Device 008: ID 1bcf:0c31
Bus 001 Device 003: ID f400:f400
Bus 002 Device 004: ID 174c:5106
Bus 001 Device 001: ID 1d6b:0002
Bus 002 Device 001: ID 1d6b:0003

When entering the SMS configuration in configuration.yaml, HA throws an error:
Invalid config for [sms]: No device at /dev/ttyUSB1 found for dictionary value @ data[‘sms’][‘device’]. Got ‘/dev/ttyUSB1’. (See /config/configuration.yaml, line 320).

Please tell me how can I connect the device?

P.s. The SIM card is activated. I check with a call from my mobile to SIM800C.
HA ver: Home Assistant 2021.12.10

I had similar issue
what i did:

check the sim orientation

remove integration
reboot

in case it doesn’t work… one time I re-installed ha from scratch. in this case it worked without any issues

2 Likes

I installed the SIM card correctly. When I call from my mobile device on SIM800C, I get a call.
Now I have found how to connect in Docker container to Synology USB devices.
Path to devices:
sms:
device: /dev/bus/usb

HA automatically prompted me to install GSM SMS intagration, but it also doesn’t see the device when I run the integration. I tried to substitute the device ID, but it does not determine it.

Additionally, I started the HA container in privileged mode and added permissions to access USB devices:
Added a rule: /etc/udev/rules.d/99-serial.rules
Inside the rule: KERNEL==“ttyUSB[0-9]*”,MODE=“0666”
Perhaps this also helped.

But I still can’t connect the modem… :neutral_face:

I know’t why I not see GSM modem in configuration wizard SMS integration… I can’t add screenshot :frowning:

When registering in a GSM network, should the LED on the modem flash? My modem is not making any beeps. For verification, I only have the opportunity to call the modem and get the correct call. When I disconnect the modem from the USB port and make a call from my smartphone - I get “the subscriber is not available”, but when I plug the modem into the USB port I get a beep to call the subscriber.

I did some work and found out that Synology OS 7 does not have USB/COM chip drivers CH340/341.

  1. community
  2. List of USB ID’s

google search:

  1. Can’t rebuild ch341.c driver in kernel
  2. Get serial devices working on Synology DS216+II DiskStation

I haven’t seen the option to install these drivers yet. But it seems to me that this is the problem.

I installed SIMCOM_Ltd (SIMCOM_SIM800) Revision:1308B02SIM800M32_BT

sudo gammu sendsms TEXT -text “Ohhai”
If you want break, press Ctrl+C…
test passed, I received SMS.

I planned to use it to send SMS, but in home assistant I see

Logger: homeassistant.components.sms.notify
Source: components/sms/notify.py:68
Integration: SMS notifications via GSM-modem (documentation, issues)
First occurred: 22:02:54 (3 occurrences)
Last logged: 22:06:02
Sending to … failed: ERR_UNKNOWN

How I test the sms gateway in HA?

@Oscar_Calvo - wondering if you want to look at this. I switched my sim from a 3G Huawei USB modem to a 4G ZTE USB modem, and I’m getting ERR_GETTING_SMSC when I try to send.

  • This SIM worked with the integration unmodified in my 3G modem, problem only started when switched to the 4G modem
  • The correct SMSC is on the SIM, when I do AT+CSCA? I get a response of +CSCA: "+12063130004",145 and that is correct for my carrier (T-Mobile in US)
  • I am able to send SMS messages in putty using +CMGS
  • I am able to receive SMS using the integration without any modifications
  • I am able to send SMS using the integration, but only when I load it as a custom component and hardcode the SMSC as described by @googanhiem in reply 326

So I have it working when loaded as a custom component, but would like to help have it working in the main component which would open up another inexpensive 4G USB device for people to use.

Problem on Pi4 after upgrading to Home Assistant OS 7.5

Hello, I use a Huawei E3531 Surf Stick to send SMS. Every thing was working nicely on My PI4 running core-2022.3.5 this morning until I upgraded to Home Assistant OS 7.5.

After reboot (I did it several times), I have this 3 error messages:

1/
Logger: homeassistant.components.notify
Source: components/notify/legacy.py:75
Integration: Notifications (documentation, issues)
First occurred: 14:15:33 (5 occurrences)
Last logged: 14:15:33

Failed to initialize notification service sms

2/
Logger: homeassistant.components.sms.notify
Source: components/sms/notify.py:24
Integration: SMS notifications via GSM-modem (documentation, issues)
First occurred: 14:15:33 (5 occurrences)
Last logged: 14:15:33

SMS gateway not found, cannot initialize service

3/
Logger: homeassistant.components.sms.gateway
Source: components/sms/gateway.py:169
Integration: SMS notifications via GSM-modem (documentation, issues)
First occurred: 14:15:33 (1 occurrences)
Last logged: 14:15:33

Failed to initialize, error ERR_TIMEOUT

I updated to OS 7.5 today and my sms is still working. It looks like it isn’t seeing your modem, did you go to the system hardware page and see if the modem is still showing there?