Closed Xyaren closed 1 year ago
Further information in this discussion: https://github.com/humbertogontijo/homeassistant-roborock/discussions/40
@Xyaren @Matte8519 Could you provide me some info about entities created by Roborock integration?
F12
button)getDeviceData = async (entity) => {
const hass = document.querySelector("home-assistant").hass;
const vacuumDeviceId = (
await hass.callWS({
type: "config/entity_registry/get",
entity_id: entity,
})
)["device_id"];
const vacuumSensors = (
await hass.callWS({
type: "config/entity_registry/list",
})
).filter(e => e.device_id === vacuumDeviceId);
Promise.all(
vacuumSensors.map(vs =>
hass.callWS({
type: "config/entity_registry/get",
entity_id: vs.entity_id,
}),
),
).then(v => console.log(v));
}
getDeviceData("vacuum.your_vacuum");
piotr.machowski.dev [at] gmail.com
Just sent you the email 👍
This is my current card config which is using a custom sensor:
@Xyaren great, thank you!
Can you check out this version?
GoTo works. Zone Cleaning works (Including multiplier). Room Config generation works, cleaning is started.
The default looks better than the actual homeassistant-roborock template due to the stats missing?
~That's weird, it should generate more tiles than default (Miio) platform... Are there any errors in browser's console? Can you show card's config?~
EDIT: I have fixed it in v2.1.3-beta.3
It looks good 👍 I have not added all tiles that you have configured manually because it seems to be a bit too much. Buuuuut I might add them and create an instruction that will explain how to disable a specific tile instead
I think the "Status" is quite useful to have the other ones are probably not that useful.
Status tile should work, can you show attributes of your vacuum entity? It should contain status
attribute
fan_speed_list:
- 'off'
- silent
- balanced
- turbo
- max
- max_plus
- custom
mop_mode_list:
- standard
- deep
- deep_plus
- custom
mop_intensity_list:
- 'off'
- mild
- moderate
- intense
- custom
msg_ver: 2
msg_seq: 1937
state: docked
battery: 100
clean_time: 50
clean_area: 382500
error_code: 0
map_present: 1
in_cleaning: 0
in_returning: 0
in_fresh_state: 1
lab_status: 3
water_box_status: 0
fan_power: 102
dnd_enabled: 0
map_status: 3
is_locating: 0
lock_status: 0
water_box_mode: 202
water_box_carriage_status: 0
mop_forbidden_enable: 0
adbumper_status:
- 0
- 0
- 0
water_shortage_status: 0
dock_type: 0
dust_collection_status: 0
auto_dust_collection: 1
mop_mode: standard
debug_mode: 0
dock_error_status: 0
unsave_map_reason: 4
unsave_map_flag: 0
battery_level: 100
battery_icon: mdi:battery-charging-100
fan_speed: balanced
vacuum_status: charging
mop_intensity: moderate
error: Keine
icon: mdi:robot-vacuum
friendly_name: Fussel
supported_features: 16383
Ok, "Status" tile is missing because Roborock integration declares that is supports VacuumEntityFeature.STATUS
, but its attributes doesn't contain it. I suspect this is caused by defining state_attributes
instead of extra_state_attributes
(here). Could you try to adjust this misalignment (probably just in your own instance at first) and check if the appropriate attribute and its tile will appear?
I'm not the developer, maybe @humbertogontijo can help ?
You can just modify it in your HA in vacuum.py
file to confirm it:
```diff status = self._device_status.state return STATE_CODES_TO_STATUS.get(status) @property - def state_attributes(self) -> dict[str, Any]: """Return the state attributes of the vacuum cleaner.""" if not self._device_status: return {} data = dict(self._device_status) ``` | ```diff status = self._device_status.state return STATE_CODES_TO_STATUS.get(status) @property + def extra_state_attributes(self) -> dict[str, Any]: """Return the state attributes of the vacuum cleaner.""" if not self._device_status: return {} data = dict(self._device_status) ``` |
After modification you have to restart HA and check attributes of the vacuum
entity for changes.
@PiotrMachowski thank you for the tip @Xyaren You should see the status tile automatically now using version 0.1.2 of the Roborock integration
@humbertogontijo great, thanks for a quick fix!
Nice! Working :)
Hopefully, Roborock will be soon a core integration: https://github.com/home-assistant/core/pull/89456 🤞
@Misiu Looks good 👍 unfortunately I don't think it will have map support soon
@PiotrMachowski I've just tried https://github.com/humbertogontijo/homeassistant-roborock with Your card (v2.2.0-beta.1) and the map got extracted (not sure if we are talking about the same feature 🙂) Sadly the maps look the same as in the Roborock app, which is terrible (it's not because of your card btw), so now I need to read a bit more about the possibility to replace that terrible image with a custom-made image (without those rays going out thru windows) and use that image as a background (is this even supported?)
BTW I noticed that card is making a lot of requests to http://homeassistant.local:8123/api/camera_proxy/camera.stefan_map?token=XXX is this a bug or maybe we can disable this (I get the same image all the time)? I can create a separate issue with more details on this.
I've just tried https://github.com/humbertogontijo/homeassistant-roborock with Your card (v2.2.0-beta.1) and the map got extracted (not sure if we are talking about the same feature 🙂)
The version in PR doesn't contain map camera.
Sadly the maps look the same as in the Roborock app, which is terrible (it's not because of your card btw)
Well, map rendering is also handled by my code - taken from Map Extractor
BTW I noticed that card is making a lot of requests to http://homeassistant.local:8123/api/camera_proxy/camera.stefan_map?token=XXX is this a bug or maybe we can disable this (I get the same image all the time)?
This is caused by refreshing the map image whenever the card is updated (e.g. because of change in entity that is displayed in a tile). I might try to optimize it someday though
This is caused by refreshing the map image whenever the card is updated (e.g. because of change in entity that is displayed in a tile). I might try to optimize it someday though
That would be awesome! A lot of unneeded requests could be skipped.
The version in PR doesn't contain map camera.
Didn't know that, I'm using the integration I linked via HACS.
Well, map rendering is also handled by my code - taken from Map Extractor
The map displayed on your card looks exactly like the map in the Roborock app, so that's not the problem. What I was trying to ask: is there an option to use a static (custom-made) image as a card image and only show vacuum position on it?
This is the image I get from the camera proxy: I could use Gimp or https://www.photopea.com/ to create a custom (much cleaner) image and use it instead. Just don't know if this is possible.
What I was trying to ask: is there an option to use a static (custom-made) image as a card image and only show vacuum position on it?
No, it's not possible at this moment. There is a feature request for this functionality: #503
@Misiu Looks good 👍 unfortunately I don't think it will have map support soon
Yep - Core approval takes a bit. Map support will come but it is on the lower end of my priorities for the official integration, and we'll need the extraction logic in a custom pypi package.
@Lash-L yeah, I'll do it someday 😉 anyway, I don't think that official integration will include calibration points
@Lash-L yeah, I'll do it someday 😉
Yep no rush! Like I said it is on the lower end of my priorities anyways
anyway, I don't think that official integration will include calibration points
What do you mean by calibration points?
Calibration points are a concept that I have introduced in the first version of this card. They are used to calculate coordinates in the vacuum's coordinate system from coordinates on the map image. More on them here.
They are required for this card to work properly. Integrations that provide map that can be used automatically with this card return calibration points as an attribute of a camera entity. Custom Roborock integration returns them here
Sorry to butt in, but I just wanted to ask the extent to which Roborock support is working in the last beta. As a result of the Roborock integration in core 2023.5 I discovered the HACS integration and would like to move over from Xiaomi, but I depend on your card to drive the vacuum.
The Hacs integration works very well with the card.
The core integration will not work with the card for at least a few more releases
@wigster for now you can check https://github.com/humbertogontijo/homeassistant-roborock/discussions/40
Done in v2.2.0
Integration repository
https://github.com/humbertogontijo/homeassistant-roborock
Supported features
Vacuum entity/entities
Service calls
Resetting consumables
Goto
Clean Room
Spot Clean
Locate (Robot announces "I am here" via Speakers)
Stop
There is also
RTB
Untested:
Other info
The integration is in a very early stage but being worked on. Attributes on vaccuum are currently still missing. https://github.com/humbertogontijo/homeassistant-roborock/issues/16
All in all very similar to xiaomiMiio.
Rooms use numerical Ids instead of strings!