core: Unicode SMS messages not supported by some external message recipients
The problem
I use the SMS notifications via GSM-modem integration to communicate with my Texecom house alarm panel via a Texecom Premier Elite ComGSM 2G module.
The module responds to the sending phone number when receiving text messages in the format
<usercode> <command>', e.g. 1921 status`.
This process worked up to and including HA v2021.6.6 but after upgrading to v2021.10.4 the alarm panel no longer responded to commands. Currently running HA v2021.11.5 and the issue still occurs. Docker host is an Intel NUC running Ubuntu Server 18.04 and modem is Huawei E220 (unlocked).
In testing I confirmed:
- messages were sent successfully from HA (verified based on billing)
- messages could be sent through the service to any other recipient without issue
- commands sent to the panel from other platforms received the expected response from the panel
- issue occurred both with original automation and with testing from Developer Tools > Services
- issue occurred both with recipient phone number localised and in E.164 format
- no issue with COM module operation (verified with alarm engineer on site)
- no option to support Unicode encoding (verified with manufacturer technical support).
Manual workaround and suggested solution contained in additional info section below.
What version of Home Assistant Core has the issue?
core-2021.11.5
What was the last working version of Home Assistant Core?
core-2021.6.6
What type of installation are you running?
Home Assistant Container
Integration causing the issue
SMS notifications via GSM-modem
Link to integration documentation on our website
https://www.home-assistant.io/integrations/sms/
Example YAML snippet
#Recipient number in secrets.yaml (fake number for privacy, format retained):
sms_homealarm: '+447708452742'
#Service configuration in configuration.yaml
notify:
- name: sms_homealarm
platform: sms
recipient: !secret sms_homealarm
#sample service call (requests status from panel)
service: notify.sms_homealarm
data:
message: "1921 status"
Anything in the logs that might be useful for us?
No errors as encoding related.
Additional information
Workaround: I have identified the reason behind my automations no longer working and have verified it by manually reverting PR 56468 in the core component. This was verified using gammu on the container host, i.e.
gammu sendsms TEXT +447708452742 -text "1921 status"received a response from the alarm panelgammu sendsms TEXT +447708452742 -unicode -text "1921 status"did not receive a response from the alarm panel
Confirmed as follows
- Within portainer, open a console into the HA container
- Edit homeassistant/components/sms/notify.py
- Change line 49 from:
"Unicode": True,to"Unicode": False, - Save and exit container console
- Restart the HA container
- Sending the SMS then receives a response
Suggested solution Expose the Unicode setting as a configuration parameter (defaulting to True would seem appropriate here).
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 17
The issue states that the problem is with the recipient, not with sending / receiving within HA. The recipient cannot parse the generated message when Unicode is enabled in HA.
I cannot confirm the problem, sending and receiving SMS with Unicode is currently working fine (core 2021.12)