Send SMS with USB GSM modem when alarm triggered

I really need help…

I have Raspberry Pi 4, 4GB, Home Assistant Core, version 0.115.3.

Device is:

  • Huawei E3531
    (inserted SIM card, mobile data disabled as I need only SMS sending feature)
  • 16GB USB stick for configuration

I’m strugling for 2 days to detect device with no success…

I tried with file content (udev\10-gsm-modem.rules):

ACTION=="add" \
, ATTRS{idVendor}=="12d1" \
, ATTRS{idProduct}=="1f01" \
, RUN+="/sbin/usb_modeswitch -v 12d1 -p 1f01 -I -M '55534243123456780000000000000011062000000100000000000000000000' "

and also with

ACTION=="add" \
, ATTRS{idVendor}=="12d1" \
, ATTRS{idProduct}=="1f01" \
, RUN+="/sbin/usb_modeswitch -X -v 12d1 -p 1f01"

and also withouth -x prefix…

I did make USB import in “http://MYIP:8123/hassio/system” under “Import from USB”.

But I see error under udev:

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] udev.sh: executing... 
[14:08:15] INFO: Update udev information
[cont-init.d] udev.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[14:08:16] INFO: Start local supervisor watchdog...

Probably this is meaning that something is not OK. Error is the same in both script which I tried under file “10-gsm-modem.rules”.
So, did I make some mistake?

Also, when I log via PuTTY [terminal window] (where I got vendor ID, product ID) it do not find any USB device, no matter how much time I make restart of Home Assistant Core or Host system…

~ $ lsusb
Bus 001 Device 001: ID 1d6b:0002
Bus 001 Device 003: ID 12d1:1f01
Bus 001 Device 002: ID 2109:3431
Bus 002 Device 002: ID 0781:5583
Bus 002 Device 001: ID 1d6b:0003
~ $ ls -l /dev/*USB*
ls: /dev/*USB*: No such file or directory
~ $

So, is this problem regarding that I did not make step:
Try disable virtual cd-rom and change work mode “only modem”. After this modem correct work on Raspberry Pi without ‘udev’ rule.

If yes, how exactly to do that?

Also, I did not convert USB Huawei E3531 to modem-mode function as I do not know how to do that.
I know that there is instruction for Huawei E3372h-153 on http://blog.asiantuntijakaveri.fi/2015/07/convert-huawei-e3372h-153-from.html, but is this also good for my device, because it’s not the exact same device?

Can somebody help me step by step what I need to do so that I will resolve and make possible to send SMS via HA.

THANK YOU for your help…

You should have a signal sensor already, named in the format sensor.gsm_signal_imei_nnnnnnn where nnnnnnn is your IMEI number

I’ve found it, indeed - it was not documented tho, neither is connected with integration in UI. :slight_smile:
But still, issuing USSD would let me have it self-running with notification regarding no more cash on prepaid card. :slight_smile:

Yesterday I succesfully change Huawei E3531 to modem mode.
But still I have no success on detecting USB device.

New device ID is now 1446 (before was 1f01).

So, do I need to use 1446 or as before 1f01 in USB configuration script.

Thank you for answer.

PS: Which script should I use.

Also… what I need to write under entities integration for SMS for device window?
Or SMS integration should be detected automaticly?

And - should I use extra USB key for configuration or could I use microSD card in USB modem stick?

Hi

Sorry if hijacking this thread a bit.
I have been trying to install the SMS integration into my Home Assistant setup without luck.
I have a WaveCom GSM modem, which accepts AT commands via Serial interface. It works like a charm with gammu.

When trying to add the integration, I type in the /dev/ttyUSB0 for the modem, but it says “Failed to connect”
image

Looking under the supervisor page I can see it in the hardware list:
(Snippet from the list) Don’t know what the arrow below ttyACM0 indicates though…
image

I have been trying to find logs, that states something - but without luck.
I am running the system from Docker - and doing an lsusb inside with the SSH addon, I can also see the device. It is belonging to the same groups as my ConBee II, and that works fine.
image

I have tried restarting the home assistant - and the virtual machine running home assistant. Still without luck. I would really like to run this integration instead of some homemade gammu-smsd.

EDIT:
I just tried to do it again - still get an error - the same as before. I looked in the logs, and the following is showing:
2020-09-27 14:59:33 ERROR (MainThread) [homeassistant.components.sms.gateway] Failed to initialize, error ERR_DEVICEOPENERROR

Can’t really figure out where to go from here. Looking at the permissions, they are the same as for the ConBee II, which works just fine.

Oh yeay, and running Core 0.115.2 with supervisor 245 - all is running as a docker:


an this is running on a Virtual Machine on a Intel NUC running ESXi. I have installed Gammu on the virtual machine running the docker, and connected to the modem without any issues - sending and receiving messages.

Really hope, that somebody here can help me out.

I did everything as seen on instructions (https://markus.relix.de/index.php/Set_Huawei_E3372h_from_hilink_to_stick_mode)… Huawei E3372h-153 still not working…

Can anybody help me…

Can you disconnect the modem, reboot, list the devices.

Then connect the modem, reboot, list devices again.

Is there a difference in the listed devices?

I succedded via French forum + google translate :slight_smile:

slika

slika

Now question is how to add SMS function, so that I could send SMS… Receiving is not so important, just to send it… Because I do not get any sensor or something for that…

Sorry, a bit tired… I set it, so also SMS is sending as should…

Only one function is missing, maybe you can fix it… special letters: ČĆŽĐŠ čćžđš become CCZDS cczds

Thank you…

Finally got around to trying this out… I am running on Intel NUC, HassOS 4.13, Home Assistant 0.115.5

I have a conbee and a zwave diongle already installed.
image

I have tried with:

sms:
  device: /dev/ttyS0

and

sms:
  device: /dev/ttyUSB0

Both of which invoke the configuration of the component via integrations (having discovered devices)

However, when I try and complete the integration, I can type either permutation or combination of /dev/ttyS0 or /dev/ttyUSB0 i get

image

Could you help?

Many thanks for all your work on this, it has come on massivly… Nice work!

Hi All,

I appreciate that most of the problems are related to not being able for modem to work.
However, my problem is a little bit different and I would appreciate your help.

I managed my modem to work based on instruction on Home Assistant website.

All works well for about 12 hours and suddenly modem stops sending messages.
It starts working again only if I restart RPi4 (service restart doesn’t work).

These are the error messages I get once modem stops working:

Have you experienced similar issues?

What does it mean?

I asked about your notification configuration, but then after reading the logs, it appears to be a device issue

Do anybody know how to use sms.incoming_sms function?
When I tried it I did not receive any event…

My modem: Huawei E3372h-153… Other functions are working normaly…

Yes, device is not set correctly… I had the same issue… re-flash device to USB stick FW and try again… if it’s OK it will show IMEI number on the second window automaticly when you will add integration…

Did anyone have a problem with modem working perfectly for some hours and them stopping completely?

which modem do you have?

Huawei E3531

Yea… I had problem with that one… I migrate to E3372 which is working OK all the time…