[xiaomi/roborock/valetudo] Zone/room based vacuum cleaning with node red, triggered by NFC tags with room cleaning chains and notifications about "full dust bin"

Hey guys,

since it took me a while to get the vacuum automation to fit my personal needs, I thought I share my setup with you guys. Maybe somebody can get inspiration from it. I’m using xiaomi/roborock vacuums (Gen1 and two S50), all of them running custom firmware valetudo from rand256 (fork of original valetudo). This fork has an option to reload a saved map once the vacuum returns to the dock, which I personally need. Also, the node red automations that I’m using are utilising the API from that fork (not sure if the valetudo version from hypfer is the same). I’m not going to cover the installation of valetudo in this guide, but if you have questions, just let me know.

Requirements:

  • clean rooms and zones individually, not just a complete clean
  • chain room vacuuming. Start the cleaning in room a and while the robot is still active, add another room to be cleaned. Make it configurable, not just by creating static automations with fixed room/zones combinations.
  • inform me when the dust bin is (most lilkely) full when I’m starting a new cleaning run, wait until it’s empty, then start the run
  • start the cleaning from the individual room by scanning NFC (you could also use zigbee/zwave buttons or something else as a trigger of course)
  • start the cleaning from lovelace as well, using the same logic.
  • create the automation in node red.

high level description

So, here is how I achieved that in plain english.

home assistant

  • create an input_select that holds the names of the rooms and zones that should be cleaned, plus one entry when the vacuum is docked
  • place cheap nfc tags in the rooms where you want the vacuum to clean and add them in the home assistant app (should be straight forward, just note down the ncf tag ids for each room)
  • create an input_number entry for the qm² the robot has cleaned
  • create lovelace card to change input_select (use whatever card type you like)

node red
plugins needed:

Flow overview

  1. listen to all events, filter out payload.event.tag_id messages that contain the specific nfc tag for your room and then set the input_select entity to that room name
  2. event_state node that listens to all state changes for said input_select entry and add it to the cleaning queue. The queue will hold all items send to it, until the queue is triggered, releasing the oldest item that was sent to the queue.
  • check input_number for qm² cleaned, whether it is greater than x qm² (I’m using 50 here).
    If true: send the robot to the spot next to your garbage bin, wait until it is idle again, play the integrated sound file for “please empty the vacuum bin”, wait until bin is in the vacuum again, then trigger the cleaning queue to release the queue and reset the input_number form qm² cleaned to 0 since the vacuum bin was emptied.
    If not true: trigger the cleaning queue to release the queue immediately.

  • once the queued item is released, check the state of input_select that was send by the queue and start the appropriate cleaning for that room.

  • scanning of further rooms/zones (nfc tags) will repeat the process, but any additional change of the input_select will be queued until specifically released.

  1. entity node which will trigger once the vacuum has a state of returning, meaning, it finished the cleaning of a room/zone and returns to the dock. This will send a trigger message to the queue to release the next item. If the queue is empty, nothing happens, if there is a “room” in the queue, the flow will go again through the switch and start the appropriate room/zone cleaning

  2. entity node which will trigger once the vacuum has docked again

  • set the input_select to state docked. This is just in case the first room cleaning after docking is the same as the last one before docking. If you’re not doing that, there is no state change to trigger the cleaning
  • reset the queue, just in case
  • use a function node to get the state from input_number, get the last cleaning_are attribute from the vacuum, add these two together and update the input_number accordingly.

So, in essence you need two helper, one input_select with all your rooms/zone as options, plus docked and one input_numer with steps as 0.01 and max value of 1000. Furthermore, I’m adding my node red flow here and some shiny pictures

Two things I should mention:

  • state changes from the vacuum take a couple of seconds. If the vacuum has finished one room, it takes 2 -3 seconds until node red get’s notified of the state change to return and can start the next room
  • the attribute change for “vacuum bin was put in again” takes roughly 20 - 30 seconds, so be patient.

[{"id":"cd7e28a7.95fde8","type":"server-events","z":"37a3306b.57211","name":"","server":"c52db6a3.01673","event_type":"","exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"waitForRunning":true,"x":240,"y":320,"wires":[["4b8446ca.71705","dafa6280.66171"]]},{"id":"4b8446ca.71705","type":"switch","z":"37a3306b.57211","name":"Filter NFC tag living_room","property":"payload.event.tag_id","propertyType":"msg","rules":[{"t":"cont","v":"1234-abcd","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":550,"y":300,"wires":[["2e7dbd42.00dc02"]]},{"id":"dafa6280.66171","type":"switch","z":"37a3306b.57211","name":"Filter NFC tag kitchen","property":"payload.event.tag_id","propertyType":"msg","rules":[{"t":"cont","v":"4321-dcba","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":480,"y":360,"wires":[["7f61d2f9.ab1c54"]]},{"id":"2e7dbd42.00dc02","type":"api-call-service","z":"37a3306b.57211","name":"Vacuum ground floor set Zone living room","server":"c52db6a3.01673","version":1,"debugenabled":false,"service_domain":"input_select","service":"select_option","entityId":"input_select.vacuum_groundfloor","data":"{\"option\":\"livingroom\"}","dataType":"jsonata","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":880,"y":300,"wires":[[]]},{"id":"7f61d2f9.ab1c54","type":"api-call-service","z":"37a3306b.57211","name":"Vacuum ground floor set Zone living room","server":"c52db6a3.01673","version":1,"debugenabled":false,"service_domain":"input_select","service":"select_option","entityId":"input_select.vacuum_groundfloor","data":"{\"option\":\"kitchen\"}","dataType":"jsonata","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":880,"y":360,"wires":[[]]},{"id":"38f0f81.521b988","type":"server-state-changed","z":"37a3306b.57211","name":"vacuum ground floor zone set","server":"c52db6a3.01673","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_select.vacuum_groundfloor","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"docked","halt_if_type":"str","halt_if_compare":"is_not","outputs":2,"output_only_on_state_change":true,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"x":160,"y":640,"wires":[["ea89c776.2de53","6f7e282e.065d9"],[]]},{"id":"6f7e282e.065d9","type":"simple-queue","z":"37a3306b.57211","name":"","firstMessageBypass":false,"bypassInterval":"0","x":790,"y":720,"wires":[["6378c458.c7c86c"]]},{"id":"ae9b1943.a8de5","type":"change","z":"37a3306b.57211","name":"trigger next run","rules":[{"t":"set","p":"trigger","pt":"msg","to":"1","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":540,"y":720,"wires":[["6f7e282e.065d9"]]},{"id":"65735916.9d1cc","type":"change","z":"37a3306b.57211","name":"Reset queue","rules":[{"t":"set","p":"reset","pt":"msg","to":"1","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":530,"y":820,"wires":[["6f7e282e.065d9"]]},{"id":"d6f288ee.ea51f","type":"server-state-changed","z":"37a3306b.57211","name":"vacuum groundfloor has docked","server":"c52db6a3.01673","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"vacuum.groundfloor","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"docked","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":true,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"x":170,"y":820,"wires":[["65735916.9d1cc","9b36e0f7.11dce8","b283e3fb.a8d6c8"],[]]},{"id":"fc036ba3.7e60e","type":"server-state-changed","z":"37a3306b.57211","name":"vacuum ground floor returning > trigger","server":"c52db6a3.01673","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"vacuum.groundfloor","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"returning","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":true,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"x":190,"y":720,"wires":[["ae9b1943.a8de5"],[]]},{"id":"9b36e0f7.11dce8","type":"api-call-service","z":"37a3306b.57211","name":"vacuum groundfloor set docked","server":"c52db6a3.01673","version":1,"debugenabled":false,"service_domain":"input_select","service":"select_option","entityId":"input_select.staubsauger_groundfloor","data":"{\"option\":\"docked\"}","dataType":"jsonata","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":590,"y":880,"wires":[[]]},{"id":"73323de8.32e224","type":"comment","z":"37a3306b.57211","name":"Vacuum Zone Queue ground floor","info":"nfc tag sets zone to living room\nwhen zone is not docked, check against qm cleaned\nif > x qm, then play sound, wait until bin was put in again, trigger next run\nif < X trigger next run\nwhen returning, trigger next run (not needed, only one zone)\nwhen docked, reset queue, set zone to docked (so next nfc scan triggers a state change), add last clean area to Living room qm cleaned","x":240,"y":540,"wires":[]},{"id":"643c932a.34a9a4","type":"api-call-service","z":"37a3306b.57211","name":"vacuum groundfloor [play sound empty bin]","server":"c52db6a3.01673","version":1,"debugenabled":true,"service_domain":"vacuum","service":"send_command","entityId":"vacuum.groundfloor","data":"\t{\t   \"command\":\"play_sound\",\t   \"entity_id\": \"vacuum.groundfloor\",\t   \"params\": {\t     \"file\": \"/mnt/data/rockrobo/sounds/clean_bin.wav\"\t       }\t     \t}\t","dataType":"jsonata","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1270,"y":500,"wires":[[]]},{"id":"43f0c79c.dba668","type":"ha-wait-until","z":"37a3306b.57211","name":"wait until last_bin_out changed","server":"c52db6a3.01673","outputs":2,"entityId":"vacuum.groundfloor","entityIdFilterType":"exact","property":"attributes.last_bin_out","comparator":"is_not","value":"last_bin_out","valueType":"msg","timeout":"45","timeoutType":"num","timeoutUnits":"minutes","entityLocation":"","entityLocationType":"none","checkCurrentState":true,"blockInputOverrides":true,"x":1370,"y":620,"wires":[["1208470d.652581","ae9b1943.a8de5"],[]]},{"id":"53c99e3c.4d9c98","type":"change","z":"37a3306b.57211","name":"mv last_bin_out ","rules":[{"t":"move","p":"data.attributes.last_bin_out","pt":"msg","to":"last_bin_out","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1100,"y":620,"wires":[["43f0c79c.dba668"]]},{"id":"ea89c776.2de53","type":"api-current-state","z":"37a3306b.57211","name":"qm cleaned ground floor > 50","server":"c52db6a3.01673","version":1,"outputs":2,"halt_if":"50","halt_if_type":"num","halt_if_compare":"gt","override_topic":true,"entity_id":"input_number.staubsauger_erdgeschoss_qm_cleaned","state_type":"num","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":440,"y":580,"wires":[["b2e9f1a3.a02b98","79411390.4b3ebc"],["ae9b1943.a8de5"]]},{"id":"b2e9f1a3.a02b98","type":"api-current-state","z":"37a3306b.57211","name":"get state from vacuum groundfloor","server":"c52db6a3.01673","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"vacuum.groundfloor","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":820,"y":620,"wires":[["53c99e3c.4d9c98"]]},{"id":"b283e3fb.a8d6c8","type":"function","z":"37a3306b.57211","name":"add last clean area to groundfloor qm²","func":"const globalHomeAssistant = global.get('homeassistant');\nvar area_old_str = globalHomeAssistant.homeAssistant.states[\"input_number.staubsauger_groundfloor_qm_cleaned\"].state;\nvar area_cur_str = msg.data.new_state.attributes.currentCleanArea;\nvar area_cur = Number(area_cur_str);\nvar area_old = Number(area_old_str);\nvar area_new = area_old + area_cur;\nmsg.payload = {};\nmsg.payload = area_new;\nreturn msg;\n\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":610,"y":960,"wires":[["16915af9.dcac9d"]]},{"id":"16915af9.dcac9d","type":"api-call-service","z":"37a3306b.57211","name":"set value for groundfloor eg qm cleaned","server":"c52db6a3.01673","version":1,"debugenabled":true,"service_domain":"input_number","service":"set_value","entityId":"input_number.staubsauger_groundfloor_qm_cleaned","data":"{\"value\": payload }\t","dataType":"jsonata","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":980,"y":960,"wires":[[]]},{"id":"6378c458.c7c86c","type":"switch","z":"37a3306b.57211","name":"room switch","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"livingroom","vt":"str"},{"t":"eq","v":"kitchen","vt":"str"},{"t":"eq","v":"docked","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":1050,"y":760,"wires":[["c6f6550e.6f6708"],["84a1d4ca.d20f08"],[]]},{"id":"c6f6550e.6f6708","type":"api-call-service","z":"37a3306b.57211","name":"Staubsauger groundfloor [living room]","server":"c52db6a3.01673","version":1,"debugenabled":true,"service_domain":"vacuum","service":"send_command","entityId":"vacuum.groundfloor","data":"\t{\t   \"command\":\"segmented_cleanup\",\t   \"entity_id\": \"vacuum.groundfloor\",\t   \"params\": {\t     \"segment_ids\": [\t     \"livingroom\"\t     ]  }\t     \t}\t","dataType":"jsonata","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1350,"y":680,"wires":[[]]},{"id":"84a1d4ca.d20f08","type":"api-call-service","z":"37a3306b.57211","name":"Staubsauger groundfloor [kitchen]","server":"c52db6a3.01673","version":1,"debugenabled":true,"service_domain":"vacuum","service":"send_command","entityId":"vacuum.groundfloor","data":"\t{\t   \"command\":\"segmented_cleanup\",\t   \"entity_id\": \"vacuum.groundfloor\",\t   \"params\": {\t     \"segment_ids\": [\t     \"kitchen\"\t     ]  }\t     \t}\t","dataType":"jsonata","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1340,"y":740,"wires":[[]]},{"id":"79411390.4b3ebc","type":"api-call-service","z":"37a3306b.57211","name":"vacuum ground floor empty spot","server":"c52db6a3.01673","version":1,"debugenabled":true,"service_domain":"vacuum","service":"send_command","entityId":"vacuum.groundfloor","data":"{\t   \"command\":\"go_to\",\t   \"entity_id\": \"vacuum.groundfloor\",\t   \"params\": {\t     \"spot_id\": \"empty_spot\"\t       }\t     \t}\t","dataType":"jsonata","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":710,"y":540,"wires":[["82ca6d02.eea118"]]},{"id":"82ca6d02.eea118","type":"ha-wait-until","z":"37a3306b.57211","name":"wait until idle","server":"c52db6a3.01673","outputs":2,"entityId":"vacuum.groundfloor","entityIdFilterType":"exact","property":"state","comparator":"is","value":"idle","valueType":"str","timeout":"45","timeoutType":"num","timeoutUnits":"minutes","entityLocation":"","entityLocationType":"none","checkCurrentState":true,"blockInputOverrides":true,"x":990,"y":500,"wires":[["643c932a.34a9a4"],[]]},{"id":"c52db6a3.01673","type":"server","name":"Home Assistant","legacy":false,"addon":false,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]

If you have any questions, just let me know.

4 Likes

This is something I was looking to do it myself. I will take a longer look once I have valetuded my S6.

Thanks for your inspiration

1 Like

Hey

your flow was inspiring me for my own, thx a lot.
I owned gen1, hacked it with Valetudo, so i don’t have a dust bin, cant use NFC.
My Valetudo does not show cleaned area, but i still have the xiaomi Vacuum connected.
So i got this part working

My Vacuum has to go a special path to clean the Bathroom. Here is my flow:

[{"id":"ae96e6c9.70b398","type":"api-call-service","z":"a903bc6a.6292","name":"Brücke 1","server":"44f8d614.877708","version":1,"debugenabled":false,"service_domain":"vacuum","service":"send_command","entityId":"vacuum.robot","data":"{\"command\":\"go_to\",\"params\":{\"spot_id\":\"026a2565-a689-4b17-8a22-aa13d435fdc4\"}}","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":340,"y":960,"wires":[["e77b45c3.c511b8"]]},{"id":"5cd3fa35.7aca54","type":"api-call-service","z":"a903bc6a.6292","name":"Brücke 2","server":"44f8d614.877708","version":1,"debugenabled":false,"service_domain":"vacuum","service":"send_command","entityId":"vacuum.robot","data":"{\"command\":\"go_to\",\"params\":{\"spot_id\":\"508e5c2a-3812-4c10-86d1-83fd57113374\"}}","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":940,"y":1040,"wires":[["d5be93fe.70f7b"]]},{"id":"b4e7e4f9.afc6c8","type":"ha-wait-until","z":"a903bc6a.6292","name":"wait until idle","server":"44f8d614.877708","outputs":2,"entityId":"vacuum.robot","entityIdFilterType":"exact","property":"state","comparator":"is","value":"idle","valueType":"str","timeout":"45","timeoutType":"num","timeoutUnits":"minutes","entityLocation":"","entityLocationType":"none","checkCurrentState":true,"blockInputOverrides":true,"x":550,"y":940,"wires":[["ad3f244d.462ef8"],[]]},{"id":"d72325d2.5b6228","type":"ha-wait-until","z":"a903bc6a.6292","name":"wait until idle","server":"44f8d614.877708","outputs":2,"entityId":"vacuum.robot","entityIdFilterType":"exact","property":"state","comparator":"is","value":"idle","valueType":"str","timeout":"45","timeoutType":"num","timeoutUnits":"minutes","entityLocation":"","entityLocationType":"none","checkCurrentState":true,"blockInputOverrides":true,"x":170,"y":1160,"wires":[["d834715a.a7917"],[]]},{"id":"e77b45c3.c511b8","type":"delay","z":"a903bc6a.6292","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":450,"y":900,"wires":[["b4e7e4f9.afc6c8"]]},{"id":"d5be93fe.70f7b","type":"delay","z":"a903bc6a.6292","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":380,"y":1100,"wires":[["d72325d2.5b6228"]]},{"id":"4e68d57b.6279dc","type":"inject","z":"a903bc6a.6292","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":940,"y":900,"wires":[["5cd3fa35.7aca54"]]},{"id":"ad3f244d.462ef8","type":"delay","z":"a903bc6a.6292","name":"","pauseType":"delay","timeout":"15","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":710,"y":1020,"wires":[["5cd3fa35.7aca54"]]},{"id":"13ab30ce.2d13af","type":"inject","z":"a903bc6a.6292","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":110,"y":940,"wires":[["ae96e6c9.70b398"]]},{"id":"44f8d614.877708","type":"server","name":"Home Assistant","legacy":false,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]

Every time in the flow the same command is fired, when i inject everything works as in the node expected. My idea was the commands are getting to fast, but even with my delays it isnt working.

Any Ideas?

Jens

Are you using valetudo or valetudo-RE? This guide and the implementation were done with valetudo-RE and I also have a gen1 device in use, so dust_bin is working on that device. This is true for the cleaned area as well. Maybe double check the device attributes under development tools. If it is not, maybe give valetudo-RE a try.

As for the flow: You only posted the flow with the inject command. What are you using as the trigger, when not using the inject node? Because the flow you posted will only run if you start the inject node manually, so it has to be related to the trigger node.

Hey

Thx for your quick answer.

Im using the non RE Version.

thats all my valetudo tells me:

fan_speed_list:
  - min
  - low
  - medium
  - high
  - max
battery_level: 100
battery_icon: 'mdi:battery-charging-100'
fan_speed: min
friendly_name: robot
supported_features: 9212

So i think i should take a look at the RE Version.

Im Using your room switch. Listening to the input select. As its easier to test the steps i disconnected and made a inject command.

This is the complete Flow, i dont find a way to get it better sorted, as the state msgs are too long :frowning:

[{"id":"a903bc6a.6292","type":"tab","label":"Saugi m2","disabled":false,"info":""},{"id":"38f0f81.521b988","type":"server-state-changed","z":"a903bc6a.6292","name":"vacuum zone set","server":"44f8d614.877708","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_select.vacuum2","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"docked","halt_if_type":"str","halt_if_compare":"is_not","outputs":2,"output_only_on_state_change":true,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"x":100,"y":220,"wires":[["ea89c776.2de53","6f7e282e.065d9"],[]]},{"id":"6f7e282e.065d9","type":"simple-queue","z":"a903bc6a.6292","name":"","firstMessageBypass":false,"bypassInterval":"0","x":410,"y":520,"wires":[["6378c458.c7c86c"]]},{"id":"ae9b1943.a8de5","type":"change","z":"a903bc6a.6292","name":"trigger next run","rules":[{"t":"set","p":"trigger","pt":"msg","to":"1","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":440,"y":320,"wires":[["6f7e282e.065d9"]]},{"id":"65735916.9d1cc","type":"change","z":"a903bc6a.6292","name":"Reset queue","rules":[{"t":"set","p":"reset","pt":"msg","to":"1","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":230,"y":520,"wires":[["6f7e282e.065d9"]]},{"id":"d6f288ee.ea51f","type":"server-state-changed","z":"a903bc6a.6292","name":"xiaomi docked","server":"44f8d614.877708","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"vacuum.rockrobo_vacuum_v1","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"docked","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":true,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"x":70,"y":460,"wires":[["65735916.9d1cc","9b36e0f7.11dce8","b283e3fb.a8d6c8"],[]]},{"id":"9b36e0f7.11dce8","type":"api-call-service","z":"a903bc6a.6292","name":"vacuum set docked","server":"44f8d614.877708","version":1,"debugenabled":false,"service_domain":"input_select","service":"select_option","entityId":"input_select.vacuum2","data":"{\"option\":\"Docked\"}","dataType":"jsonata","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":270,"y":460,"wires":[[]]},{"id":"ea89c776.2de53","type":"api-current-state","z":"a903bc6a.6292","name":"qm cleaned > ","server":"44f8d614.877708","version":1,"outputs":2,"halt_if":"5","halt_if_type":"num","halt_if_compare":"gt","override_topic":true,"entity_id":"input_number.qm_cleaned","state_type":"num","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":340,"y":180,"wires":[["9379ea62.06fd18","3e54f5ed.06404a"],["ae9b1943.a8de5","306fd321.27ff1c"]]},{"id":"b283e3fb.a8d6c8","type":"function","z":"a903bc6a.6292","name":"add last clean area ","func":"const globalHomeAssistant = global.get('homeassistant');\nvar area_old_str = globalHomeAssistant.homeAssistant.states[\"input_number.qm_cleaned\"].state;\nvar area_cur_str = msg.data.new_state.attributes.cleaned_area;\nvar area_cur = Number(area_cur_str);\nvar area_old = Number(area_old_str);\nvar area_new = area_old + area_cur;\nmsg.payload = {};\nmsg.payload = area_new;\nreturn msg;\n\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":250,"y":400,"wires":[["16915af9.dcac9d"]]},{"id":"16915af9.dcac9d","type":"api-call-service","z":"a903bc6a.6292","name":"set value qm cleaned","server":"44f8d614.877708","version":1,"debugenabled":true,"service_domain":"input_number","service":"set_value","entityId":"input_number.qm_cleaned","data":"{\"value\": payload }\t","dataType":"jsonata","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":460,"y":400,"wires":[["e35fc7c3.e28638"]]},{"id":"6378c458.c7c86c","type":"switch","z":"a903bc6a.6292","name":"room switch","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"Küche","vt":"str"},{"t":"eq","v":"Sofa","vt":"str"},{"t":"eq","v":"Essen","vt":"str"},{"t":"eq","v":"TV","vt":"str"},{"t":"eq","v":"Fensterseite","vt":"str"},{"t":"eq","v":"Bett","vt":"str"},{"t":"eq","v":"Bad","vt":"str"},{"t":"eq","v":"Flur","vt":"str"},{"t":"eq","v":"Türseite","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":10,"x":230,"y":760,"wires":[["39628e27.cce962"],["9ab587a0.6a8898"],["3d1aafee.e8945"],["177c9975.890ef7"],["b565a164.599ff"],["ae96e6c9.70b398"],["ae96e6c9.70b398"],["ae96e6c9.70b398"],["ae96e6c9.70b398"],[]]},{"id":"ffa76509.7e2828","type":"api-call-service","z":"a903bc6a.6292","name":"Empty Vacuum Announcement","server":"44f8d614.877708","version":1,"debugenabled":false,"service_domain":"notify","service":"mobile_app_redmi_note_9s","entityId":"","data":"{\"message\":\"Please empty the vacuum\",\"data\":{\"type\":\"announce\"}}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":910,"y":160,"wires":[[]]},{"id":"9379ea62.06fd18","type":"api-current-state","z":"a903bc6a.6292","name":"Home?","server":"44f8d614.877708","version":1,"outputs":2,"halt_if":"home","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"person.jens","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":660,"y":180,"wires":[["ffa76509.7e2828","da74334e.107bf"],["4ffded3.ea9b314"]]},{"id":"4ffded3.ea9b314","type":"api-call-service","z":"a903bc6a.6292","name":"App Notification - Empty Vacuum","server":"44f8d614.877708","version":1,"debugenabled":false,"service_domain":"notify","service":"mobile_app_redmi_note_9s","entityId":"","data":"{\"message\":\"Vacuum waiting to be emptied\",\"title\":\"Empty Vacuum\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":920,"y":220,"wires":[[]]},{"id":"3e54f5ed.06404a","type":"api-call-service","z":"a903bc6a.6292","name":"","server":"44f8d614.877708","version":1,"debugenabled":false,"service_domain":"input_select","service":"select_last","entityId":"input_select.vacuum","data":"","dataType":"jsonata","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":800,"y":280,"wires":[[]]},{"id":"c7bd2b5e.c661c8","type":"server-state-changed","z":"a903bc6a.6292","name":"","server":"44f8d614.877708","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_select.vacuum2","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"x":170,"y":60,"wires":[["f62c9499.e7c9e8"]]},{"id":"306fd321.27ff1c","type":"api-call-service","z":"a903bc6a.6292","name":"","server":"44f8d614.877708","version":1,"debugenabled":false,"service_domain":"input_select","service":"select_first","entityId":"input_select.vacuum","data":"","dataType":"jsonata","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":720,"y":340,"wires":[[]]},{"id":"8aade1ba.ee5ee","type":"api-call-service","z":"a903bc6a.6292","name":"Goto Base","server":"44f8d614.877708","version":1,"debugenabled":false,"service_domain":"vacuum","service":"return_to_base","entityId":"vacuum.robot","data":"","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":850,"y":20,"wires":[["834624d5.040ce8"]]},{"id":"f62c9499.e7c9e8","type":"switch","z":"a903bc6a.6292","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"geleert","vt":"str"},{"t":"eq","v":"Docked","vt":"str"},{"t":"eq","v":"Mülleimer","vt":"str"},{"t":"eq","v":"Stop","vt":"str"},{"t":"eq","v":"RST","vt":"str"}],"checkall":"true","repair":false,"outputs":5,"x":410,"y":60,"wires":[["a163d8e7.31b298"],["8aade1ba.ee5ee"],["da74334e.107bf"],["8602af67.aa233"],["33276a50.9d1406"]]},{"id":"da74334e.107bf","type":"api-call-service","z":"a903bc6a.6292","name":"Goto Bin","server":"44f8d614.877708","version":1,"debugenabled":false,"service_domain":"vacuum","service":"send_command","entityId":"vacuum.robot","data":"{\"command\":\"go_to\",\"params\":{\"spot_id\":\"89b941df-c024-4e0a-9487-cdfeff9a9bd5\"}}","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":840,"y":80,"wires":[[]]},{"id":"39628e27.cce962","type":"api-call-service","z":"a903bc6a.6292","name":"Küche","server":"44f8d614.877708","version":1,"debugenabled":false,"service_domain":"vacuum","service":"send_command","entityId":"vacuum.robot","data":"{\"command\":\"zoned_cleanup\",\"params\":{\"zone_ids\":[\"2948e0bd-e3d5-43c5-b4ef-fb50a688230b\"]}}","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":630,"y":480,"wires":[["c7afe441.ca5328"]]},{"id":"3d1aafee.e8945","type":"api-call-service","z":"a903bc6a.6292","name":"Essen","server":"44f8d614.877708","version":1,"debugenabled":false,"service_domain":"vacuum","service":"send_command","entityId":"vacuum.robot","data":"{\"command\":\"zoned_cleanup\",\"params\":{\"zone_ids\":[\"b3f9ae7f-85fe-4ad9-b076-6ee6603bc911\"]}}","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":630,"y":600,"wires":[["c7afe441.ca5328"]]},{"id":"f0e72ea3.eb8e1","type":"api-call-service","z":"a903bc6a.6292","name":"Bad","server":"44f8d614.877708","version":1,"debugenabled":false,"service_domain":"vacuum","service":"send_command","entityId":"vacuum.robot","data":"{\"command\":\"zoned_cleanup\",\"params\":{\"zone_ids\":[\"befa1d3a-d362-4178-9507-6f3093921742\"]}}","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":650,"y":880,"wires":[["4882ad21.aca734"]]},{"id":"5dcba49e.96fcbc","type":"api-call-service","z":"a903bc6a.6292","name":"Bett","server":"44f8d614.877708","version":1,"debugenabled":false,"service_domain":"vacuum","service":"send_command","entityId":"vacuum.robot","data":"{\"command\":\"zoned_cleanup\",\"params\":{\"zone_ids\":[\"24faed18-dca2-452a-a0e5-ff4769259e83\"]}}","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":650,"y":820,"wires":[["4882ad21.aca734"]]},{"id":"177c9975.890ef7","type":"api-call-service","z":"a903bc6a.6292","name":"TV","server":"44f8d614.877708","version":1,"debugenabled":false,"service_domain":"vacuum","service":"send_command","entityId":"vacuum.robot","data":"{\"command\":\"zoned_cleanup\",\"params\":{\"zone_ids\":[\"c1fc55eb-bfc2-4177-b0ae-b809b14844ad\"]}}","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":630,"y":660,"wires":[["c7afe441.ca5328"]]},{"id":"9ab587a0.6a8898","type":"api-call-service","z":"a903bc6a.6292","name":"Sofa","server":"44f8d614.877708","version":1,"debugenabled":false,"service_domain":"vacuum","service":"send_command","entityId":"vacuum.robot","data":"{\"command\":\"zoned_cleanup\",\"params\":{\"zone_ids\":[\"020ef2ff-fea9-41c7-b54a-4c0a21127262\"]}}","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":630,"y":540,"wires":[["c7afe441.ca5328"]]},{"id":"b565a164.599ff","type":"api-call-service","z":"a903bc6a.6292","name":"fensterbereich","server":"44f8d614.877708","version":1,"debugenabled":false,"service_domain":"vacuum","service":"send_command","entityId":"vacuum.robot","data":"{\"command\":\"zoned_cleanup\",\"params\":{\"zone_ids\":[\"2948e0bd-e3d5-43c5-b4ef-fb50a688230b\",\"020ef2ff-fea9-41c7-b54a-4c0a21127262\",\"b3f9ae7f-85fe-4ad9-b076-6ee6603bc911\",\"c1fc55eb-bfc2-4177-b0ae-b809b14844ad\"]}}","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":640,"y":720,"wires":[[]]},{"id":"1156273.33db2d9","type":"api-call-service","z":"a903bc6a.6292","name":"Türbereich","server":"44f8d614.877708","version":1,"debugenabled":false,"service_domain":"vacuum","service":"send_command","entityId":"vacuum.robot","data":"{\"command\":\"zoned_cleanup\",\"params\":{\"zone_ids\":[\"24faed18-dca2-452a-a0e5-ff4769259e83\",\"befa1d3a-d362-4178-9507-6f3093921742\",\"7b1ac06e-bd32-412f-b466-2c6d0b7b2ea7\"]}}","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":670,"y":1000,"wires":[["4882ad21.aca734"]]},{"id":"359bdfe8.ffa8b","type":"api-call-service","z":"a903bc6a.6292","name":"Flur","server":"44f8d614.877708","version":1,"debugenabled":false,"service_domain":"vacuum","service":"send_command","entityId":"vacuum.robot","data":"{\"command\":\"zoned_cleanup\",\"params\":{\"zone_ids\":[\"7b1ac06e-bd32-412f-b466-2c6d0b7b2ea7\"]}}","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":650,"y":940,"wires":[["4882ad21.aca734"]]},{"id":"ae96e6c9.70b398","type":"api-call-service","z":"a903bc6a.6292","name":"Brücke 1","server":"44f8d614.877708","version":1,"debugenabled":false,"service_domain":"vacuum","service":"send_command","entityId":"vacuum.robot","data":"{\"command\":\"go_to\",\"params\":{\"spot_id\":\"026a2565-a689-4b17-8a22-aa13d435fdc4\"}}","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":280,"y":1300,"wires":[["e77b45c3.c511b8"]]},{"id":"5cd3fa35.7aca54","type":"api-call-service","z":"a903bc6a.6292","name":"Brücke 2","server":"44f8d614.877708","version":1,"debugenabled":false,"service_domain":"vacuum","service":"send_command","entityId":"vacuum.robot","data":"{\"command\":\"go_to\",\"params\":{\"spot_id\":\"508e5c2a-3812-4c10-86d1-83fd57113374\"}}","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":940,"y":1400,"wires":[["d5be93fe.70f7b"]]},{"id":"3dfa7f4c.92023","type":"api-call-service","z":"a903bc6a.6292","name":"Brücke 2","server":"44f8d614.877708","version":1,"debugenabled":false,"service_domain":"vacuum","service":"send_command","entityId":"vacuum.robot","data":"{\"command\":\"go_to\",\"params\":{\"spot_id\":\"508e5c2a-3812-4c10-86d1-83fd57113374\"}}","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":620,"y":1100,"wires":[["261c9a2a.8c8de6"]]},{"id":"75b9eb29.574204","type":"api-call-service","z":"a903bc6a.6292","name":"Brücke 1","server":"44f8d614.877708","version":1,"debugenabled":false,"service_domain":"vacuum","service":"send_command","entityId":"vacuum.robot","data":"{\"command\":\"go_to\",\"params\":{\"spot_id\":\"026a2565-a689-4b17-8a22-aa13d435fdc4\"}}","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":1100,"y":1040,"wires":[["128b9977.1ae6f7"]]},{"id":"7ae2c1b4.b73a1","type":"api-call-service","z":"a903bc6a.6292","name":"Goto Base","server":"44f8d614.877708","version":1,"debugenabled":false,"service_domain":"vacuum","service":"return_to_base","entityId":"vacuum.robot","data":"","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":1510,"y":1040,"wires":[["905ee288.53daf"]]},{"id":"f834c8eb.d25538","type":"link out","z":"a903bc6a.6292","name":"OUT","links":["631aa0b2.e7452"],"x":975,"y":600,"wires":[],"info":"he"},{"id":"631aa0b2.e7452","type":"link in","z":"a903bc6a.6292","name":"OUT","links":["f834c8eb.d25538","834624d5.040ce8","905ee288.53daf"],"x":295,"y":320,"wires":[["ae9b1943.a8de5"]]},{"id":"6dd0b1cb.01","type":"inject","z":"a903bc6a.6292","name":"RESET","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":90,"y":520,"wires":[["65735916.9d1cc"]]},{"id":"8602af67.aa233","type":"api-call-service","z":"a903bc6a.6292","name":"Pause","server":"44f8d614.877708","version":1,"debugenabled":false,"service_domain":"vacuum","service":"pause","entityId":"vacuum.robot","data":"","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":550,"y":80,"wires":[[]]},{"id":"4f269ae7.6fe634","type":"link in","z":"a903bc6a.6292","name":"RST","links":["d6cdab92.dda848"],"x":75,"y":580,"wires":[["65735916.9d1cc"]]},{"id":"d6cdab92.dda848","type":"link out","z":"a903bc6a.6292","name":"RST","links":["4f269ae7.6fe634"],"x":635,"y":140,"wires":[]},{"id":"b4e7e4f9.afc6c8","type":"ha-wait-until","z":"a903bc6a.6292","name":"wait until idle","server":"44f8d614.877708","outputs":2,"entityId":"vacuum.robot","entityIdFilterType":"exact","property":"state","comparator":"is","value":"idle","valueType":"str","timeout":"45","timeoutType":"num","timeoutUnits":"minutes","entityLocation":"","entityLocationType":"none","checkCurrentState":true,"blockInputOverrides":true,"x":630,"y":1300,"wires":[["ad3f244d.462ef8"],[]]},{"id":"4882ad21.aca734","type":"ha-wait-until","z":"a903bc6a.6292","name":"wait until returning","server":"44f8d614.877708","outputs":2,"entityId":"vacuum.robot","entityIdFilterType":"exact","property":"state","comparator":"is","value":"returning","valueType":"str","timeout":"45","timeoutType":"num","timeoutUnits":"minutes","entityLocation":"","entityLocationType":"none","checkCurrentState":true,"blockInputOverrides":true,"x":890,"y":900,"wires":[["675347c5.6b8738"],[]]},{"id":"e9f60ebd.d3b8f","type":"ha-wait-until","z":"a903bc6a.6292","name":"wait until idle","server":"44f8d614.877708","outputs":2,"entityId":"vacuum.robot","entityIdFilterType":"exact","property":"state","comparator":"is","value":"idle","valueType":"str","timeout":"45","timeoutType":"num","timeoutUnits":"minutes","entityLocation":"","entityLocationType":"none","checkCurrentState":true,"blockInputOverrides":true,"x":950,"y":1040,"wires":[["75b9eb29.574204"],[]]},{"id":"d7cc76ed.993f68","type":"ha-wait-until","z":"a903bc6a.6292","name":"wait until idle","server":"44f8d614.877708","outputs":2,"entityId":"vacuum.robot","entityIdFilterType":"exact","property":"state","comparator":"is","value":"idle","valueType":"str","timeout":"45","timeoutType":"num","timeoutUnits":"minutes","entityLocation":"","entityLocationType":"none","checkCurrentState":true,"blockInputOverrides":true,"x":1350,"y":1060,"wires":[["7ae2c1b4.b73a1"],[]]},{"id":"d72325d2.5b6228","type":"ha-wait-until","z":"a903bc6a.6292","name":"wait until idle","server":"44f8d614.877708","outputs":2,"entityId":"vacuum.robot","entityIdFilterType":"exact","property":"state","comparator":"is","value":"idle","valueType":"str","timeout":"45","timeoutType":"num","timeoutUnits":"minutes","entityLocation":"","entityLocationType":"none","checkCurrentState":true,"blockInputOverrides":true,"x":1310,"y":1420,"wires":[["d834715a.a7917"],[]]},{"id":"c7afe441.ca5328","type":"ha-wait-until","z":"a903bc6a.6292","name":"wait until returning","server":"44f8d614.877708","outputs":2,"entityId":"vacuum.robot","entityIdFilterType":"exact","property":"state","comparator":"is","value":"returning","valueType":"str","timeout":"45","timeoutType":"num","timeoutUnits":"minutes","entityLocation":"","entityLocationType":"none","checkCurrentState":true,"blockInputOverrides":true,"x":850,"y":600,"wires":[["f834c8eb.d25538"],[]]},{"id":"675347c5.6b8738","type":"api-call-service","z":"a903bc6a.6292","name":"Pause","server":"44f8d614.877708","version":1,"debugenabled":false,"service_domain":"vacuum","service":"pause","entityId":"vacuum.robot","data":"","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":1050,"y":880,"wires":[["8f81eef8.b7bbf"]]},{"id":"6cf3d241.f174ac","type":"ha-wait-until","z":"a903bc6a.6292","name":"wait until idle","server":"44f8d614.877708","outputs":2,"entityId":"vacuum.robot","entityIdFilterType":"exact","property":"state","comparator":"is","value":"idle","valueType":"str","timeout":"45","timeoutType":"num","timeoutUnits":"minutes","entityLocation":"","entityLocationType":"none","checkCurrentState":true,"blockInputOverrides":true,"x":1190,"y":840,"wires":[["3dfa7f4c.92023"],[]]},{"id":"33276a50.9d1406","type":"api-call-service","z":"a903bc6a.6292","name":"Pause","server":"44f8d614.877708","version":1,"debugenabled":false,"service_domain":"vacuum","service":"pause","entityId":"vacuum.robot","data":"","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":550,"y":140,"wires":[["d6cdab92.dda848"]]},{"id":"834624d5.040ce8","type":"link out","z":"a903bc6a.6292","name":"OUT","links":["631aa0b2.e7452"],"x":955,"y":20,"wires":[]},{"id":"905ee288.53daf","type":"link out","z":"a903bc6a.6292","name":"OUT","links":["631aa0b2.e7452"],"x":1615,"y":1040,"wires":[]},{"id":"e35fc7c3.e28638","type":"debug","z":"a903bc6a.6292","name":"m2","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":630,"y":400,"wires":[]},{"id":"e77b45c3.c511b8","type":"delay","z":"a903bc6a.6292","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":440,"y":1280,"wires":[["b4e7e4f9.afc6c8"]]},{"id":"d5be93fe.70f7b","type":"delay","z":"a903bc6a.6292","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":1120,"y":1400,"wires":[["d72325d2.5b6228"]]},{"id":"261c9a2a.8c8de6","type":"delay","z":"a903bc6a.6292","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":780,"y":1100,"wires":[["e9f60ebd.d3b8f"]]},{"id":"8f81eef8.b7bbf","type":"delay","z":"a903bc6a.6292","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":1020,"y":820,"wires":[["6cf3d241.f174ac"]]},{"id":"128b9977.1ae6f7","type":"delay","z":"a903bc6a.6292","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":1260,"y":1020,"wires":[["d7cc76ed.993f68"]]},{"id":"4e68d57b.6279dc","type":"inject","z":"a903bc6a.6292","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":940,"y":1260,"wires":[["5cd3fa35.7aca54"]]},{"id":"d834715a.a7917","type":"delay","z":"a903bc6a.6292","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":1320,"y":1500,"wires":[["b4596b2a.85f6c8"]]},{"id":"ad3f244d.462ef8","type":"delay","z":"a903bc6a.6292","name":"","pauseType":"delay","timeout":"15","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":770,"y":1340,"wires":[["5cd3fa35.7aca54"]]},{"id":"13ab30ce.2d13af","type":"inject","z":"a903bc6a.6292","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":110,"y":1300,"wires":[["ae96e6c9.70b398"]]},{"id":"a163d8e7.31b298","type":"api-call-service","z":"a903bc6a.6292","name":"reset qm cleaned","server":"44f8d614.877708","version":1,"debugenabled":true,"service_domain":"input_number","service":"set_value","entityId":"input_number.qm_cleaned","data":"{\"value\": 0}\t","dataType":"jsonata","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":590,"y":20,"wires":[["8aade1ba.ee5ee"]]},{"id":"4f60e109.32108","type":"link in","z":"a903bc6a.6292","name":"","links":["21f6b2f9.41f1ae"],"x":295,"y":1020,"wires":[["45fb70a1.c3031","25a34731.525f18","781c7527.ba572c","c5836df7.9368f"]]},{"id":"21f6b2f9.41f1ae","type":"link out","z":"a903bc6a.6292","name":"","links":["4f60e109.32108"],"x":1635,"y":1500,"wires":[]},{"id":"45fb70a1.c3031","type":"simple-queue","z":"a903bc6a.6292","name":"","firstMessageBypass":true,"bypassInterval":"0","x":510,"y":820,"wires":[["5dcba49e.96fcbc"]]},{"id":"c5836df7.9368f","type":"simple-queue","z":"a903bc6a.6292","name":"","firstMessageBypass":true,"bypassInterval":"0","x":510,"y":1000,"wires":[["1156273.33db2d9"]]},{"id":"781c7527.ba572c","type":"simple-queue","z":"a903bc6a.6292","name":"","firstMessageBypass":true,"bypassInterval":"0","x":510,"y":940,"wires":[["359bdfe8.ffa8b"]]},{"id":"25a34731.525f18","type":"simple-queue","z":"a903bc6a.6292","name":"","firstMessageBypass":true,"bypassInterval":"0","x":510,"y":880,"wires":[["f0e72ea3.eb8e1"]]},{"id":"ace5d353.35ed1","type":"inject","z":"a903bc6a.6292","name":"RESET","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":130,"y":980,"wires":[["b31ef826.cd5f68"]]},{"id":"b31ef826.cd5f68","type":"change","z":"a903bc6a.6292","name":"Reset queue","rules":[{"t":"set","p":"reset","pt":"msg","to":"1","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":270,"y":980,"wires":[["45fb70a1.c3031","25a34731.525f18","781c7527.ba572c","c5836df7.9368f"]]},{"id":"b4596b2a.85f6c8","type":"change","z":"a903bc6a.6292","name":"trigger next run","rules":[{"t":"set","p":"trigger","pt":"msg","to":"1","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1520,"y":1500,"wires":[["21f6b2f9.41f1ae"]]},{"id":"44f8d614.877708","type":"server","name":"Home Assistant","legacy":false,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]

Dont know the bridge is working this way, did it in a HA Script first and was at least ablet to get it until the cleaning. Switched to node as it seems to be easier.

Regards

Jens

It’s really difficult to understand what is going here and which nodes are constantly triggering without a more detailed description. What exactly are you changing, which part of the flow is getting executed.

Best advice I can come up with:

  • Start at the beginning of your flow with the first trigger and disconnect it from the rest and add a debug node that shows the complete msg and go from there. Figure out why it is constantly triggering your flow and add one component back at a time. Go node by node and see where the flow doesn’t behave the way you expect it to. And add debug nodes, everywhere.

Without knowing the details of your complete setup, it is very hard to tell what is going on. For me, the switch after the input_select doesn’t even make sense, it looks like a mix of input_select options and states from the vacuum :stuck_out_tongue:

So, one step at a time and add debug nodes at every step. This should give you a clearer picture.

Hey

thx a lot, tried to debug the small step, thats why I made the Inject - part. Everything worked unless I started to “Build the bridge”

And in the bridge i get everything executed in the right order, but the second executes the first node again. I will check the “bridgebuilding” now first, with a lot of debugs nodes :slight_smile:

Yes i guess its hard to get. Thats why i tried to give you just the small part only. Thx for even trying.
I will check the switch youre talking about later, first i have to get my HA working again, seems to be crashed :frowning:

Changed to Valetudo RE, seems to work much better, even i have to configure everything again

Thx again for your help

1 Like

Hey

so everything is running again and i found a solution, for your information:

[{"id":"5d21e0ac.8c808","type":"api-call-service","z":"7dcecbe9.d26e54","name":"BrückeF","server":"44f8d614.877708","version":1,"debugenabled":false,"service_domain":"vacuum","service":"send_command","entityId":"vacuum.sauger","data":"{\"command\":\"go_to\",\"params\":{\"spot_id\":\"a9adba1f-75a9-4886-9830-4903b04d64af\"}}","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":280,"y":1300,"wires":[["bc9bdfd9.abfc9"]]},{"id":"bc9bdfd9.abfc9","type":"delay","z":"7dcecbe9.d26e54","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":440,"y":1300,"wires":[["c7d737b9.e8d0c8"]]},{"id":"c7d737b9.e8d0c8","type":"ha-wait-until","z":"7dcecbe9.d26e54","name":"wait until idle","server":"44f8d614.877708","outputs":2,"entityId":"vacuum.sauger","entityIdFilterType":"exact","property":"state","comparator":"is","value":"idle","valueType":"str","timeout":"45","timeoutType":"num","timeoutUnits":"minutes","entityLocation":"","entityLocationType":"none","checkCurrentState":true,"blockInputOverrides":true,"x":610,"y":1300,"wires":[["33dd5b9b.f72d34"],[]]},{"id":"33dd5b9b.f72d34","type":"change","z":"7dcecbe9.d26e54","name":"pay 1","rules":[{"t":"set","p":"payload","pt":"msg","to":"1","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":770,"y":1300,"wires":[["e7cfbbc4.5773a8"]]},{"id":"e7cfbbc4.5773a8","type":"api-call-service","z":"7dcecbe9.d26e54","name":"Brücke 2","server":"44f8d614.877708","version":1,"debugenabled":false,"service_domain":"vacuum","service":"send_command","entityId":"vacuum.sauger","data":"{\"command\":\"go_to\",\"params\":{\"spot_id\":\"860075c3-d99f-4b8f-8205-648eee5a790e\"}}","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":920,"y":1300,"wires":[["1bff4b2d.b4dc75"]]},{"id":"44f8d614.877708","type":"server","name":"Home Assistant","addon":true}]

Honestly i don’t know why i have to trigger the Brücke 2 this way, it takes the payload and not the config for the command. Don’t know wheter its a feature or a bug :slight_smile:

Saw now it would have been better to tell BrückeF output none i guess.

Thx for your help!

1 Like