iRobot Roomba i7+ Configuration using Rest980

@Syrius

I’m struggling with the varialbe below. I’m not sure of the port below.
This is not the same as for the vacuum_state and vacuum_action variables i suppose?

vacuum_map: http://<ip or fqdn of docker host>:<nginxphpport>/image.php

Replace ip work your hass ip or fqdn, replace nginx port with the likely default of 3001

i have integration by integration home assistant iroomba
i have hassio os 64bit
i see later time stop work , need restart home assistant.

If your using the native irobot integration, the this thread isnt really for you. This talks about using rest980 to enhance the funcionailirty for roombas beyond what is included.

Ok, so I’ve been able to successfully build the Docker image, and can start it… But not access it. There doesn’t appear to be anything at any endpoint. I thought maybe my BLID had changed somehow, so I attempted to get it from dorita980 again… And got this error: https://github.com/koalazak/dorita980/issues/127#issuecomment-733817712

I’ve made sure that my Roomba 960 is on, “doing WiFi stuff”, I’m on the same network, the iRobot app is closed, and I’ve even shut down Home Assistant (thinking maybe the Roomba integration was messing with it), but I always get the same error message.

you access the content via REST API.

Refer Step 4 in the guide

Confirm you can access the WebUI
http://<ip or fqdn of docker host>:<port>/api/local/info/state

I get no response from that endpoint while rest980 is running, and am unable to confirm that I have the correct BLID, because dorita980 errors as described in the linked issue.

I’ve basically confirmed I can’t access the WebUI.

EDIT: I went to my default.json file, and found that I had put the BLID and password in there before. So, after getting my password from there, I tried again:

C:\Users\David>docker run -e BLID=3178481001416770 -e PASSWORD=:1:1604975896:B68p3pCseF4uidb4 -e ROBOT_IP=192.168.1.192 koalazak/rest980

> [email protected] start /usr/src/app
> node ./bin/www

WARNING: NODE_ENV value of 'production' did not match any deployment config file names.
WARNING: See https://github.com/lorenwest/node-config/wiki/Strict-Mode

Does this look right? I get no response from the WebUI when I try.

I’ve just realized… if I’m running rest980 as a Docker container, I need to be specifying the ports. I’m gonna try that and see where we get :+1:

EDIT: Still doesn’t seem to work :thinking:

Errol:~/homeassistant/rest980/config # docker run -d --name rest980 -p 3000:3000 -e ROBOT_IP=192.168.1.192 -e BLID=3178481001416770 -e PASSWORD=:1:1604975896:B68p3pCseF4uidb4 rest980
64d8eb58d444dcaf33d2c2028320b59b8905aa9a0b2037529a1405d6885bd0ab
Errol:~/homeassistant/rest980/config # docker logs rest980
> [email protected] start /usr/src/app
> node ./bin/www

My default.json:

Errol:~/homeassistant/rest980/config # cat default.json
{
 "port": 3000,
  "blid": "3178481001416770",
  "password": ":1:1604975896:B68p3pCseF4uidb4",
  "robotIP": "192.168.1.192",
  "firmwareVersion": 2,
  "enableLocal": "yes",
  "enableCloud": "yes",
  "keepAlive": "yes",
  "basicAuthUser": null,
  "basicAuthPass": null,
  "sslKeyFile": null,
  "sslCertFile": null
}

This looks ok, so what happens when you try bring up then URL?

http://<ip or fqdn of docker host>:3000/api/local/info/state

When you access this URL, you should get an antry similar to the following in your docker log

GET /api/local/info/state 200 101.214 ms - 3871

If you dont see this… I would suggest checking if you have a local firewall on your docker host?

You know what… I think I’ve got it working! Now I just need to start working it into Home Assistant :wink:

EDIT: Ok, so I can now make calls towards the robot, and also control it (as well as see the map) at http://host_ip:3000/map, but am having trouble figuring out how to get to the image.php… I’ve copied the files from GitHub and edited image.php accordingly, but I don’t know that I’ve got the right URL to it.

I’ve placed all the files from GitHub into a subfolder of my HA config directory, /config/roomba, but get a “Not Found” message when I access it at http://host_ip:3000/roomba/image.php. Curiously, this does seem to be “right”, since the page does have a Roomba favicon :thinking:

I haven’t totally jumped ship from the normal HA integration yet, so haven’t gotten around to setting up all of the automations and stuff yet… but is that why it wouldn’t be working?

I have honestly been mostly satisfied with the normal integration, as my robot doesn’t have the ability to clean specific rooms, and have even set up a nice dashboard for it, along with automated cleaning, notifications, etc… But would really love the live map in Lovelace. However, it does appear that while rest980 is running, I’m not able to use the standard integration at all… Is that just the way it is?

You need to use a seperate container to access the image file as HA does not support php.

In Step 4, note the second docker container for php-nginx, with a volume mouned for the vacuum directory

Yes, I currently have five containers: Home Assistant (aarch64), Swag, Mosquitto, rest980, and php-nginx.

php-nginx should by default expose port 3001, mapping to the internal port of 8080 (you might need to add this mapping to your docker run line)

to access the map - navigate to http://:3001/image.php

Alright, so I’ve got the image.php in the right place (/config/roomba/image.php to my HA container, physically /storage/homeassistant/roomba/image.php), and have updated all the variables accordingly… But even though the log populates correctly, I’m not ever getting a latest.png generated, and visiting http://host_ip:3001/image.php only gives me the following error:
Screenshot 2020-11-28 141052

It appears that I am being able to access the NGINX server, but not the files.

My php-nginx container was started using:
docker run --restart=always -d --name php-nginx -p 3001:8080 -v /storage/homeassistant/roomba:/app webhippie/php-nginx:latest

I’ve verified that even when both containers are running, the sensor in HA is being updated, and the vacuum.log file is being updated accordingly, I am unable to get latest.png to generate, much less get image.php to show me a live map.

EDIT: Forgot to mention that no, I’m not employing any firewall that I’m aware of (and as mentioned, I do appear to at least be able to access the PHP server), and yes, I have added /config/roomba to my allowlist_external_dirs (and the vacuum.log file is obviously being written to in this folder as well).

hello, this integration is compatible with roomba 895 ?
port need put 3000 tcp in router open ?
if this no is compatible you can link me addons compatible?
i add with integration normal ha roomba but see lost connection roomba, need restar in all time.
thx you

Ok i think i know what the issue is…

Try using the following -

docker run --restart=always -d --name php-nginx -p 3001:8080 -v /storage/homeassistant/roomba:/app -e NGINX_WEBROOT=/app webhippie/php-nginx:latest

it could be, but not 100% sure unfortunatley as i dont have one

No, it just need to be reachable from HA/HASS

Aha!! That does seem to have fixed it! I’ll have to set up my floor images now, but I can see the images being generated, and my map card is populating :+1:

1 Like

hi @Syrius … I need a helpfull hand…
using HA on RPi4 , itried to read all the questions but not found where is a problem in my case:
http://homeassistant.local:3000/api/local/info/state is giving a status about Robot
image.php has $vacuum_log = 'http://homeassistant.local:3001/vacuum.log';
but for some reason http://homeassistant.local:3001/image.php give me an errors:

**Warning** : file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name does not resolve in  **/config/vacuum/image.php**  on line  **50**

**Warning** : file_get_contents(http://homeassistant.local:3001/vacuum.log?v=1606847766): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name does not resolve in  **/config/vacuum/image.php**  on line  **50**

**Notice** : Undefined offset: -1 in  **/config/vacuum/image.php**  on line  **57**

**Warning** : Cannot modify header information - headers already sent by (output started at /config/vacuum/image.php:50) in  **/config/vacuum/image.php**  on line  **241**

senson.vacuum also in not avialible


… any idea where to look for a problem?

Try using IP Address, homeassistant.local is not a typical DNS name that your RPi can resolve.

thx, it helped … but problem is not solved
1 .automation is trigered, vacuum.log is created in the folder
2. access to ’ http://192.168.0.110:3001/image.php’ still give the same error.

Notice: Trying to get property 'attributes' of non-object in /config/vacuum/image.php on line 221

Notice: Trying to get property 'batPct' of non-object in /config/vacuum/image.php on line 221

Warning: Cannot modify header information - headers already sent by (output started at /config/vacuum/image.php:221) in /config/vacuum/image.php on line 241
...
A���HF�$#h�4��d @2� A���HF�$#h�4��d @2� A���HF�$#h�4��d @2� A���HF�$#h�4��d @2� A���HF�$#h�4��d @2� A���HF�$#h�4��d @2� A���HF�$#h�4��d @2� A���HF�$#h�������&�IEND�B`�
Warning: imagedestroy(): supplied resource is not a valid Image resource in /config/vacuum/image.php on line 248

Notice: Undefined variable: roomba_stuck in /config/vacuum/image.php on line 249

Warning: imagedestroy() expects parameter 1 to be resource, null given in /config/vacuum/image.php on line 249

Warning: imagedestroy(): supplied resource is not a valid Image resource in /config/vacuum/image.php on line 250

I created a new HA token, just to be sure
image


also a small comment in line 572 https://github.com/jeremywillans/ha-rest980-roomba/blob/bc9949304edf07d9d3a435b9160fe7513a93e6f7/vacuum.yaml#L572
you are using ‘service_template:’ and this command is now replaced just by ‘service’ … https://www.home-assistant.io/docs/scripts/service-calls/#use-templates-to-decide-which-service-to-call