My home phone is running with an obihai voip adapter. My goal was to pause a running kodi or chromecast when my home phone is ringing.
Unfortunately, obihai doesn’t provide api, but they provide a configuration web page where I can see the status of my line (on hook, off hook, ringing).
I wrote a script that poll the obihai config web page. Then, I send the status to MQTT.
Thanks for this. I also have an obihai ATA. Shame that there is no API. Any chance you could add a guide to your readme file so I can see how to configure it in HA ?
Hi. I was actually just trying to figure out a way to get notifications from Obihai when I came across this. This looks awesome. I was actually planning on monitoring the web page at obihai_IP/callhistory.htm?page=0 and checking for a new call that way. But your way seems to be much better. I was just going to use the ‘scrape’ component of HA. Is there any chance you can update the script to also send the phone number that is calling(using that call history page) via MQTT as well?
If it’s something you can do, it looks like the newest caller id is in the 9th <td> tag, and is in ( parentheses ). From the looks of it, it is probably the same on all of their devices.
@ohmer Looks like I’m having a problem adding it to Hass.io. Any ideas?:
18-04-04 19:24:24 ERROR (SyncWorker_13) [hassio.docker.addon] Can't build 2ceff5c9/amd64-addon-obihai2mqtt:1.0-0: Error parsing reference: "%%BASE_IMAGE%%" is not a valid repository/tag: invalid reference format
I know there is a bug filled on github about the addon that cannot be installed in hass.io, I didn’t had time to investigate (i’m moving so my automation project is currently in pause).
I also found that the script crash after a while and stop working until a restart.
I hope to find time in a few weeks to look at this. I’m open to PR too.
@ohmer I didn’t some Googling, and I was wondering if you think this might be causing the install problem:
It relates perfectly with the error message. I’ll try to do a pull request(I’m new at that, so I may not do it right). Either way, I think it’s a super easy fix.
I did the same thing on my forked repo(I don’t know if I’m using the right terminology here) to test it yesterday, and that did the trick…for that error message. Now I’m getting a new error message:
18-04-06 23:42:54 ERROR (SyncWorker_18) [hassio.docker.addon] Can't build f13bc44c/amd64-addon-obihai2mqtt:1.0-2: Please provide a source image with ``from`` prior to commit
@ohmer So after some Google searching, I think that the reason for that last error was because I had the Ubuntu version of docker(docker.io). I followed the steps to install docker-ce from the docker website, and it got past that error. But now, there’s another error:
18-04-07 17:42:37 ERROR (SyncWorker_12) [hassio.docker.addon] Can’t build 2ceff5c9/amd64-addon-obihai2mqtt:1.0-1: The command ‘/bin/sh -c apk add --no-cache --repository http://dl-3.alpinelinux.org/alpine/edge/testing composer’ returned a non-zero code: 1
I went to that repository in my browser, and I don’t see anything about ‘composer’. So do you think that might be causing that error in that script? I ran that exact command by SSH’ing into hass.io, and basically just got the help screen for the command. No other errors. Any ideas?
I couldn’t get around that error message, so I decided to just do a ‘sudo apt install composer’ and then commented out that line. I get a new error now:
18-04-09 14:03:00 ERROR (SyncWorker_19) [hassio.docker.addon] Can’t build f13bc44c/amd64-addon-obihai2mqtt:1.0-4: The command ‘/bin/sh -c git clone https://github.com/simpat1zq/obihai2mqtt.git /usr/local/obihai2mqtt/’ returned a non-zero code: 128
I wonder if hass.io is not allowed to write to the /usr/local directory.
I added the repository to hass.io 65.6. The obihai2mqtt shows up, but pressing “Install” has no effect. Too bad. Was looking forward to this. Thanks anyway.
If you are not using hass.io (I assume a regular ubuntu/debian because you mentioned apt), checkout this repository instead: https://github.com/ohmer1/obihai2mqtt. Install dependencies with “composer install” and then start the script with the required parameters.
I added that, but I don’t think that’s a proper hass.io repository. From what I saw, I think the repository itself needs certain files there, and each folder under it shows up as an add-on. Since you just have the file for the add-on, hass.io isn’t detecting it as a repository.
https://github.com/ohmer1/obihai2mqtt: this is the main script repository. This is NOT an hass.io repository and cannot be used with hass.io. It can be used if you use a regular distribution like Ubuntu or Debian.
https://github.com/ohmer1/hassio-addons: this is the hass.io repository. This is the one hass.io use to get the addon. This git repository contain only stuff required by hass.io and doesn’t contain the script itself (it got pulled by the Dockerfile from the first git repo when you install the addon).