Unlike Home Assistant, openHAB does not come with a vacuum widget out of the box. It does, however, allow adding custom widgets for complex devices.
A collection of custom widgets, rules and integrations for openHAB is available on GitHub: github.com/Hypfer/Valetudo-Openhab
This document tries to explain in enough detail how to add a Valetudo robot to openHAB with the goal of minimizing inconsistencies between different users setups. This will make it easier to share custom integrations among the Valetudo community.
Note: This document applies only to openHAB 3.0 and newer. openHAB 2 and 1 are out of scope. Homie must also be enabled in Valetudo.
mqtt:homie300. Choose a unique name for your robot.
Tip: If you haven’t configured your semantic model, you should probably give it a shot, it simplifies setting up devices by orders of magnitude. Docs.</div>
Enable and configure the channels you want to import from the vacuum. You don’t have to select all of them, and you don’t need to add all the items you configure to your semantic model (to not add them to the model, set the "Semantic class" to "None"). The table below shows the recommended channels to enable and suggested parameters.
Important: Do not change the “Name” fields if you want to use or publish custom widgets and integrations.
Warning: Do not add the map channel: enabling it will fill up your disk since openHAB will log it at every update and it won’t even display. A workaround is available.
|Channel||Type||Category||Semantic class||Semantic Property||Notes|
Tip: If you need to add more channels later you can always select your vacuum from the semantic model, then click “Create Points from Thing”.
Once the vacuum is added and linked, we are ready to add the custom widget. Go to Developer Tools → Widgets → [+ button] and paste the widget code at the end of this page.
You can test it by selecting “Set Props” on the bottom, and adding the settings. You can also change it as you wish.
Due to a bug, openHAB will not register any new channels added after first setup, such as after an upgrade that adds new features (see openhab/openhab-addons/#7467).
A workaround is to delete the thing and recreate it with the same name. This will not affect item links, widgets or anything.
UIDfield in the config - if your UID in the config was
mqtt:homie300:mosquitto:robotyou have to type
robot. Ensure that the generated “Identifier” field matches the old one.
The robot thing should now appear, the old channel links should still be attached, and the new channels should be there.
If Valetudo decided to rename some channels (for example: water grade and fan speed properties will change from
preset after v2021.04) they won’t be relinked automatically.
To relink them:
You will likely notice that options for fan speed and water grade are all lowercase and in a random order. Also, you will see that Clean segments does not have any options.
This is easy to fix from settings.
Add your custom options in the
command=Friendly name format, one per line.
For example, for
viomi.v8 fan speed presets:
low=Low medium=Medium high=High max=Max
For “Clean segments”:
10=Kitchen 17=Living room 11=Bathroom 13=Bedroom
Note: You need I Can’t Believe It’s Not Valetudo with HTTP support enabled.
openHAB is not able to display the map image as sent by ICBINV out of the box. It is easily possible to convert it to a different format using a script rule, however it is still not recommended: the image will still end up in the logs and I wasn’t able to find a proper way to filter it out (see forum thread).
A simple workaround instead is to serve the image over HTTP and use a rule to refresh it at an interval.
YourVacuumMainItemName_MapURL, label to whatever you want, type to Image, semantic class to Point, parent groups to your vacuum’s main item
*/5 * * * * ? *(every 5 seconds)
events.postUpdate('ITEM_NAME', 'ICBINV_URL' + "?cache=" + Date.now());