causes same error Unable to send command to the vacuum: {'code': -10000, 'message': 'data for segment is not a number'}
I think that the problem is in the service itself - it accepts a number, not a string.
I tried this call:
Made this, gonna test it after completion of the started cleaning:
params: >-
{% set ns = namespace(COMMAND = "") -%}
{%- set ROOM_FLAGS = expand('group.vacuum_clean_rooms') -%}
{%- for flag in ROOM_FLAGS -%}
{%- if flag.entity_id | regex_match("input_boolean.vacuum_clean_room_", ignorecase=False) and
is_state(flag.entity_id,'on') -%}
{%- set ROOM = flag.entity_id.split("vacuum_clean_room_")[1] -%}
{%- set ROOM_NUMBER = states('input_number.vacuum_clean_room_number_' + ROOM)|int -%}
{%- set CLEAN_COUNT = states('input_number.vacuum_clean_room_count_' + ROOM)|int -%}
{%- set ROOM_NUMBER_STRING = (ROOM_NUMBER|string +"|int" + ",") * CLEAN_COUNT -%}
{%- set ns.COMMAND = ns.COMMAND + ROOM_NUMBER_STRING -%}
{%- endif -%}
{%- endfor -%}
{%- set ns.COMMAND = (ns.COMMAND)[:-1] -%}
[{{ ns.COMMAND }}]
Actually, I have never used from_json things, need some time for testing…
Update:
Because of unknown reasons the script above did not work - same error as before…
So I went back to the previous version with this expression: [{{ ns.COMMAND }}]
and without this expression: +"|int"
Code:
vacuum_clean_rooms:
alias: 'vacuum: Clean rooms'
sequence:
- service: vacuum.send_command
data:
entity_id: vacuum.xiaomi_roborock_s50
command: app_segment_clean
params: >-
{% set ns = namespace(COMMAND = "") -%}
{%- set ROOM_FLAGS = expand('group.vacuum_clean_rooms') -%}
{%- for flag in ROOM_FLAGS -%}
{%- if flag.entity_id | regex_match("input_boolean.vacuum_clean_room_", ignorecase=False) and
is_state(flag.entity_id,'on') -%}
{%- set ROOM = flag.entity_id.split("vacuum_clean_room_")[1] -%}
{%- set ROOM_NUMBER = states('input_number.vacuum_clean_room_number_' + ROOM)|int -%}
{%- set CLEAN_COUNT = states('input_number.vacuum_clean_room_count_' + ROOM)|int -%}
{%- set ROOM_NUMBER_STRING = (ROOM_NUMBER|string +",") * CLEAN_COUNT -%}
{%- set ns.COMMAND = ns.COMMAND + ROOM_NUMBER_STRING -%}
{%- endif -%}
{%- endfor -%}
{%- set ns.COMMAND = (ns.COMMAND)[:-1] -%}
[{{ ns.COMMAND }}]
Probably earlier I started the script before it was actually updated in HA after correction.
So to be sure I restarted HA - and the script works!
hey, I’m new in HA so sorry for probably stupid questions. questions are related to both Xiaomi Cloud Vacuum Map Extractor and Lovelace Xiaomi Vacuum Map card:
it is nowhere said how vacuum itself should be integrated in HA (to get entity for Lovelace Xiaomi Vacuum Map card). I understand, that probably it is out of scope, but for new users it can be very helpful. tried first via Vacuum integration, but entity didn’t appear. then tried via Xiaomi Miio and finally get entity. but this integration cannot be configured via config. is it correct way?
how can I clean specific rooms? example in config is based only on coordinates, not sure if it is proper way, because in MiHome I can clean specific rooms with complex shapes.
how can I get room numbers? there is said in the docs add rooms/room_numbers attribute - and what next? in tons of comments I found that I should check it in dev tools. how? what should I do to see it? https://i.imgur.com/OECBfta.png why docs is so not new-user-friendly
I have HA in russian, obviously set russian language in Lovelace Xiaomi Vacuum Map card, but bottom row still has mixed texts from english and russian. is it a bug? missing translation? misconfiguration? https://i.imgur.com/XJyWlIE.png
Vacuum configuration depends on specific model, I am not able to cover all cases. You should use an integration that supports your model, built-in Xiaomi Miio is always a good first shot.
This screenshot shows attributes of the vacuum, room numbers are in attributes of a camera entity.
These values are entity states/attributes, which currently are not translated. Maybe I will add possibility to translate them in future versions of the card.
another question: is there any way to reset sensors/filter/main brush/side brush from the card? it is the only thing, for which I still need MiHome. I saw tap_action/hold_action/double_tap_action options in config, but better to have example.
This has stopped working on the latest beta, 2021.12.0b1 error below
Entity camera.xiaomi_cloud_map_extractor (<class ‘custom_components.xiaomi_cloud_map_extractor.camera.VacuumCamera’>) implements device_state_attributes. Please report it to the custom component author
This error originated from a custom integration.
Logger: custom_components.xiaomi_cloud_map_extractor.camera
Source: custom_components/xiaomi_cloud_map_extractor/camera.py:333
Integration: xiaomi_cloud_map_extractor (documentation, issues)
First occurred: 09:14:27 (1 occurrences)
Last logged: 09:14:27
Unable to retrieve map data
I see the same errors like @sender in the error logs. On a daily base and multiple times. They happen since v.1-times already but I just ignore them because all is seemingly working despite of the error:
However, what is strange is that this error only occurs on one of my two identic S5 Max devices (same model, same firmware, same configuration, same wlan/ssid).
This is in fact what I am suspecting although I have full wifi coverage throughout the whole floor.
I have done several wifi-resets before but it does not help. But as I said before: Since the vacuum doesn’t seem to loose its functionality I have learned to just ignore the error messages (although they somehow still bother me )