Xiaomi Vacuum cleaner Card


#105

Here is a node red equivalent of gurbina83’s awesome inputs/automations and scripts. Ive still kept the inputs as I like to see them on homekit. If anyone is interested ill paste over the node red export


#107

This is my NodeRed automaton for the multiple zoned cleanup.


#108

please share the flow… :slight_smile:


#109

Please share the flow :slight_smile:


#110

This is my Node RED code.
The delay time depends on your system . I mean there is a lead time between the real time action and the apperance of this action in the system. For example if the vacuum state changes to idle then this state changes in 10-12 seconds later in my system.
It would be more elegant solution the continuous multiple zone cleaning but unfortunately I can’t find any solution for it so far.

[{"id":"78e9d3a9.0ae53c","type":"server-state-changed","z":"726e5921.d034a8","name":"start","server":"820ae6a6.7f40a8","entityidfilter":"input_boolean.zone_cleaning","entityidfiltertype":"substring","outputinitially":true,"state_type":"str","haltifstate":"","halt_if_type":"","halt_if_compare":"is","outputs":1,"output_only_on_state_change":false,"x":70,"y":240,"wires":[["357dc6d4.090b6a"]]},{"id":"357dc6d4.090b6a","type":"switch","z":"726e5921.d034a8","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":230,"y":240,"wires":[["ebe7074c.fa82d8","abaa0754.e498c8","84ec31fe.1f509","74f63762.fb48a8","6129fa6f.15add4","f2f6b719.dd3e68","5f304930.015008"]]},{"id":"ebe7074c.fa82d8","type":"api-current-state","z":"726e5921.d034a8","name":"living room on?","server":"820ae6a6.7f40a8","outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","override_topic":true,"entity_id":"input_boolean.living_room_cleaning","state_type":"str","override_payload":true,"override_data":true,"x":560,"y":60,"wires":[["e4ef4475.06e5e8"],[]]},{"id":"e4ef4475.06e5e8","type":"api-call-service","z":"726e5921.d034a8","name":"living room cleaning","server":"820ae6a6.7f40a8","service_domain":"vacuum","service":"send_command","data":"{\"entity_id\":\"vacuum.xiaomi_vacuum_cleaner\",\"command\":\"app_zoned_clean\",\"params\":[[21575,24539,26125,29889,1],[25331,24711,28131,28561,1],[20190,23707,26040,24707,1]]}","render_data":true,"mergecontext":"","output_location":"payload","output_location_type":"msg","x":780,"y":60,"wires":[[]]},{"id":"9e091322.64a63","type":"api-call-service","z":"726e5921.d034a8","name":"bedroom off","server":"820ae6a6.7f40a8","service_domain":"input_boolean","service":"turn_off","data":"{\"entity_id\":\"input_boolean.bedroom_cleaning\"}","render_data":false,"mergecontext":"","output_location":"payload","output_location_type":"msg","x":790,"y":500,"wires":[[]]},{"id":"9feb35ca.7ad458","type":"api-call-service","z":"726e5921.d034a8","name":"bedroom cleaning","server":"820ae6a6.7f40a8","service_domain":"vacuum","service":"send_command","data":"{\"entity_id\":\"vacuum.xiaomi_vacuum_cleaner\",\"command\":\"app_zoned_clean\",\"params\":[[18720,19114,21770,23514,1]]}","render_data":false,"mergecontext":"","output_location":"payload","output_location_type":"msg","x":770,"y":120,"wires":[["566f36a2.63abb8"]]},{"id":"abaa0754.e498c8","type":"api-current-state","z":"726e5921.d034a8","name":"bedroom on?","server":"820ae6a6.7f40a8","outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","override_topic":true,"entity_id":"input_boolean.bedroom_cleaning","state_type":"str","override_payload":true,"override_data":true,"x":550,"y":120,"wires":[["9feb35ca.7ad458"],[]]},{"id":"c4e673e1.89d07","type":"trigger-state","z":"726e5921.d034a8","name":"paused?","server":"820ae6a6.7f40a8","entityid":"vacuum.xiaomi_vacuum_cleaner","entityidfiltertype":"exact","debugenabled":false,"constraints":[{"id":"pq55xe30min","targetType":"this_entity","targetValue":"","propertyType":"current_state","propertyValue":"new_state.state","comparatorType":"is","comparatorValueDatatype":"str","comparatorValue":"paused"}],"constraintsmustmatch":"all","outputs":2,"customoutputs":[],"outputinitially":false,"state_type":"str","x":80,"y":120,"wires":[["97097ff0.f3702"],[]]},{"id":"97097ff0.f3702","type":"change","z":"726e5921.d034a8","name":"send on","rules":[{"t":"set","p":"payload","pt":"msg","to":"on","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":240,"y":120,"wires":[["357dc6d4.090b6a"]]},{"id":"ec589d7f.8318d","type":"api-call-service","z":"726e5921.d034a8","name":"girls room cleaning","server":"820ae6a6.7f40a8","service_domain":"vacuum","service":"send_command","data":"{\"entity_id\":\"vacuum.xiaomi_vacuum_cleaner\",\"command\":\"app_zoned_clean\",\"params\":[[25014,19161,28214,23761,1]]}","render_data":false,"mergecontext":"","output_location":"payload","output_location_type":"msg","x":770,"y":180,"wires":[["566f36a2.63abb8"]]},{"id":"96668fda.d83af","type":"api-call-service","z":"726e5921.d034a8","name":"girls room off","server":"820ae6a6.7f40a8","service_domain":"input_boolean","service":"turn_off","data":"{\"entity_id\":\"input_boolean.girls_room_cleaning\"}","render_data":false,"mergecontext":"","output_location":"payload","output_location_type":"msg","x":790,"y":560,"wires":[[]]},{"id":"84ec31fe.1f509","type":"api-current-state","z":"726e5921.d034a8","name":"girls room on?","server":"820ae6a6.7f40a8","outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","override_topic":true,"entity_id":"input_boolean.girls_room_cleaning","state_type":"str","override_payload":true,"override_data":true,"x":560,"y":180,"wires":[["ec589d7f.8318d"],[]]},{"id":"8bef2f33.3f41b","type":"api-current-state","z":"726e5921.d034a8","name":"living room off?","server":"820ae6a6.7f40a8","outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":true,"entity_id":"input_boolean.living_room_cleaning","state_type":"str","override_payload":true,"override_data":true,"x":560,"y":500,"wires":[["9e091322.64a63","c088e19f.5769"],[]]},{"id":"c088e19f.5769","type":"api-current-state","z":"726e5921.d034a8","name":"bedroom off?","server":"820ae6a6.7f40a8","outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":true,"entity_id":"input_boolean.bedroom_cleaning","state_type":"str","override_payload":true,"override_data":true,"x":550,"y":560,"wires":[["96668fda.d83af","45c99c1e.1724c4"],[]]},{"id":"45c99c1e.1724c4","type":"api-current-state","z":"726e5921.d034a8","name":"girls room off?","server":"820ae6a6.7f40a8","outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":true,"entity_id":"input_boolean.girls_room_cleaning","state_type":"str","override_payload":true,"override_data":true,"x":560,"y":620,"wires":[["5b98fa32.f77764","6257ae9b.10912"],[]]},{"id":"49b78f9a.a3a9c","type":"api-call-service","z":"726e5921.d034a8","name":"zone off","server":"820ae6a6.7f40a8","service_domain":"input_boolean","service":"turn_off","data":"{\"entity_id\":\"input_boolean.zone_cleaning\"}","render_data":false,"mergecontext":"","output_location":"payload","output_location_type":"msg","x":780,"y":800,"wires":[[]]},{"id":"36476426.035acc","type":"api-call-service","z":"726e5921.d034a8","name":"middle room cleaning","server":"820ae6a6.7f40a8","service_domain":"vacuum","service":"send_command","data":"{\"entity_id\":\"vacuum.xiaomi_vacuum_cleaner\",\"command\":\"app_zoned_clean\",\"params\":[[21848,19087,24798,23587,1]]}","render_data":false,"mergecontext":"","output_location":"payload","output_location_type":"msg","x":780,"y":240,"wires":[["566f36a2.63abb8"]]},{"id":"74f63762.fb48a8","type":"api-current-state","z":"726e5921.d034a8","name":"middle room on?","server":"820ae6a6.7f40a8","outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","override_topic":true,"entity_id":"input_boolean.middle_room_cleaning","state_type":"str","override_payload":true,"override_data":true,"x":570,"y":240,"wires":[["36476426.035acc"],[]]},{"id":"5b98fa32.f77764","type":"api-call-service","z":"726e5921.d034a8","name":"middle room off","server":"820ae6a6.7f40a8","service_domain":"input_boolean","service":"turn_off","data":"{\"entity_id\":\"input_boolean.middle_room_cleaning\"}","render_data":false,"mergecontext":"","output_location":"payload","output_location_type":"msg","x":800,"y":620,"wires":[[]]},{"id":"6257ae9b.10912","type":"api-current-state","z":"726e5921.d034a8","name":"middle room on?","server":"820ae6a6.7f40a8","outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":true,"entity_id":"input_boolean.middle_room_cleaning","state_type":"str","override_payload":true,"override_data":true,"x":570,"y":680,"wires":[["24c7fae4.31b476","5bfc543c.c8f03c"],[]]},{"id":"3445141b.e0737c","type":"api-call-service","z":"726e5921.d034a8","name":"bathroom cleaning","server":"820ae6a6.7f40a8","service_domain":"vacuum","service":"send_command","data":"{\"entity_id\":\"vacuum.xiaomi_vacuum_cleaner\",\"command\":\"app_zoned_clean\",\"params\":[[18784,24774,21534,28074,1]]}","render_data":false,"mergecontext":"","output_location":"payload","output_location_type":"msg","x":770,"y":300,"wires":[["566f36a2.63abb8"]]},{"id":"6129fa6f.15add4","type":"api-current-state","z":"726e5921.d034a8","name":"bathroom on?","server":"820ae6a6.7f40a8","outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","override_topic":true,"entity_id":"input_boolean.bathroom_cleaning","state_type":"str","override_payload":true,"override_data":true,"x":560,"y":300,"wires":[["3445141b.e0737c"],[]]},{"id":"24c7fae4.31b476","type":"api-call-service","z":"726e5921.d034a8","name":"bathroom off","server":"820ae6a6.7f40a8","service_domain":"input_boolean","service":"turn_off","data":"{\"entity_id\":\"input_boolean.bathroom_cleaning\"}","render_data":false,"mergecontext":"","output_location":"payload","output_location_type":"msg","x":790,"y":680,"wires":[[]]},{"id":"5bfc543c.c8f03c","type":"api-current-state","z":"726e5921.d034a8","name":"bathroom off?","server":"820ae6a6.7f40a8","outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":true,"entity_id":"input_boolean.bathroom_cleaning","state_type":"str","override_payload":true,"override_data":true,"x":560,"y":740,"wires":[["fff0e48e.dd20f8","4a68873b.aed1b8"],[]]},{"id":"25e2c6b6.8cccfa","type":"api-call-service","z":"726e5921.d034a8","name":"entrance cleaning","server":"820ae6a6.7f40a8","service_domain":"vacuum","service":"send_command","data":"{\"entity_id\":\"vacuum.xiaomi_vacuum_cleaner\",\"command\":\"app_zoned_clean\",\"params\":[[26041,23630,28341,24880,1]]}","render_data":false,"mergecontext":"","output_location":"payload","output_location_type":"msg","x":770,"y":360,"wires":[["566f36a2.63abb8"]]},{"id":"f2f6b719.dd3e68","type":"api-current-state","z":"726e5921.d034a8","name":"entrance on?","server":"820ae6a6.7f40a8","outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","override_topic":true,"entity_id":"input_boolean.entrance_cleaning","state_type":"str","override_payload":true,"override_data":true,"x":550,"y":360,"wires":[["25e2c6b6.8cccfa"],[]]},{"id":"4a68873b.aed1b8","type":"api-current-state","z":"726e5921.d034a8","name":"entrance off?","server":"820ae6a6.7f40a8","outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":true,"entity_id":"input_boolean.entrance_cleaning","state_type":"str","override_payload":true,"override_data":true,"x":550,"y":800,"wires":[["49b78f9a.a3a9c","57736bfd.7e30e4"],[]]},{"id":"fff0e48e.dd20f8","type":"api-call-service","z":"726e5921.d034a8","name":"entrance off off","server":"820ae6a6.7f40a8","service_domain":"input_boolean","service":"turn_off","data":"{\"entity_id\":\"input_boolean.entrance_cleaning\"}","render_data":false,"mergecontext":"","output_location":"payload","output_location_type":"msg","x":800,"y":740,"wires":[[]]},{"id":"566f36a2.63abb8","type":"trigger-state","z":"726e5921.d034a8","name":"cleaning?","server":"820ae6a6.7f40a8","entityid":"vacuum.xiaomi_vacuum_cleaner","entityidfiltertype":"exact","debugenabled":false,"constraints":[{"id":"3p107e8yejh","targetType":"this_entity","targetValue":"","propertyType":"current_state","propertyValue":"new_state.state","comparatorType":"is","comparatorValueDatatype":"str","comparatorValue":"returning"},{"id":"vk9pzh79rgp","targetType":"entity_id","targetValue":"input_boolean.zone_cleaning","propertyType":"current_state","propertyValue":"new_state.state","comparatorType":"is","comparatorValueDatatype":"str","comparatorValue":"on"}],"constraintsmustmatch":"all","outputs":2,"customoutputs":[],"outputinitially":true,"state_type":"str","x":1050,"y":236.66665649414062,"wires":[["6ff84c1b.f574b4"],[]]},{"id":"6ff84c1b.f574b4","type":"api-call-service","z":"726e5921.d034a8","name":"roberta stop","server":"820ae6a6.7f40a8","service_domain":"vacuum","service":"send_command","data":"{\"entity_id\":\"vacuum.xiaomi_vacuum_cleaner\",\"command\":\"app_pause\"}","render_data":true,"mergecontext":"","output_location":"payload","output_location_type":"msg","x":1250,"y":240,"wires":[[]]},{"id":"3741d9ef.2e5426","type":"api-call-service","z":"726e5921.d034a8","name":"Return to base","server":"820ae6a6.7f40a8","service_domain":"vacuum","service":"return_to_base","data":"{\"entity_id\":\"vacuum.xiaomi_vacuum_cleaner\"}","render_data":false,"mergecontext":"","output_location":"payload","output_location_type":"msg","x":800,"y":860,"wires":[[]]},{"id":"57736bfd.7e30e4","type":"api-current-state","z":"726e5921.d034a8","name":"zone off?","server":"820ae6a6.7f40a8","outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":true,"entity_id":"input_boolean.entrance_cleaning","state_type":"str","override_payload":true,"override_data":true,"x":540,"y":860,"wires":[["3741d9ef.2e5426"],[]]},{"id":"5f304930.015008","type":"stoptimer","z":"726e5921.d034a8","duration":"15","units":"Second","payloadtype":"num","payloadval":"0","name":"","x":350,"y":440,"wires":[["299051d4.c4b58e"],[]]},{"id":"6f72eea4.dc4cb","type":"api-call-service","z":"726e5921.d034a8","name":"living room off","server":"820ae6a6.7f40a8","service_domain":"input_boolean","service":"turn_off","data":"{\"entity_id\":\"input_boolean.living_room_cleaning\"}","render_data":false,"mergecontext":"","output_location":"payload","output_location_type":"msg","x":800,"y":440,"wires":[[]]},{"id":"299051d4.c4b58e","type":"api-current-state","z":"726e5921.d034a8","name":"living room off?","server":"820ae6a6.7f40a8","outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":true,"entity_id":"input_boolean.living_room_cleaning","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":560,"y":440,"wires":[["8bef2f33.3f41b","6f72eea4.dc4cb"]]},{"id":"820ae6a6.7f40a8","type":"server","z":"","name":"Home Assistant","legacy":false,"hassio":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open"}]

#111

Hi guys! Anyone facing issues with input_select not working anymore with new HA 0.88.1 version? Been working flawlessly on 0.87.0 Doesn’t look like it’s lovelace related issue either.

Debug logs when choosing ‘bedroom’:

2019-02-22 22:41:12 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection.4583509184] Sending {‘id’: 2, ‘type’: ‘event’, ‘event’: {‘event_type’: ‘state_changed’, ‘data’: {‘entity_id’: ‘input_select.vacuum_room’, ‘old_state’: <state input_select.vacuum_room=bathroom; options=[‘Select Input’, ‘bedroom’, ‘corridor’, ‘bathroom’, ‘kitchen’, ‘living room’], friendly_name=Choose a room to clean @ 2019-02-22T22:41:02.430978+01:00>, ‘new_state’: <state input_select.vacuum_room=bedroom; options=[‘Select Input’, ‘bedroom’, ‘corridor’, ‘bathroom’, ‘kitchen’, ‘living room’], friendly_name=Choose a room to clean @ 2019-02-22T22:41:12.761270+01:00>}, ‘origin’: ‘LOCAL’, ‘time_fired’: datetime.datetime(2019, 2, 22, 21, 41, 12, 761291, tzinfo=), ‘context’: {‘id’: ‘redacted’, ‘user_id’: ‘redacted’}}}

EDIT: tried to figure out what was the problem, but no luck. Deleted .storage and ha db, the issue has gone.


#112

After lengthy period of procrastination I have finally set up intentionally simplified Lovelace card (similar to yours) to see vacuum summary including map and rarely trigger some actions. Usually vacuum automations take care of everything.

Excerpt from ui-lovelace.yaml:

      - type: custom:card-modder
        style:
          --paper-card-background-color: '#155c9d'
          # --paper-card-background-color: linear-gradient(rgb(54,159,242), rgb(17,105,210))
          --primary-text-color: white
          font-size: 1.3rem
          font-style: bold
        card:
          type: picture-elements
          image: /local/images/transparent_background.png
          elements:
            - type: image
              entity: vacuum.servantess
              camera_image: camera.servantess_map
              style:
                top: 50%
                left: 50%
                width: 100%
            - type: icon
              icon: mdi:crosshairs-gps
              style:
                top: 90%
                left: 70%
              tap_action:
                action: call-service
                service: vacuum.locate
                service_data:
                  entity_id: vacuum.servantess
            - type: icon
              icon: mdi:home
              style:
                top: 90%
                left: 30%
              tap_action:
                action: call-service
                service: vacuum.return_to_base
                service_data:
                  entity_id: vacuum.servantess
            - type: icon
              icon: mdi:play
              style:
                top: 90%
                left: 43%
              tap_action:
                action: call-service
                service: vacuum.start
                service_data:
                  entity_id: vacuum.servantess
            - type: icon
              icon: mdi:stop
              style:
                top: 90%
                left: 57%
              tap_action:
                action: call-service
                service: vacuum.stop
                service_data:
                  entity_id: vacuum.servantess
            - type: state-label
              entity: sensor.servantess_state_label
              style:
                bottom: 12%
                left: 1%
                color: rgb(255, 255, 255)
                transform: translate(0%,-50%)
                pointer-events: none
                text-shadow: 1px 1px black
                font-family: Trebuchet MS
                font-size: 90%
                font-weight: bold
                opacity: 0.8
            - type: state-label
              entity: sensor.servantess_cleanup_count_label
              style:
                bottom: 12%
                right: 1%
                color: rgb(255, 255, 255)
                transform: translate(0%,-50%)
                pointer-events: none
                text-shadow: 1px 1px black
                font-family: Trebuchet MS
                font-size: 90%
                font-weight: bold
                opacity: 0.8

Huge thanks to @Kejszijo for sharing his implementation details back then. Mine is largely built on his example.


#113

would appreciate a lot if you could share :slight_smile:


#114

Hello, guys…

Sorry for that question… i read, this card is working with S50, but is it working with “Xiaomi mi robot” ?

Thanks :slight_smile:


#115

There is no single card in this thead but rather several similar implementations but all should work with 1st generation vaccuum. I have it and it works fine.


#116

Thank you all. Because of what you shared here, I have my vacuum up and running in Hassio.

Does anyone know if an attribute can be created to detect if the dustbin is removed. The vacuum knows when it has been removed and when it has been put back in.

I am building a node red flow that reminds me to clean the dustbin after each use. If the attribute could be created, it would clear the alert/reminder once the dustbin has been put back in the vacuum.

BTW after spending hours getting my token, via the apple backup log method, I found it in clear text in my android app, which is the latest version. To get to the token, I opened the vacuum, clicked the the three dots in the upper right corner, selected general settings, , network info. The last line is Token.

Thanks again for all the great examples and advice