Valetudo RE: Minor improvements for full support
See original GitHub issueDescription
I finally found the time to update to the latest version of your awesome card and tested the vacuum_platform: rand256/ValetudoRE
.
I am close to a fully configured card utilizing pretty much all features, which Valetudo RE supports. I posted my configuration in the discussions (see #435).
While most things work as intended, I observed some minor things, which could be improved:
A) vacuum_clean_segment
When selecting repeats > 1, the mqtt command appears to be slightly redundant:
{
"command": "segmented_cleanup",
"segment_ids": [
"Schlafzimmer",
"Schlafzimmer"
],
"repeats": 2,
"afterCleaning": "Base"
}
with the segment id being repeated as well as the global "repeats: 2"
set. As far as I understand the API, only the latter should be done.
B) vacuum_goto_predefined
On the card it is possible to select multiple predefined locations, which results in the following command:
{
"command": "go_to",
"spot_id": "Sofa,Schreibtisch"
}
Yet only one selection should be allowed.
C) (predefined)zoned_cleanup As I found the room detection of the map to be not as reliable, I have configured several predefined zones on the vacuum. My card is currently configured to handle them like this:
map_modes:
- name: test
icon: mdi:select-drag
selection_type: ROOM
service_call_schema:
service: mqtt.publish
service_data:
topic: valetudo/rockrobo/custom_command
payload: >-
{ "command": "zoned_cleanup", "zone_ids": [[selection]],
"afterCleaning": "Base" }
What I would like to do is to add repeats with:
repeats_type: INTERNAL
max_repeats: 3
The MQTT API requests a form like:
{
"command": "zoned_cleanup",
"zone_ids": [
"Foo", // zone without repeat can be parsed directly, as done above
{ // however, zones with repeat have to be encapsuated like this
"id": "Bar",
"repeats": 2
}
],
"afterCleaning": "Stop"
}
D) Auto-discovery of predefined zones/spots/rooms
Valetduo RE allows MQTT access to all predefined zones/spots/rooms from the vacuum with custom_command/get_destinations
resulting in something like:
{
"spots": [
{
"name": "SpotA",
"coordinates": [
32396,
24058
]
},
{
"name": "SpotB",
"coordinates": [
24744,
28526
]
}
],
"zones": [
{
"name": "ZoneA",
"coordinates": [
[
28889,
23472,
30306,
24685,
1 // I do not know what this number stands for
]
]
},
{
"name": "ZoneB", // apparently a zone can also consist of multiple rectangles
"coordinates": [
[
28475,
24604,
30665,
25960,
1
],
[
28676,
25871,
30219,
29701,
1
]
]
}
],
"rooms": [
{
"name": "RoomA",
"id": 18 // the IDs appear to be auto generated
},
{
"name": "RoomB",
"id": 17
}
],
"updated": 1643509313129
}
Yet, I have to either write a Jinja2 template and run it each time new predefined zones/spots/rooms are created on the vacuum, or add all of them manually to the card.
Solution
A) Instead of using REPEAT
in the platform template, it should be set to EXTERNAL
in order to get:
{
"command": "segmented_cleanup",
"segment_ids": [
"Schlafzimmer"
],
"repeats": 2,
"afterCleaning": "Base"
}
B) Limit the selection of predefined spots on the card to one. Is this possible?
C) Maybe it is possible to add a service call placeholder, e.g. [[selection_objects]]
returning the required object-like output?:
[
{
"id": "Foo",
"repeats": 2
},
{
"id": "Bar",
"repeats": 2
}
]
D) I know there are some Jinja2 templates available to generate the required code for the card. However, it would be awesome if the card itself could extract these predefined zones/spots/rooms automatically. This way they would always be up to date with those defined on the vacuum.
Alternatives
No response
Context
No response
Issue Analytics
- State:
- Created a year ago
- Comments:15 (15 by maintainers)
Top GitHub Comments
Update
I have added support for:
I have tested it with the latest built and it works!