Описание на русском доступно тут.
Home Assistant integration which allows you to call a phone number using 3G/4G, LTE modems.
The integration is primarily designed for emergency notification of important events in your smart home.
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 path
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 integration tries to make a phone call for 30 seconds. Duration can be changed 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: 40
Please take into account that your service provider might interrupt dialing before reaching the desired time if the duration is too high.
The duration is counted from the moment the called phone starts ringing.
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.security
reason
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 is intended for making voice calls. Let's keep it simple. There are no plans to add SMS or other functionality not directly related to voice calls. For SMS support, please check out this integration.
GSM modems usually provide multiple interfaces:
$ ls -1 /dev/serial/by-id/usb-HUAWEI_Technology_HUAWEI_Mobile-if0*
/dev/serial/by-id/usb-HUAWEI_Technology_HUAWEI_Mobile-if00-port0
/dev/serial/by-id/usb-HUAWEI_Technology_HUAWEI_Mobile-if01-port0
/dev/serial/by-id/usb-HUAWEI_Technology_HUAWEI_Mobile-if02-port0
To use this together with the sms integration, configure different interfaces for each integration. Otherwise, integrations may mutually block each other.
For troubleshooting, please enable debug logs in configuration.yaml
first:
logger:
logs:
custom_components.gsm_call: debug
Please make sure ModemManager is disabled.
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: zte
Some modems may require a different AT command to dial. If the default configuration doesn't work, try specifying hardware: atdt
:
notify:
- name: call
platform: gsm_call
device: /dev/serial/by-id/usb-HUAWEI_Technology_HUAWEI_Mobile-if01-port0
hardware: atdt
In general, this integration should be compatible with modems specified here.
Tested on:
- Huawei E161/E169/E620/E800.
- Huawei E171.
- Huawei E3531 (needs to be unlocked using this guide).
- ZTE MF192 (
hardware: zte
must be specified in the configuration). Cannot be used simultaneously with the SMS integration.