Make calls and receive text messages with Home assistant

Hello everyone
I present to you my new goal with Home assistant. My goal is to be able to receive and send phone calls with my cell phone but also receive and send text messages from my cell phone via a Home Assistant

With this code, it pretty much works

service: notify.mobile_app_redmi
data:
  message: "command_activity"
  data:
    intent_action: "android.intent.action.DIAL"
    intent_uri: "tel:+330085453300"

the problem is that my Home Assistant application must be activated for it to work. When I say activate it means being open and my phone is not on standby (Watch the video)
moreover, how to automatically press the ā€œAppelerā€ button afterwards?

2 Likes

Are you trying to send an automated voice message or are you going to start talking into the phone after you dial the number?

If it’s the former I use Twilio for that. And it can send both text messages (SMS) and voice messages. But I don’t think it can receive anything. But your own phone can do that.

if it’s the latter then how much time/effort does it save you to have HA dial the number?

I going to start talking into the phone after you dial the number
As I am disabled in all four limbs and I am independent with computers, using a Home Assistant would allow me to be able to call while using an Android smartphone.

Sorry, I didn’t think of that use case. Please excuse my privileged thinking.

A member of the French forum helped me a lot.
This is what we managed to do

type: custom:stack-in-card
title: Appel
cards:
  - type: horizontal-stack
    cards:
      - type: horizontal-stack
        cards:
          - type: entities
            entities:
              - entity: input_text.callnumber
                icon: mdi:numeric
          - show_name: true
            show_icon: true
            icon: mdi:delete
            icon_height: 30px
            type: button
            tap_action:
              action: call-service
              service: script.1708328864120
              target: {}
  - type: horizontal-stack
    cards:
      - type: custom:button-card
        name: '1'
        styles:
          card:
            - width: 50px
            - height: 50px
            - color: '#44739e'
      - type: custom:button-card
        name: '2'
        styles:
          card:
            - width: 50px
            - height: 50px
            - color: '#44739e'
      - type: custom:button-card
        name: '3'
        styles:
          card:
            - width: 50px
            - height: 50px
            - color: '#44739e'
  - type: horizontal-stack
    cards:
      - type: custom:button-card
        name: '4'
        styles:
          card:
            - width: 50px
            - height: 50px
            - color: '#44739e'
      - type: custom:button-card
        name: '5'
        styles:
          card:
            - width: 50px
            - height: 50px
            - color: '#44739e'
      - type: custom:button-card
        name: '6'
        styles:
          card:
            - width: 50px
            - height: 50px
            - color: '#44739e'
  - type: horizontal-stack
    cards:
      - type: custom:button-card
        name: '7'
        styles:
          card:
            - width: 50px
            - height: 50px
            - color: '#44739e'
      - type: custom:button-card
        name: '8'
        styles:
          card:
            - width: 50px
            - height: 50px
            - color: '#44739e'
      - type: custom:button-card
        name: '9'
        styles:
          card:
            - width: 50px
            - height: 50px
            - color: '#44739e'
  - type: horizontal-stack
    cards:
      - type: custom:button-card
        name: '*'
        styles:
          card:
            - width: 50px
            - height: 50px
            - color: '#44739e'
      - type: custom:button-card
        name: '0'
        styles:
          card:
            - width: 50px
            - height: 50px
            - color: '#44739e'
      - type: custom:button-card
        name: '#'
        styles:
          card:
            - width: 50px
            - height: 50px
            - color: '#44739e'
  - type: horizontal-stack
    cards:
      - type: horizontal-stack
        cards:
          - show_name: true
            show_icon: true
            icon_height: 20px
            icon: mdi:phone
            type: button
            tap_action:
              action: call-service
              service: script.1708328864120
              target: {}


At the same time, I tried to further improve the system. As you can see, I added numbers so I can type from the numbers in the input.

So I think there are two things left for the system to be at its best. First, when I type my number with the keyboard, it is displayed in the input
and leave the +33 by default (Placeholder). Secondly,
make the ā€œdeleteā€ button (the trash can)


This way, if I make a mistake in my number, I can delete it

Thanks in advance to those who will help me with the rest of my development.

Hi! Did you manage to get it working? I need to call a specific phone number to open a gate in a gated community. I am allowed to add only 2 phone numbers to the database and calling only from the registered phone numbers opens the gate. I would like to use an android phone that would call the specified number when tasked to do so through home assistant. Instead of using the DIAL command, I am using a CALL one. The problem is, that the phone is not really reacting to the commands when I want it to, sometimes it calls the number 10min later and I can’t tell why. It seems to call after I restart it but it’s not a rule. For this to be useful, I need a connection to be made almost immediately.

Make sure the message has priority to wake the phone.
Look in the companion app docs for how to do that.

I checked it and I granted Home Assistant the right to display over other apps or something like this. It did not solve it but I think that I still haven’t granted the right permissions. I noticed that when I open the phone app, the call is made straight away. Any tips on what I might be missing? Some sensors permissions in the HA app? Some other privacy permissions on the phone? I went through everything I could find. I’m an iphone user and I’m not familiar with android settings.

Edit: after I left the phone asleep for 5-10min, the intent call is not working anymore even if I open the phone app or the HA app. No idea why.

Its not permissions.
You need to send the notification with priority. See the docs

Thank you. I found two things. First, I saw a setting in the HA app to maintain persistent connection with the app. This seems to have solved my issue.
Second, I found how to set the parameter you mentioned. I think that above Android 8.0 it is called Importance and I set it to high.
So far so goo!

Hi, i want to do exactly the same automation… Pls tell me how you set up this?

I used twilio Twilio - Home Assistant to do so. Depending on your region getting a local number can be some work, but if you’re happy with a US number it works fine. I did not integrate the backhaul, eg reveicing text messages on the HA as I use the outbound calling and texting features for alarm systems and that’s all I need.