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.
Note: For channel Map you need I Can’t Believe It’s Not Valetudo with “mqtt.publishMapImage” and “mqtt.publishAsBase64” set to “true”.
|Channel||Type||Category||Semantic class||Semantic Property||Notes|
|Map||String||None||None||Change item to image type|
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