It’s very impressive! Can we make multiple zoned cleaning with this card? (2nd gif)
@pergola.fabio Yes, I am a programmer, but I do not use Google Assistant
@Yoinkz My map is created from screens from Mi Home, I have spent some time to clean it up
@krovachek I am not sure this is what you mean, but currently if you want to clean specified area multiple times you have to draw zones yourself (like in 1st gif)
i already have the code what ± needs to be changed in google_assistant
but also in the vacuum component needs to be some extra attiributes, like predefined “zones” that google_assistant can use
i am looking for someone who is able to do that
For everyone interested in my card I have created a separate thread:
I mean if I select more than one zone in same time, for example kitchen, room, bedroom, etc. then all of selected zone will be cleaned one after another, not just one of them.
Oh, now I understand that is the purpose of this mode: all selected (green) zones will be cleaned
I use Node RED for it but I want to try your card therefore I guess there will be more question
So far just the trick of the reference point and base position determination on the map image is the questionable for me.
No problem, but with future questions I suggest to move to thread specific for this card (linked above).
Personally I also do not really like this trick, but it was my only idea for map calibration. If you have better idea do not hesitate to suggest it
Any cards with an map. The app keep lossing it’s dataof my house. So hopefully to store on HA and use on card for an map like the application. But I think it’s going to take some time to build something like that.
I plan to root my vacuum and then create card with live map view. Hopefully it will also remove the need for manual map calibration. When it all will be done Mi Home will be almost fully recreatable in HA
i am reletiv new to HA and custom cards,
can some help me to get this? i have inte vacuum “installd” in config, i can see it in my HA.
but i dont have lovelace.ymal bescus i cant use the gui card. i think:S
cleaned my sensors of the vacuum today and want to reset the sensor_dirty_left, but I can’t get it reseted
service: vacuum.send_command
{
"entity_id": "vacuum.xiaomi_vacuum_cleaner",
"command": "reset_consumable",
"params": { "ensor_dirty_left": "0" }
}
anyone can help out?!
vacuum_reset_main_brush:
alias: "Reset Spazzola Principale"
sequence:
- service: vacuum.send_command
data_template:
entity_id: >
{{states('input_text.vacuum')}}
command: reset_consumable
params: main_brush_work_time
vacuum_reset_side_brush:
alias: "Reset Spazzola Laterale"
sequence:
- service: vacuum.send_command
data_template:
entity_id: >
{{states('input_text.vacuum')}}
command: reset_consumable
params: side_brush_work_time
vacuum_reset_filter:
alias: "Reset Filtro"
sequence:
- service: vacuum.send_command
data_template:
entity_id: >
{{states('input_text.vacuum')}}
command: reset_consumable
params: filter_work_time
vacuum_reset_sensor:
alias: "Reset Sensori"
sequence:
- service: vacuum.send_command
data_template:
entity_id: >
{{states('input_text.vacuum')}}
command: reset_consumable
params: sensor_dirty_time
*entity_id :vacuum.xiaomi_vacuum_cleaner (your entity_id)
** For DND and ZONE the template does not work. But with a few lines in python_script it is possible.
For example vacuum_dnd.py
start = (hass.states.get('input_datetime.dnd_start').state).split(":")
end = (hass.states.get('input_datetime.dnd_end').state).split(":")
startH = int(start[0])
startM = int(start[1])
endH = int(end[0])
endM = int(end[1])
dnd = ([startH,startM,endH,endM])
hass.services.call('vacuum', 'send_command', {'entity_id': 'vacuum.xxxx', 'command': 'set_dnd_timer', 'params': dnd})
I’m not a programmer, but I’d say it works.
I take the coordinates from the FloleVac app and paste them directly into an input_text.
script:
vacuum_clean_zone_test:
alias: "Pulizia a Zone Test"
sequence:
- service: python_script.vacuum_zones_template
data_template:
entity_id: >
{{states('input_text.vacuum')}}
repeats: >
{{states('input_number.vacuum_passes')|int}}
zone: >
{{ states('input_text.vacuum_zone_1') }}
python_script.vacuum_zones_template
def convert(zones):
for i in range(0, len(zones)):
zones[i] = int(zones[i])
def split_into_sublists(list_, size):
return [list_[x:x+size] for x in range(0, len(list_), size)]
entity_id = data.get('entity_id')
## OR ## entity_id = hass.states.entity_ids('vacuum')[0] #
if not entity_id:
logger.error('Error entity_id')
repeats = data.get('repeats')
zone = data.get('zone').replace(',1','').replace('[','').replace(']','').split(',')
zones = []
hass.services.call('vacuum', 'pause', {'entity_id': entity_id})
(convert(zone))
zones.extend(split_into_sublists(zone, 4))
hass.services.call('vacuum', 'xiaomi_clean_zone', {'entity_id': entity_id, 'repeats': repeats, 'zone': zone
I prefer to clean every area (max 5 zones x area) and start again.
In this way I always know where and what the vacuum does.
Here is my example … please do not laugh: 0)
vacuum_zones.py
def convert(zones):
for i in range(0, len(zones)):
zones[i] = int(zones[i])
def split_into_sublists(list_, size):
return [list_[x:x+size] for x in range(0, len(list_), size)]
vacuum = hass.states.entity_ids('vacuum')[0] ##(hass.states.get('input_text.vacuum').state)
if not vacuum:
logger.error('error vacuum not found')
repeats = (hass.states.get('input_number.vacuum_passes').state).split(".")[0]
zones_on = []
name_zones_on = []
zones = []
my_dict = {}
area = []
hass.services.call('vacuum', 'pause', {'entity_id': vacuum})
for entity_id in hass.states.entity_ids('input_boolean'):
state = hass.states.get(entity_id)
if state.entity_id.startswith("input_boolean.vacuum_zone_") and state.state == "on" and len(zones) < 5:
zones_on.append(state.entity_id)
xy = (hass.states.get('input_text.'+str(state.object_id)).state).replace(',1','').replace('[','').replace(']','').split(',')
(convert(xy))
zones.extend(split_into_sublists(xy, 4))
name_zones_on.append(state.name)
my_dict[(state.name)] = (split_into_sublists(xy, 4)) #my_dict = dict(zip(name_zones_on, zones))
area = [ v for v in my_dict.values() ]
if len(name_zones_on) != 0:
hass.services.call('input_select', 'set_options', {'entity_id': 'input_select.vacuum_zones', 'options': name_zones_on})
hass.services.call('input_boolean', 'turn_off', {'entity_id': zones_on[0]})
hass.services.call('vacuum', 'xiaomi_clean_zone', {'entity_id': vacuum, 'repeats': repeats, 'zone': area[0]})
else:
hass.services.call('input_select', 'set_options', {'entity_id': 'input_select.vacuum_zones', 'options': 'none'})
hass.services.call('vacuum', 'return_to_base', {'entity_id': vacuum})
When the state of the vacuum changes from Zoned cleaning or the state changes to Returning home, I call the script again until everything is finished
- condition: template
value_template: >
{{states('input_select.vacuum_zones') != 'none' }}
- service: python_script.vacuum_zones
I hope it’s useful and that someone makes the code better than this: 0)
I just see this after adding your card through HACS and added the path/module to the lovelace configuration file.
Are you sure that path used in resources is correct? Does the map image exist?
You have to provide a map image, card will not run without it. Can you check if you have any errors in browser console?
How do you extract the image from Flolevac the easiest way?