Caller ID Component No Number?

Curious if anyone else is using the Caller ID Sensor ( and having issues with no NUMBER being updated in HA / Hassio.

I used my own VBS script for Caller ID and spam caller filtering in the past on my old home brew home automation system but want to get out of that world. The Caller ID sensor DOES answer and provides the name the bluetooth to home phone adapter provides but no number information. I’ve used the same modem in my VBS code so I know the modem passes the number under the standard AT+VCID=1 setup as that is what I used.

Just curious if others may have similar issues before I dig deeper or re-write my old solution in Python or PHP on my web services server.


Appears to be an unused component - I ended up with a simple Python script on my web server Pi that listens to the modem, parses and pushes the number to a PHP script for TTS, email, spam check and logging back to Hassio. Works good enough for me…

Hi, is that script something you could share as I am looking to do the exact same thing?

The Python is very very simple based on some examples I found. I am sure others can do much better.
This just hands the number off to my PHP web server that I use for other purposes that then does some lookups and pushes TTS back to Hassio via the API. I’m sure someone could do all that in this script and hit HASSIO directly, I’m just doing it how I could make it work. - monitor USB Modem for inbound calls call URL to speak and save
#  Most of the work is done on the PHP side for look ups, notifications, etc
# v1.01 - 09/08/2018 - Added .1 sleep time to keep from looping up CPU - still has ok call response

# setup requirement
import serial
import requests
import urllib2
import time

# open up the modem for reading
ser = serial.Serial(

# set it up and start
print("connected to: " + ser.portstr)
line = []

# loop forever to read calls
while True:
    time.sleep(.1)	#give up some CPU with sleep, check every .x
	# read in each byte and build out a line
    for c in
        # if we have an eol then process the line
        if c == '\n':
            myLine = ''.join(line)
            myLine = myLine.replace("\n", "")
            print myLine
            # once we get a number then process the call off to the PHP code
            if myLine.find("NMBR") != -1:
              myNMBR = myLine.replace("NMBR = ", "")
              print "Inbound : " + myNMBR
              response = urllib2.urlopen('http://<local web server - not hassio>/callerid.php?n=' + myNMBR)
              html =
              print html
            line = []


This is example .PHP that takes that PY URL call and pushes it to Hassio. Understand that I actually take that number, lookup a local MySQL database for previous calls, spam tags, and/or a name to use before this part gets called but this is the core speaking part. You will need to update the API password if used as well. The PHP also sends an email-to-text of the number/name.

		//** Example PHP to get caller number and push to Hassio

		$myCallerNumber = filter_input(INPUT_GET, "n");
		$myMediaPlayer = "media_player.hallway_speaker";
		$strJSON = "{" . CHR(34) . "message" . CHR(34) . ":" . CHR(34) . $myCallerNumber . CHR(34) . "," . CHR(34) . "entity_id" . CHR(34) . ":" . CHR(34) . $myMediaPlayer . CHR(34) . "}";
		$context = stream_context_create(
		    'http' => array(
	        'method' => 'POST',
	        'header' => "x-ha-access: <your password>\r\n" .
	                    "content-type: application/json\r\n",
						'content' => $strJSON
		$data = file_get_contents("http://hassio.local:8123/api/services/tts/google_say", false, $context);
		echo $data;

Thank you, Ill give the first script a try. I’m not sure my modem is working properly, but I’ll find out soon.

Thanks for sharing!

1 Like