Описание на русском доступно тут.
Home Assistant integration which allows you to call a phone number using 3G/4G, LTE modems.
The main idea is to use a modem for emergency notifications about important events in your smart home. However, emergency alerts are just one example, and the integration can be used in other scenarios as well.
This integration can be installed using HACS. To add GSM Call to your Home Assistant, click the blue button above or add the repository manually:
- Go to HACS → Integrations.
- In the top right corner, select the three-dots menu and choose Custom repositories.
- Paste
black-roland/homeassistant-gsm-call. - Select Integration in the Category field.
- Click the Save icon.
- Install "GSM Call".
To use this integration, add the following to your configuration.yaml:
notify:
- name: call
platform: gsm_call
device: /dev/serial/by-id/usb-HUAWEI_Technology_HUAWEI_Mobile-if01-port0 # modem device pathThe modem path can be obtained by by clicking on the «All hardware» button.
Make sure to restart Home Assistant after updating configuration.yaml. Use the notify.call action to make a phone call. The phone number to dial is specified as target:
action:
service: notify.call
data:
target: "+12345678901"
message: "Required by HASS but not used by the integration — enter any text here"By default, the called phone will ring for approximately 30 seconds. This duration can be adjusted by specifying call_duration_sec:
notify:
- name: call
platform: gsm_call
device: /dev/serial/by-id/usb-HUAWEI_Technology_HUAWEI_Mobile-if01-port0
call_duration_sec: 40Note:
- The duration is counted from the moment the called phone starts ringing.
- Your carrier might interrupt outgoing call before reaching the desired time if the duration is too high.
Before the called phone starts ringing, there's typically a 5-10 second delay while the call connects. The integration will wait up to 20 seconds (default) for this connection to establish. This timeout can be adjusted by specifying dial_timeout_sec.
The integration fires the gsm_call_ended event indicating whether the call was declined or answered. For example, you can turn off the alarm if the callee declined a call:
automation:
- alias: "Disarm the security alarm when a call is declined"
triggers:
- trigger: event
event_type: gsm_call_ended
event_data:
reason: "declined"
actions:
- action: alarm_control_panel.alarm_disarm
target:
entity_id: alarm_control_panel.securityreason can contain the following values: not_answered, declined, answered.
In addition to the reason, you can filter by the phone_number. All possible data properties can be found in developer tools.
This integration experimentally supports sending SMS messages in addition to making voice calls. To configure SMS notifications, add a separate entry in your configuration.yaml:
notify:
- name: sms
platform: gsm_call
type: sms
device: /dev/serial/by-id/usb-HUAWEI_Technology_HUAWEI_Mobile-if01-port0 # the same path as for callsTo send an SMS message, use the notify.sms service:
action:
service: notify.sms
data:
target: "+12345678901"
message: "This is an SMS message"Note:
- SMS support is experimental: you can track down the implementation progress in #17
- SMS messages are limited to the GSM 7-bit alphabet (basic Latin letters, digits, and common symbols)
- The
type: smsparameter is required to distinguish SMS notifications from voice calls - SMS and voice call configurations can coexist in the same
configuration.yamlfile - GUI will replace legacy
congiguration.yamlin v1.0 (stable)
For troubleshooting, first enable debug logs in configuration.yaml:
logger:
logs:
custom_components.gsm_call: debugAfter restarting, check the logs in Settings → System → Logs (or use this link to open the logs).
On some ZTE modems, dialing only works after sending an obscure command: AT%icscall=1,0. Try specifying hardware: zte in the configuration if dialing doesn't work with the default configuration:
notify:
- name: call
platform: gsm_call
device: /dev/serial/by-id/usb-ZTE_MF192_D536C4624C61DC91XXXXXXXXXXXXXXXXXXXXXXXX-if00
hardware: zteFor Globetrotter HSUPA and other GTM382-based modems, add hardware: gtm382 to your configuration:
notify:
- name: call
platform: gsm_call
device: /dev/ttyHS6
hardware: gtm382Most modems work perfectly with default settings, but if you're experiencing issues, your modem might require a specific dialing command. As a troubleshooting step, try specifying hardware: atdt:
notify:
- name: call
platform: gsm_call
device: /dev/serial/by-id/usb-Obscure_Hardware-if01-port0
hardware: atdtIn general, this integration should be compatible with modems specified here.
Tested on:
- Huawei E1550 (identifies as Huawei E161/E169/E620/E800).
- Huawei E171.
- Huawei E3531 (needs to be unlocked using this guide).
- ZTE MF192 (
hardware: ztemust be specified in the configuration). - Globetrotter HSUPA (
hardware: gtm382).
Want to add support for your modem? Check out contributing guidelines to learn how you can help!