Install xiaomi-vacuum-card.js: U can install from HACS, under frontend, look for (Simple vacuum card) xiaomi-vacuum-card.js - Ensure you look at the path it installs, if using HACS: go to Config/lovelace dashboards. At the top of page click on resources and will will see the location: /hacsfiles/lovelace-xiaomi-vacuum-card/xiaomi-vacuum-card.js. (This was my issue) I moved the file to: /local/xiaomi-vacuum-card.js. (Note: the actual location is /www/xiaomi-vacuum-card.js). The www file is considered local.
Here are the configs used:
Sure I left out a few thing, it’s 4:30 am, holler if I can be of assistance, but once you get your token (if you don’t have it) and reference the location of js file, you should be on your way.
Hello,
Is it possible to add the translation for the status?
Actually, I have added this (personal code):
var value = isValid
? computeFunc(this.stateObj.attributes[data.key]) + (data.unit || '')
: this._hass.localize('state.default.unavailable');
switch(value) {
case 'Charging':
value = 'Charge';
break;
case 'Cleaning':
value = 'Nettoyage';
break;
case 'Returning home':
value = 'Retour station';
break;
case 'Waiting':
value = 'En attente';
break;
case 'Idle':
value = 'Au repos';
break;
case 'Sleeping':
value = 'En veille';
break;
case 'Paused':
value = 'En pause';
break;
case 'Charger disconnected':
value = 'Chargeur déconnecté';
break;
default:
value = value;
break;
}
const attribute = html`<div>${data.icon && this.renderIcon(data)}${(data.label || '') + value}</div>`;
I don’t know enough to make cleaner code, but I think it would be possible to do a mapping
Have a question; I hide some default attributes like clean_area, but I don’t like the formatting (too many decimals). That is why I converted these attributes via value templates to new sensors. How can I input these sensors into the card on the original spot or the clean_area attribute, so in the right attributes column?
Is someone running this card with Valetudo? I have a Roborock S5 with standard Valetudo on it. The card shows only battery and fan state + the button row. Status is unavailable. Also my brush and filter count isn’t represented as attributes of the vacuum.entitiy but as sensors themselfes. Can I still implement them?
I defined the vendor as ‘valetudo’.
It looks like that:
The latest update completely changed how the vacuum’s attributes are made available to Home Assistant via MQTT. Until this card is updated, it will only work with Valetudo up to version 0.61
As an alternative, this card allows you display attributes from separate entities:
No direct experience of Valetudo RE, so wouldn’t know really. You could downgrade the firmware on your vacuum to Valutudo 0.61, but that seems like a lot of hassle just for a Lovelace view.
If you are looking for a more compact view, you could mess around with card-mod on the alternative card I suggested, and set the image path to []. Here’s an example:
Thanks for the tip, will play around with it a little bit.
I still hope that @benct is gonna release an update of his card for the current Valetudo version
@benct Hello, I am allowed to reuse your card for another project. I have no knowledge of java and css but I managed to adapt the start of my map. Would you know how I could adapt the config.show (for my config config.show.body) button click on toogle. The ideal would be to simulate a click = true a click = false but at startup it is false that it remains on false without putting it in the config otherwise we can no longer modify the name for example
I confirmed that hacs did add the custom card in the lovelace resources, by checking in the GUI
URL: /hacsfiles/lovelace-xiaomi-vacuum-card/xiaomi-vacuum-card.js
Resource Type: Javascript Module
When I try to use the card I get the following error - Custom element doesn’t exist: xiaomi-vacuum-card.
I have tried restarting home assistant and deleting and uninstalling the plugin and then reinstalling. Is there a problem with the latest version of home assistant?