iRobot Roomba i7+ Configuration using Rest980

I don’t think that will give me what I am looking for. I want a way to mark that the Roomba has actually been in the room. That way if the job doesn’t get finished, I can clean the remaining rooms after.

I should be able to do something with the location of the vacuum but figuring out the exact coordinates of the rooms would be a bit difficult.

Aaah yeah ok… slightly more difficult but I can appreciate the requirement :rofl:

I’ll have a think also on possible solutions :+1:

until I find a card that is much nicer looking, here’s a way to display the target Clean replace dates in markdown card from the check-button-card sensors, only if you get the latest commit that has timestamp info in the check button cards.

For some reason  friendly_name i typed, in lovelace where the check-button-card entity's were defined isn't replacing the autogenerated friendly_name,  but for me it's good enough until i find a card that display this better i'll switch but for now it does what I need.

image

Click configure-UI, +, MARKDOWN, SHOW CODE EDITOR, then paste the contents below

content: >-
{% set datetime1=state_attr(‘sensor.vacuum_maint_clean_brushes’,
‘visibility_timeout’)|string %}

{% set datetime2=datetime1|regex_replace(find=’ .*’, replace=’’,
ignorecase=true)|int %}

{% set
cleanDate=(as_timestamp((((states(‘sensor.vacuum_maint_clean_brushes’))|int+datetime2|int|multiply(86400))|timestamp_local))|timestamp_custom(’%m/%d/%Y’))
%}

{{ state_attr(‘sensor.vacuum_maint_clean_brushes’, ‘friendly_name’) }}->

…Clean date
{{cleanDate}}…{{ state_attr(‘sensor.vacuum_maint_clean_brushes’,
‘visibility_timeout’) }} togo

{% set datetime1=state_attr(‘sensor.vacuum_maint_clean_contacts’,
‘visibility_timeout’)|string %}

{% set datetime2=datetime1|regex_replace(find=’ .*’, replace=’’,
ignorecase=true)|int %}

{% set
cleanDate=(as_timestamp((((states(‘sensor.vacuum_maint_clean_contacts’))|int+datetime2|int|multiply(86400))|timestamp_local))|timestamp_custom(’%m/%d/%Y’))
%}

{{ state_attr(‘sensor.vacuum_maint_clean_contacts’, ‘friendly_name’) }}->

…Clean date
{{cleanDate}}…{{ state_attr(‘sensor.vacuum_maint_clean_contacts’,
‘visibility_timeout’) }} togo

{% set datetime1=state_attr(‘sensor.vacuum_maint_clean_filter’,
‘visibility_timeout’)|string %}

{% set datetime2=datetime1|regex_replace(find=’ .*’, replace=’’,
ignorecase=true)|int %}

{% set
cleanDate=(as_timestamp((((states(‘sensor.vacuum_maint_clean_filter’))|int+datetime2|int|multiply(86400))|timestamp_local))|timestamp_custom(’%m/%d/%Y’))
%}

{{ state_attr(‘sensor.vacuum_maint_clean_filter’, ‘friendly_name’) }}->

…Clean date
{{cleanDate}}…{{ state_attr(‘sensor.vacuum_maint_clean_filter’,
‘visibility_timeout’) }} togo

{% set datetime1=state_attr(‘sensor.vacuum_maint_clean_wheel’,
‘visibility_timeout’)|string %}

{% set datetime2=datetime1|regex_replace(find=’ .*’, replace=’’,
ignorecase=true)|int %}

{% set
cleanDate=(as_timestamp((((states(‘sensor.vacuum_maint_clean_wheel’))|int+datetime2|int|multiply(86400))|timestamp_local))|timestamp_custom(’%m/%d/%Y’))
%}

{{ state_attr(‘sensor.vacuum_maint_clean_wheel’, ‘friendly_name’) }}->

…Clean date
{{cleanDate}}…{{ state_attr(‘sensor.vacuum_maint_clean_wheel’,
‘visibility_timeout’) }} togo

{% set datetime1=state_attr(‘sensor.vacuum_maint_replace_brushes’,
‘visibility_timeout’)|string %}

{% set datetime2=datetime1|regex_replace(find=’ .*’, replace=’’,
ignorecase=true)|int %}

{% set
replaceDate=(as_timestamp((((states(‘sensor.vacuum_maint_replace_brushes’))|int+datetime2|int|multiply(86400)|multiply(30))|timestamp_local))|timestamp_custom(’%m/%d/%Y’))
%}

{{ state_attr(‘sensor.vacuum_maint_replace_brushes’, ‘friendly_name’) }}->

…Replace date
{{replaceDate}}…{{ state_attr(‘sensor.vacuum_maint_replace_brushes’,
‘visibility_timeout’) }} togo

{% set datetime1=state_attr(‘sensor.vacuum_maint_replace_filter’,
‘visibility_timeout’)|string %}

{% set datetime2=datetime1|regex_replace(find=’ .*’, replace=’’,
ignorecase=true)|int %}

{% set
replaceDate=(as_timestamp((((states(‘sensor.vacuum_maint_replace_filter’))|int+datetime2|int|multiply(86400)|multiply(30))|timestamp_local))|timestamp_custom(’%m/%d/%Y’))
%}

{{ state_attr(‘sensor.vacuum_maint_replace_filter’, ‘friendly_name’) }}->

…Replace date
{{replaceDate}}…{{ state_attr(‘sensor.vacuum_maint_replace_filter’,
‘visibility_timeout’) }} togo

{% set datetime1=state_attr(‘sensor.vacuum_maint_replace_wheel’,
‘visibility_timeout’)|string %}

{% set datetime2=datetime1|regex_replace(find=’ .*’, replace=’’,
ignorecase=true)|int %}

{% set
replaceDate=(as_timestamp((((states(‘sensor.vacuum_maint_replace_wheel’))|int+datetime2|int|multiply(86400)|multiply(30))|timestamp_local))|timestamp_custom(’%m/%d/%Y’))
%}

{{ state_attr(‘sensor.vacuum_maint_replace_wheel’, ‘friendly_name’) }}->

…Replace date
{{replaceDate}}…{{ state_attr(‘sensor.vacuum_maint_replace_wheel’,
‘visibility_timeout’) }} togo

Last Mission: {{ state_attr(‘sensor.rest980’, ‘cleanMissionStatus’)[“sqft”] }}
sqft
title: Reminder info
type: markdown

@SuperMario - I’ve fixed the rotate issue ! image.php variables now only rotates the Roomba lines, the floor.png is untouched now.

Let me know how it goes :slight_smile:

Nice concept @pnakashian! I’ll have a think of how this can be better implemented with the Check Button Card :+1:

I have merged the Dev branch into Master and published this as Version 0.2 :partying_face:

There is also now a FAQ which covers the majority of encountered issues.

Please let me know if you think anything else needs to be added :+1:

Hold the Clean button for two seconds when starting the pair process

I think you meant to say

HOME

in step 1 of the FAQ.
<3 Got mine working pretty well. Haven’t tried to get selected rooms cleaning yet. Does the “all but one room” clean cycle have to run completely and finish? Then the “last room” clean cycle have to run and finish, to get the right info?

As yes, I shall update that :man_facepalming:

Nah, once the cycle starts it’s displayed on the web page then you can pause it :blush:

I have set this new custom vacuum card with some modifications for Romba980 model, but I can’t see this vacuum image like in your example. I have in \local\ both files:

  • roomba-vacum-card.js
  • vacuum.png

but in Lovelace I have just states without roomba image?
image

@SuperMario

Add the following options to Lovelace

  • type: custom:roomba-vacuum-card
    entity: sensor.vacuum
    image: /local/vacuum.png
    clean_base: false

This should replace clean base with bin and show the background :+1:

Thanks, it worked as expected :smiley:
Onbe more thing, I can get a map inside lovelace:
image
it seams that automation for image creation didn’t occure. Even if I try to execute automation manually I can’t get the image in Lovelace.
In the same time I can see on hassio_IP:nginix_port/image.php floormap and cleaning map…

So the map is working if you browse to the image.php?

Check the vacuum map URL secret for the camera section in secrets.yaml

It was the wrong port number for image.php…
Now is working like a charm.
On more question. If job ended in Stuck mode, and I realocate the Roomba to the new location or even place directly to the base will then automation occure when the robot status changed to ready? Because the trigger for image creation is transition from Cleaning -> Ready for more then 10s, right?
Thank you all once again for all of your support and help :smiley:

Essentially yes.

The Roomba has status and mode, (which internally is called cycle and phase).

The automations for mapping occur for Ready to Clean or Train and like you said, from Clean/Train back to Ready.

Stuck is actually a mode, so if it does get stuck the automations continue to run - as the cycle hasn’t finished unless you stop or send the robot home.

If you did pickup and move the Roomba (more than just into a flat surface) it will likely mess with the map coordinates until it rediscovered its location and continued the cycle.

Hope this helps and your welcome :blush: glad it’s working :+1:

Great stuff -

I am struggling with the Map. Can anyone explain or point to how to figure out how to adjust the x / y off sets, flips and rotates? Also image size adjustment? Width, height . Lastly floor png dimensions. 300x300?

A lot I know… i’ve been adjusting like crazy. Only result has been increase blood pressure.

Paul

it took me a bit of fussing with it. But eventually I got it to work. building a floorplan and scaling it to fit the map is by far the most difficult. I’ve found, that if you set the dimensions and such in the php first. refreshing after every change to figure out what direction you need to go, then once you have a good map, then save that image, make a new image in paint.net or photoshop or something that has layers. Make the map the top layer, then draw your floor plan around it. This works best if you have some exposed WALL in each room of the house. This allows you to draw your floorplan the exact size of your house. I snapshotted the smart map, then cropped the two halves of my long house together, then layed that map, under the drawn line map, resized and refreshed for about 30 minutes. then I ended up with something… acceptable. Not clean, not pretty, but it’s enough that I can look at it and say, “Yes, the kitchen has been cleaned” , or, “Don’t go in there mom, Rosie is hard at work”

1 Like

Thanks @austech360 - That helped - I think a key learning… adjust the image.php while the remote is in full clean mode. Start with x / y off set… then size as it complete the job. Really have to check it every 5 mins to adjust. I’ve now got a good base blank image. Will now work with layers.

1 Like

Hi @Syrius
I found some minor issue with one of the automation scripts.

i’m getting this in my log only i noticed it when i was running the vacuum and looking at the vacuum camera in lovelace just happened to be looking at the home-automation.log file. I can also go to Automation Editor and invoke it there, I get the same log error.

2020-02-14 12:00:00 ERROR (MainThread) [homeassistant.components.automation] Error while executing automation automation.vacuum_maintenance_check. Unknown error for call_service at pos 1:
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/components/automation/init.py”, line 449, in action
await script_obj.async_run(variables, context)
File “/usr/src/homeassistant/homeassistant/helpers/script.py”, line 189, in async_run
await self._handle_action(action, variables, context)
File “/usr/src/homeassistant/homeassistant/helpers/script.py”, line 272, in _handle_action
await self._actions[_determine_action(action)](action, variables, context)
File “/usr/src/homeassistant/homeassistant/helpers/script.py”, line 354, in _async_call_service
context=context,
File “/usr/src/homeassistant/homeassistant/helpers/service.py”, line 66, in async_call_from_config
domain_service = config[CONF_SERVICE_TEMPLATE].async_render(variables)
File “/usr/src/homeassistant/homeassistant/helpers/template.py”, line 221, in async_render
return compiled.render(kwargs).strip()
File “/usr/local/lib/python3.7/site-packages/jinja2/asyncsupport.py”, line 76, in render
return original_render(self, *args, **kwargs)
File “/usr/local/lib/python3.7/site-packages/jinja2/environment.py”, line 1008, in render
return self.environment.handle_exception(exc_info, True)
File “/usr/local/lib/python3.7/site-packages/jinja2/environment.py”, line 780, in handle_exception
reraise(exc_type, exc_value, tb)
File “/usr/local/lib/python3.7/site-packages/jinja2/_compat.py”, line 37, in reraise
raise value.with_traceback(tb)
File “”, line 1, in top-level template code
File “/usr/local/lib/python3.7/site-packages/jinja2/runtime.py”, line 430, in init
self._after = self._safe_next()
File “/usr/local/lib/python3.7/site-packages/jinja2/runtime.py”, line 450, in _safe_next
return next(self._iterator)
File “”, line 22, in t_1
TypeError: ‘<’ not supported between instances of ‘NoneType’ and ‘float’

i think the problem is from this line
{% for item in states.sensor if ‘vacuum_maint’ in item.entity_id and (state_attr(item.entity_id, ‘visibility_timestamp’) < as_timestamp(now())) %}
{% set ns.count = loop.index %}
{% endfor %}

the 7 entities don’t have visibility_timestamp in my HA, instead they have just timestamp or visibility_timeout closest matching names, looking at Developer Tools.states.

i went back to github for the ckeck-button card tree branch e80ef56 download again
this file, copy/paste in raw mode.

https://github.com/jeremywillans/check-button-card/blob/e80ef5647f042f78aa06df50d2d6014a417fb0ab/check-button-card.js

replaced my check-button-card.js restarted hassio, i still don’t have attribute visibility_timestamp that the automation script expects. am I missing some other configuration to get the attribute name visibility_timestamp?
do I need to declare visibility_timestamp in the lovelace button-card entities section like visibility_timeout was declared?

for now I edited visibility_timestamp to -> timestamp which the 7 entities do have.
state_attr(item.entity_id, ‘timestamp’)

running the automation script vacuum maintenance check manually from Automation Editor throws no errors after this workaround.

/Pierre

Hi @pnakashian,

If you have replaced the check-button-card, you will need to update the sensors to “recreate” the attributes. Simply click on the sensor and it will update, you can then hit the undo button to restore it back to your previous date. (So this process will re write the attributes twice)

You can also press hold on the sensors to manually set a time in the past :+1:

Is it possible to increase mapping accuracy by reducing the polling time?
Is it possible to make it actually “fill in” the area that it’s cleaned? Maybe make the lines thicker so it creates a “path” so to speak?

I used to have a Robart vacuum and REALLY liked the cleaning map it would give in live time.

Any way to get something along these lines? Thoughts? Also. Maybe a way to adjust fan speed, and “cleaning passes” Also, Is it possible to set the order of rooms cleaned? Like, at 8:30 I want the master bedroom cleaned because my grandpa goes to bed around 9, but I want it to finish the rest of the house afterward. I don’t want to have to set schedules like 8:30 - Master bedroom then at 9:00 - Rest of the house.

Just some features I’d like to see. You’re doing a GREAT job with this. It looks FANTASTIC and I’m loving having all my eggs in one basket, If I can uninstall the iRobot app and never have to use it again, that would be AMAZING!

Hi @Syrius,
that didn’t work, but I finally got it working, and maybe removed some unnecessary config in my configuration.yaml

my current setup in configuration.yaml , my external mqtt broker can handle
multiple discovery prefixes, I didn’t need the discovery_prefix so i removed it.

mqtt:
broker: 127.0.0.1
port: 1884
client_id: hass
discovery: true
protocol: 3.1
keepalive: 60

here’s the gotcha when trying to install a plugin that the HACS doesn’t have a way of installing the specific commit. I installed from HACS 1st, then I overwrote the file /config/www/community/check-button-card/check-button-card.js from the tree branch e80ef56.

But Homeassistant ignored this overwritten file, it somehow used the original version that I installed from HACS. In the same directory /config/www/community/check-button-card/ there was another file that I ignored check-button-card.js.gz. Home assistant or some component either checked the 2 files were not in sync or it just uses check-button-card.js.gz instead.

so anybody that copies check-button-card.js to the folder /config/www/community/check-button-card/ from another location they will also need to run gzip check-button-card.js , and copy check-button-card.js.gz into /config/www/community/check-button-card/.

Now I have visibility_timestamp which I never did. makes the calculations in my previous posted script unnessary.

{% set cleanDate=as_timestamp(state_attr(‘sensor.vacuum_maint_clean_brushes’,‘visibility_timestamp’)|timestamp_local)|timestamp_custom(’%m/%d/%Y’) %}
{{ state_attr(‘sensor.vacuum_maint_clean_brushes’, ‘friendly_name’) }}->
…Clean date {{cleanDate}}…{{ state_attr(‘sensor.vacuum_maint_clean_brushes’, ‘visibility_timeout’) }} togo

{% set cleanDate=as_timestamp(state_attr(‘sensor.vacuum_maint_clean_contacts’,‘visibility_timestamp’)|timestamp_local)|timestamp_custom(’%m/%d/%Y’) %}
{{ state_attr(‘sensor.vacuum_maint_clean_contacts’, ‘friendly_name’) }}->
…Clean date {{cleanDate}}…{{ state_attr(‘sensor.vacuum_maint_clean_contacts’, ‘visibility_timeout’) }} togo

{% set cleanDate=as_timestamp(state_attr(‘sensor.vacuum_maint_clean_filter’,‘visibility_timestamp’)|timestamp_local)|timestamp_custom(’%m/%d/%Y’) %}
{{ state_attr(‘sensor.vacuum_maint_clean_filter’, ‘friendly_name’) }}->
…Clean date {{cleanDate}}…{{ state_attr(‘sensor.vacuum_maint_clean_filter’, ‘visibility_timeout’) }} togo

{% set cleanDate=as_timestamp(state_attr(‘sensor.vacuum_maint_clean_wheel’,‘visibility_timestamp’)|timestamp_local)|timestamp_custom(’%m/%d/%Y’) %}
{{ state_attr(‘sensor.vacuum_maint_clean_wheel’, ‘friendly_name’) }}->
…Clean date {{cleanDate}}…{{ state_attr(‘sensor.vacuum_maint_clean_wheel’, ‘visibility_timeout’) }} togo

{% set replaceDate=as_timestamp(state_attr(‘sensor.vacuum_maint_replace_brushes’,‘visibility_timestamp’)|timestamp_local)|timestamp_custom(’%m/%d/%Y’) %}
{{ state_attr(‘sensor.vacuum_maint_replace_brushes’, ‘friendly_name’) }}->
…Replace date {{replaceDate}}…{{ state_attr(‘sensor.vacuum_maint_replace_brushes’, ‘visibility_timeout’) }} togo

{% set replaceDate=as_timestamp(state_attr(‘sensor.vacuum_maint_replace_filter’,‘visibility_timestamp’)|timestamp_local)|timestamp_custom(’%m/%d/%Y’) %}
{{ state_attr(‘sensor.vacuum_maint_replace_filter’, ‘friendly_name’) }}->
…Replace date {{replaceDate}}…{{ state_attr(‘sensor.vacuum_maint_replace_filter’, ‘visibility_timeout’) }} togo

{% set replaceDate=as_timestamp(state_attr(‘sensor.vacuum_maint_replace_wheel’,‘visibility_timestamp’)|timestamp_local)|timestamp_custom(’%m/%d/%Y’) %}
{{ state_attr(‘sensor.vacuum_maint_replace_wheel’, ‘friendly_name’) }}->
…Replace date {{replaceDate}}…{{ state_attr(‘sensor.vacuum_maint_replace_wheel’, ‘visibility_timeout’) }} togo

Last Mission: {{ state_attr(‘sensor.rest980’, ‘cleanMissionStatus’)[“sqft”] }} sqft