Trigger something for every X square meters vacuumed

I’ve got to admit, as a software eng. i’m shocked i’ve got so confused with this simple (yet sophisticated) way.
Thank you for the clarification.
I love this conversation!

Now there’s a new problem.
My automation actully does 2 things once it’s discover that the total_cleaned_area (from_state/30) < total_cleaned_area (to_state/30)

  1. Sends the roborock to the wait next to the trash bin
  2. Send notification to my phone after a minute (to make sure it arrived to the trash can already) letting me know to come and clean him.

The problem is that i have 2 other automations for scheduled cleanups.
every day at 23:00
and again at 10:00 on weekends (which also cleans more rooms).

I wonder what will happen if after one of the scheduled cleanups at 23:00 he finishes and then goes to stand next to the trash bin - but it’s late and we are asleep.
And by the time we wake up (if it’s after 10:00 for some reason and we didn’t manage to clean him and send him back to the dock) - the automation of 10:00 will start.

I wonder if it will start cleaning or skip that automation.

I’ll check

Covering distance cleaned, energy consumption or time that he was active is pretty much the same thing just different methods. but it will do the same trick.
The only preference for covering distance is that it’s more intuitive to us as humans… rather then energy consumption (unless you’re experienced enough).

But out of curiosity - i would you do that with the energy sensor?

For your information: after I updated to Home Assistant 2021.12.7 and removed my Xiaomi vacuum config from YAML in favor of UI my code above stopped working. This is because the total_cleaned_area is now an individual sensor instead of an attribute of the vacuum.

Solution:
Let the automation trigger on changes to sensor.robocop_total_clean_area instead. This works because this sensor is only updated once cleaning completes (instead of continuously). Then replace trigger.from_state.attributes.total_cleaned_area with int(trigger.from_state.state) and vice versa for the to state.

Or use inspiration from the following code snippet. Basically this will show different text in the notification:

  • For every new 40 m2 cleaned, it says “Empty dustbin”
  • For every new 80 m2 cleaned, it says “Empty dustbin and clean filter.”
  • And nothing if none of the above applies.

automations.yaml

- id: '123456789'
  alias: Send notification when vacuum returns to base with action to go to waste bin
  trigger:
    entity_id: sensor.robocop_total_clean_area
    platform: state
  action:
  - service: notify.mobile_app
    data_template:
      title: >
        {% set clean_area = states('sensor.robocop_last_clean_area') | round(0, 0) ~ ' ' ~ state_attr('sensor.robocop_last_clean_area', 'unit_of_measurement') %}
        {% set clean_duration = int(states('sensor.robocop_last_clean_duration')) // 60 ~ ' min' %}
        Robocop - Clean-up complete: {{ clean_area }}, {{ clean_duration }}
      message: >
        {% set apartment_size = 40 %}
        {% set clean_area_old = trigger.from_state.state | int %} 
        {% set clean_area_new = trigger.to_state.state | int %}
        {% if clean_area_new // (apartment_size*2) > clean_area_old // (apartment_size*2) -%}
          ⚠️ Empty dustbin and clean filter.
        {%- elif clean_area_new // apartment_size > clean_area_old // apartment_size -%}
          ⚠️ Empty dustbin.
        {%- endif %}
        Finished cleaning, returning to base.
      data:
        channel: Vacuum
        clickAction: "entityId:vacuum.robocop"
        notification_icon: "mdi:robot-vacuum"
        actions:
        - action: send_robocop_to_waste_bin
          title: Go to waste bin

This also uses // for integer division instead of simply / and | int (converting to int) as I did before. And with the help of some variables it becomes much easier to follow and understand :wink:

image

Thank you,
Yeah… mine stopped working as well.
I’m now playing around with it trying to see how to get it work with the same method as earlier.

My problem is that i want it to be sent for “cleaning” itself every absolute 40meters of cleaning and not relative 40meter of cleaning.

I see that the new sensor only tests relative cleaning time\area, correct? :\

The sensor.roborock_total_clean_area behaves the same as the previous total_cleaned_area attribute - they both return the absolute total and they both only updates once cleaning completes.

Do you want the robot to be “sent for cleaning” even when it’s busy vacuuming (basically stop what it’s doing)? Or only after vacuuming is complete?

My previous code used to sent the roborock (alias “alfred”) to wait for me to empty it every 60meters but only once it was back to the docking station and only at 8:00+ (so if it was cleaning at 23:00 for example and went back to the docking, and only at 8:00 it went to the trashcan - that way it won’t empty it’s battery while i’m asleep and also won’t interrupt us during the night when walking into the friedge or something like that).
*It also updated a input parameters that i can use to see when was the last time it was sent to be cleaned (in case i wanna know).

The current " `roborock_total_clean_area’" seem to only expose the last cleaned area and not the absolute value, see image attached.

Therefor my current code seem to send it to the trashcan after every time it cleans.
The problem is with this part of the code:
{{ (trigger.to_state.state|int / 60) > (trigger.from_state.state|int /60)}}

This is the entire code:

alias: Alfred Notifying When he's Full After 60sq
description: This sends Alfred to the trash can to wait to be cleaned.
trigger:
  - platform: state
    entity_id: sensor.roborock_vacuum_s5_last_clean_area
condition:
  - condition: template
    value_template: >-
      {{ (trigger.to_state.state|int / 60) > (trigger.from_state.state|int /
      60)}}
action:
  - wait_template: |-
      {% if states('vacuum.alfred') == "docked" %}
        True
      {% else %}
        False
      {% endif %}
    timeout: '3:00'
    continue_on_timeout: true
  - wait_template: >-
      {% if ((now().strftime('%H:%M')) > "08:40") and ((now().strftime('%H:%M'))
      < "20:00") %}

      true

      {% else %}

      false

      {%endif%}
    timeout: '13:00'
  - service: script.vacuum_maintenance_trash_can
  - delay:
      hours: 0
      minutes: 1
      seconds: 10
      milliseconds: 0
  - service: notify.mobile_app_michal_iphone_12
    data:
      message: >-
        Alfred is waiting for you next to the trash can, please empty the bin
        and send Alfred back to the dock.
      title: Please Clean Alfred
  - service: input_datetime.set_datetime
    target:
      entity_id: input_datetime.alfred_last_emptied
    data:
      date: '{{ now().strftime("%d/%m/%y") }}'
      time: '{{ now().strftime("%H:%M:%S") }}'
mode: single

Ah, looking at that screenshot you only seem to have the “last_ckeaned_area” sensor and not any “total_clean_area”. After the update I believe you have to enable a few sensors yourself.

Go to Configuration > Devices & services > Alfred Xiaomi Miio > click 16 entities

Here you should see a “total_clean_area” sensor. If it has a disabled icon next to it then click it see a toggle where you can enable it. Hope that helps!

I really like your automation by the way. Just a button in the notification as I have isn’t enough for me to clean it as often as I should :stuck_out_tongue:

First of, thank you!
So i’ve enabled those sensors and now my automation triggered by “sensor.roborock_vacuum_s5_total_clean_area” change.
I hope now it will work…

Regarding the automation, thank you!
It’s basically sends the roborock to the exact spot which is the most coinvent to be located for me to empty it.
It then sends a notification to my wife :sweat_smile: to clean it.

And it only does that in hours that we’re awake - so it won’t run out of battery or freak us out if he’ll be there during the night.
One of the best automations i’ve got.

1 Like

Hahahaha, I love it! :joy:

I forgot to mention that I’ve had a few false triggers with my latest code posted here. Sometimes XIaomi Miio times out making the sensors render as unavailable which also triggers the automation.

I had to add a few conditions like this so it would only trigger when the total_clean_area increases in value:

  trigger:
    entity_id: sensor.robocop_total_clean_area
    platform: state
  condition: 
    - condition: template
      value_template: >
        {{ trigger.from_state is not none and 
           trigger.to_state is not none and
           trigger.from_state.state not in ["unavailable"] and  
           trigger.to_state.state | float(0) > trigger.from_state.state | float(0)
        }}

Thanks @oscacrb,

I had the same issue so i used your code, thanks!
One little note,
I’m dividing by 60 so it won’t trigger the cleanup automaiton every time.

BTW, i’m currently sending myself a notification with the {{trigger.to_state.state}} and {{trigger.from_state.state}} to see what numbers are outputing (for debug purposes).

I couldn’t find an easier way to look for what those numbers were when i want to debug an automation.
Is there anyway to see what was the value of the “trigger.to_state.state” and “trigger.from_state.state” when the automation was triggered? i can’t see it from the debug screen.

In the automation debugger, with the first step selected open “Changed Variables” and look for trigger > from_state > state and to_state > state respectively.

I’m awaiting delivery of my Roborock and found this thread, which is exactly what I wanted to do! :slightly_smiling_face:

@zivgin Would you mind sharing your full latest code please as your solution sounds great! (I think the script.vacuum_maintenance_trash_can is missing from above, would be great to see! (I know how to get the co-ordinates))

It stopped working for me again ):
Let me troubleshoot it and get back to you.

What part of the code do you need BTW?

Using the above code as a basis. I’ve been able to get my S5 Max working, it’s okay, however when moving between floors has some downsides…. E.g. moving the vacuum to a different floor which isn’t vacuumed as much, it always needs emptying afterwards or when mopping the floors after vacuuming the below calc is not always accurate. I’m thinking it needs some kind of “I’ve emptied the bin” variable/reset… maybe storing to/from m2 into input variables, looking at the mop attached sensor (not including m2 into bin calc when mopping) and calculating from there may work (I need to think about it some more EDIT: I’ve made some changes on my dev automation which now uses a input_number helper and only add’s to the bin level when mop is not attached. I can also zero the value to manually update or via Alexa :slightly_smiling_face: - running it alongside the below for a few days to check it works as expected, then can post here.)

alias: Vacuum - Move Sandy to bin for emptying after 60sq
description: This sends Sandy to the dustbin to wait to be cleaned.
trigger:
  - platform: state
    entity_id: sensor.sandy_total_clean_area
condition:
  - condition: template
    value_template: >-
      {{ int(trigger.to_state.state) // 60 > int(trigger.from_state.state) // 60 }}
  - condition: template
    value_template: |-
      {{ trigger.from_state is not none and 
         trigger.to_state is not none and
         trigger.from_state.state not in ["unavailable"] and  
         trigger.to_state.state | float(0) > trigger.from_state.state | float(0)
      }}
action:
  - wait_template: |-
      {% if state_attr('vacuum.sandy', 'battery_level') == 100 %}
        true
      {% else %}
        false
      {% endif %}
    continue_on_timeout: false
  - wait_template: >-
      {% if ((now().strftime('%H:%M')) > "07:30") and ((now().strftime('%H:%M'))
      < "22:00") %}
        true
      {% else %}
        false
      {%endif%}
  - wait_template: >-
      {% if states('person.me') == 'home' or states('person.partner') == 'home' %}
        true
      {% else %}
        false
      {% endif %}
  - service: script.vacuum_dustbin
    data: {}
  - delay:
      hours: 0
      minutes: 0
      seconds: 20
      milliseconds: 0
  - service: notify.mobile_app_iphone
    data:
      message: >-
        Sandy is waiting for you next to the dust bin, please empty the bin and
        send her back to the dock.
      title: Please clean Sandy
  - service: input_datetime.set_datetime
    target:
      entity_id: input_datetime.sandy_last_emptied
    data:
      datetime: '{{ now().strftime(''%Y-%m-%d %H:%M:%S'') }}'
mode: single


@zivgin The changes I’ve added are to wait until the battery is 100% before moving Sandy, the formatting of the calculation (it went back every time originally) and added a wait so Sandy only moves to the bin if myself or my partner are home.

Here’s the other script which makes sure the correct map is loaded before moving to the bin


alias: Vacuum - Dustbin
sequence:
  - service: vacuum.send_command
    data:
      command: load_multi_map
      params: 0
    target:
      entity_id: vacuum.sandy
  - service: vacuum.send_command
    data:
      command: app_goto_target
      params:
        - 24900
        - 29660
    target:
      entity_id: vacuum.sandy
mode: single
icon: mdi:trash-can


you’re good. i like it.
I’ve just worked on mine today and got it to work, something with the float\int formating didn’t work well and the values were still kept as string so the “is bigger” equation failed.

I use helpers to keep the last time this automaton run, but when you think about it, you don’t need it, as you can simply check the last time the automation itself ran…

Regarding the 100% battery. not sure i understand why… if it’s wait for you next to the dust bin, how quickly does the battery drain while it’s in idle mode?
If you really want to solve the battery problem, i would go for the exact opposite approach which is:
“Wait for me next to the bin, until battery is lower then X (say 30%), if battery goes below X (say 30%), go back to the dock until you reach Y battery (say 60%), and then go back to the trash”.

In that way, it will never run out of battery even if you’re on vacation… as it always knows to go back and charge itself when it’s needed.

I have roborock 5s (not max) so the “water bucket” or “dust bin” sensors doesn’t work :
if it works for you, you can simply trigger automation that updates when the dust bin had been emptied when dust bin had been removed.

I figured if the battery is fully charged, the vacuum will always be ready for the next clean, regardless of how long it’s left but in reality, I added it because I could more than anything! (whilst playing with the code and vaccum :slight_smile: )

Here’s my v2 which uses the helper to store the value and allows the counter to be reset should I empty it after cleaning a different floor (I’ll set it in a script so I can just ask Alexa to reset it when needed)

I have sensors for water_box_attached and mop_attached but whilst there is a sensor for the bin (as the vacuum speaks when it’s taken out) it doesn’t seem to be exposed as an entity for some reason!? (which looks to be an oversight?)

alias: >-
  Vacuum - Send Sandy to bin location after 60sqm of cleaning without mop
  attached
description: >-
  After each completed clean, whilst the mop is not attached, add the last
  cleaned area sqm to input_number helper, check if total sqm is 60 or over, if
  so, check/wait for battery to be fully charged, check/wait until it's after
  07:30 and before 22:00, check/wait until one of the parents are home, then
  send vacuum to the waste bin location, wait 20 seconds, then send a message to
  iPhone, reset the input_number sqm (bin) to zero and record the time/date for
  reference.
trigger:
  - platform: state
    entity_id: sensor.sandy_total_clean_area
condition:
  - condition: template
    value_template: |-
      {{ trigger.from_state is not none and 
         trigger.to_state is not none and
         trigger.from_state.state not in ["unavailable"] and  
         trigger.to_state.state | float(0) > trigger.from_state.state | float(0)
      }}
  - condition: state
    entity_id: binary_sensor.sandy_mop_attached
    state: 'off'
action:
  - service: input_number.set_value
    data_template:
      entity_id: input_number.sandy_bin_level
      value: >-
        {{ states('input_number.sandy_bin_level')|float +
        states('sensor.sandy_last_clean_area')|float }}
  - choose:
      - conditions:
          - condition: template
            value_template: |-
              {% if states.input_number.sandy_bin_level.state|float >= 60 %}
                true
              {% else %}
                false
              {% endif %}
        sequence:
          - wait_template: |-
              {% if state_attr('vacuum.sandy', 'battery_level') == 100 %}
                true
              {% else %}
                false
              {% endif %}
          - wait_template: >-
              {% if ((now().strftime('%H:%M')) > "07:30") and
              ((now().strftime('%H:%M')) < "22:00") %}
                true
              {% else %}
                false
              {%endif%}
          - wait_template: >-
              {% if states('person.me') == 'home' or states('person.partner) ==
              'home' %}
                true
              {% else %}
                false
              {% endif %}
          - service: script.vacuum_dustbin
            data: {}
          - delay:
              hours: 0
              minutes: 0
              seconds: 20
              milliseconds: 0
          - service: notify.mobile_app_iphone
            data:
              message: >-
                Sandy is waiting for you next to the dust bin, please empty the
                bin and send her back to the dock.
              title: Please clean Sandy
          - service: input_number.set_value
            data_template:
              entity_id: input_number.sandy_bin_level
              value: '{{ 0 }}'
          - service: input_datetime.set_datetime
            target:
              entity_id: input_datetime.sandy_last_emptied
            data:
              datetime: '{{ now().strftime(''%Y-%m-%d %H:%M:%S'') }}'
    default: []
mode: single

Looks good overall.
This is mine (i’ve took the “waiting for battery to fill up” part).

alias: Alfred Notifying When he's Full After 60sq
description: This sends Alfred to the trash can to wait to be cleaned.
trigger:
  - platform: state
    entity_id: sensor.roborock_vacuum_s5_total_clean_area
condition:
  - condition: template
    value_template: |-
      {{ trigger.from_state is not none and 
                 trigger.to_state is not none and
                 trigger.from_state.state not in ["unavailable"] and  
                 (trigger.to_state.state|float /60) | int > (trigger.from_state.state|float /60 )| int
              }}
action:
  - wait_template: |-
      {% if states('vacuum.alfred') == "docked" %}
        True
      {% else %}
        False
      {% endif %}
    timeout: '3:00'
    continue_on_timeout: true
  - wait_template: |-
      {% if state_attr('vacuum.alfred', 'battery_level') > 85%}
              true
            {% else %}
              false
            {% endif %}
    timeout: '13:00'
  - wait_template: >-
      {% if ((now().strftime('%H:%M')) > "08:40") and ((now().strftime('%H:%M'))
      < "20:30") %}

      true

      {% else %}

      false

      {%endif%}
    timeout: '13:00'
  - service: script.vacuum_maintenance_trash_can
    data: {}
  - delay:
      hours: 0
      minutes: 1
      seconds: 10
      milliseconds: 0
  - service: notify.mobile_app_michal_iphone_12
    data:
      message: >-
        Alfred is waiting for you next to the trash can, please empty the bin
        and send Alfred back to the dock.
      title: Please Clean Alfred
  - service: input_datetime.set_datetime
    target:
      entity_id: input_datetime.alfred_last_emptied
    data:
      date: '{{ now().strftime("%d/%m/%y") }}'
      time: '{{ now().strftime("%H:%M:%S") }}'
mode: single

Thanks a lot for all the good information in this thread. I’ve set up a similar automation in Node-Red. At the end of each clean, the vacuum will check to see if total area cleaned has increased by a multiple of 60M2. If it has, and one of us is home during daylight hours, and the battery level is greater than 20%, it parks next to our bin and the person at home is notified. If we don’t empty it and then send it home within 3 hours, it returns itself to dock.
If nobody was home when it finished cleaning, it will check to see if someone is home once a minute, and if someone arrives home during daylight hours, it will head back to the dustbin, once again for a max of 3 hours.
If it finished a clean outside of daylight hours, it will go back to the dock, and when motion is detected in our living room the next morning, it will return to the rubbish bin. If we fail to empty it, we’re again notified.

Obviously many parts of the flow will be useless to others, but for anyone who’s interested, you’ll be able to see how every step was achieved. I’m relatively new to Node-Red, so there will definitely be cleaner ways of achieving things but i’ve tested the flow and I’m happy with it so far.

[{"id":"04b5da70ea694834","type":"tab","label":"Flow 1","disabled":false,"info":"","env":[]},{"id":"916c267050e49453","type":"api-current-state","z":"04b5da70ea694834","name":"Total cleaned area","server":"8a644e13.f9644","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"sensor.roborock_s6_maxv_total_clean_area","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"topic","propertyType":"msg","value":"Area_Before_Clean","valueType":"str"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":370,"y":280,"wires":[["29c3b0b992071e91"]]},{"id":"7a0b8f486105cf01","type":"server-state-changed","z":"04b5da70ea694834","name":"Vacuum starts cleaning","server":"8a644e13.f9644","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"vacuum.roborock_s6_maxv","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"cleaning","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,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":140,"y":280,"wires":[["916c267050e49453"],[]]},{"id":"3ec8e251ad25cb40","type":"api-current-state","z":"04b5da70ea694834","name":"Total cleaned area","server":"8a644e13.f9644","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"sensor.roborock_s6_maxv_total_clean_area","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"topic","propertyType":"msg","value":"Area_After_Clean","valueType":"str"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":370,"y":360,"wires":[["29c3b0b992071e91"]]},{"id":"29c3b0b992071e91","type":"join","z":"04b5da70ea694834","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":550,"y":320,"wires":[["ce607065b439e352"]]},{"id":"ce607065b439e352","type":"function","z":"04b5da70ea694834","name":"SET METER CHECK HERE (60)","func":"msg.payload = ((msg.payload.Area_After_Clean / 60 - msg.payload.Area_Before_Clean / 60).toFixed(0));\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":750,"y":320,"wires":[["fca6da530fa30692","3e1508894b84b3f3"]]},{"id":"d27c362bad60c134","type":"server-state-changed","z":"04b5da70ea694834","name":"Vacuum finishes cleaning","server":"8a644e13.f9644","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"vacuum.roborock_s6_maxv","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,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":150,"y":360,"wires":[["3ec8e251ad25cb40"],[]]},{"id":"fca6da530fa30692","type":"switch","z":"04b5da70ea694834","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"0","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":1010,"y":320,"wires":[["e7ee9f587c2c2f1f"],["dba1bed3dca0de1e"]]},{"id":"dba1bed3dca0de1e","type":"api-current-state","z":"04b5da70ea694834","name":"Person 1 home?","server":"8a644e13.f9644","version":3,"outputs":2,"halt_if":"home","halt_if_type":"str","halt_if_compare":"is","entity_id":"person.jordan","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"topic","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":610,"y":420,"wires":[["062088199e55c657"],["548496f9be459152"]]},{"id":"548496f9be459152","type":"api-current-state","z":"04b5da70ea694834","name":"Person 2 home?","server":"8a644e13.f9644","version":3,"outputs":2,"halt_if":"home","halt_if_type":"str","halt_if_compare":"is","entity_id":"person.lauren","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"topic","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":510,"y":540,"wires":[["644632fe2380b5ee"],["6d408ce7c2f042ea"]]},{"id":"db4ab86588fc2b9a","type":"api-call-service","z":"04b5da70ea694834","name":"Go to bin","server":"8a644e13.f9644","version":5,"debugenabled":false,"domain":"xiaomi_miio","service":"vacuum_goto","areaId":[],"deviceId":["3ab0d503fda3b4b41f5fc06dcfadc1ba"],"entityId":["vacuum.roborock_s6_maxv"],"data":"{\"x_coord\":\"34634\",\"y_coord\":\"28777\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1420,"y":260,"wires":[["05037953ba416f17","3da490e7f4d15300","72cc97e3ea5dd4f8","9a6ac0fb60ce699b"]]},{"id":"05037953ba416f17","type":"api-current-state","z":"04b5da70ea694834","name":"Is TV on?","server":"8a644e13.f9644","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"media_player.lg_webos_tv","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":1580,"y":260,"wires":[["ee812168fab914fd"],[]]},{"id":"3da490e7f4d15300","type":"api-current-state","z":"04b5da70ea694834","name":"desktop being used?","server":"8a644e13.f9644","version":3,"outputs":2,"halt_if":"PowerOn","halt_if_type":"str","halt_if_compare":"is","entity_id":"sensor.desktop_monitorpowerstate","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":1620,"y":300,"wires":[["4608fb28b259b21f"],[]]},{"id":"ee812168fab914fd","type":"api-call-service","z":"04b5da70ea694834","name":"","server":"8a644e13.f9644","version":5,"debugenabled":false,"domain":"notify","service":"television","areaId":[],"deviceId":[],"entityId":[],"data":"{\"message\":\"Vacuum needs emptying.\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1840,"y":260,"wires":[[]]},{"id":"4608fb28b259b21f","type":"api-call-service","z":"04b5da70ea694834","name":"","server":"8a644e13.f9644","version":5,"debugenabled":false,"domain":"notify","service":"desktop","areaId":[],"deviceId":[],"entityId":[],"data":"{\"message\":\"Vacuum needs emptying\",\"title\":\"\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1840,"y":300,"wires":[[]]},{"id":"72cc97e3ea5dd4f8","type":"change","z":"04b5da70ea694834","name":"Set msg","rules":[{"t":"set","p":"message","pt":"msg","to":"Vaccum needs emptying.","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1580,"y":220,"wires":[["0e85a496a9e11d57"]]},{"id":"0e85a496a9e11d57","type":"api-call-service","z":"04b5da70ea694834","name":"notify.","server":"8a644e13.f9644","version":5,"debugenabled":false,"domain":"notify","service":"mobile_app_oneplus_6t_bbe","areaId":[],"deviceId":[],"entityId":[],"data":"{\"message\":\"{{message}}\",\"data\":{\"actions\":[{\"action\":\"{{action1}}\",\"title\":\"{{actionTitle1}}\",\"icon\":\"sfsymbols:bell\"},{\"action\":\"{{action2}}\",\"title\":\"{{actionTitle2}}\"}],\"ttl\":0,\"priority\":\"high\"}}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1810,"y":220,"wires":[[]]},{"id":"d236f921f6fbec5f","type":"api-current-state","z":"04b5da70ea694834","name":"Is TV on?","server":"8a644e13.f9644","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"media_player.lg_webos_tv","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":1560,"y":540,"wires":[["0267012b1f03bf20"],[]]},{"id":"0267012b1f03bf20","type":"api-call-service","z":"04b5da70ea694834","name":"","server":"8a644e13.f9644","version":5,"debugenabled":false,"domain":"notify","service":"television","areaId":[],"deviceId":[],"entityId":[],"data":"{\"message\":\"Vaccum needs emptying\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1720,"y":540,"wires":[[]]},{"id":"ae9cc91a5b6518c8","type":"change","z":"04b5da70ea694834","name":"Set msg","rules":[{"t":"set","p":"message","pt":"msg","to":"Vaccum needs emptying.","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1560,"y":500,"wires":[["89a513f3750d920c"]]},{"id":"89a513f3750d920c","type":"api-call-service","z":"04b5da70ea694834","name":"notify.","server":"8a644e13.f9644","version":5,"debugenabled":false,"domain":"notify","service":"mobile_app_loz21fe","areaId":[],"deviceId":[],"entityId":[],"data":"{\"message\":\"{{message}}\",\"data\":{\"actions\":[{\"action\":\"{{action1}}\",\"title\":\"{{actionTitle1}}\",\"icon\":\"sfsymbols:bell\"},{\"action\":\"{{action2}}\",\"title\":\"{{actionTitle2}}\"}],\"ttl\":0,\"priority\":\"high\"}}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1690,"y":500,"wires":[[]]},{"id":"351276abca7c4ba2","type":"api-call-service","z":"04b5da70ea694834","name":"Go to bin","server":"8a644e13.f9644","version":5,"debugenabled":false,"domain":"xiaomi_miio","service":"vacuum_goto","areaId":[],"deviceId":["3ab0d503fda3b4b41f5fc06dcfadc1ba"],"entityId":["vacuum.roborock_s6_maxv"],"data":"{\"x_coord\":\"34634\",\"y_coord\":\"28777\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1380,"y":540,"wires":[["ae9cc91a5b6518c8","d236f921f6fbec5f","31f81969e12bccbb"]]},{"id":"f7618b52c42f6419","type":"switch","z":"04b5da70ea694834","name":"","property":"payload","propertyType":"msg","rules":[{"t":"gte","v":"1","vt":"str"},{"t":"eq","v":"0","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":450,"y":700,"wires":[["7160ec99feea984e"],["cf9820c2c6eec420"]]},{"id":"6d408ce7c2f042ea","type":"ha-get-entities","z":"04b5da70ea694834","name":"How many people home?","server":"8a644e13.f9644","version":0,"rules":[{"property":"entity_id","logic":"starts_with","value":"person","valueType":"str"},{"property":"state","logic":"is","value":"home","valueType":"str"}],"output_type":"count","output_empty_results":false,"output_location_type":"msg","output_location":"payload","output_results_count":1,"x":250,"y":700,"wires":[["f7618b52c42f6419"]]},{"id":"cfd35ffce5862f2c","type":"api-call-service","z":"04b5da70ea694834","name":"Go to bin","server":"8a644e13.f9644","version":5,"debugenabled":false,"domain":"xiaomi_miio","service":"vacuum_goto","areaId":[],"deviceId":["3ab0d503fda3b4b41f5fc06dcfadc1ba"],"entityId":["vacuum.roborock_s6_maxv"],"data":"{\"x_coord\":\"34634\",\"y_coord\":\"28777\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1400,"y":700,"wires":[["4e85ffba5a31a649"]]},{"id":"cf9820c2c6eec420","type":"delay","z":"04b5da70ea694834","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"minutes","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":260,"y":800,"wires":[["6d408ce7c2f042ea"]]},{"id":"7160ec99feea984e","type":"time-range-switch","z":"04b5da70ea694834","name":"","lat":"","lon":"","startTime":"07:00","endTime":"20:00","startOffset":0,"endOffset":0,"x":640,"y":700,"wires":[["42dc51c86da4a329"],["febfbe98250e14a5"]]},{"id":"febfbe98250e14a5","type":"ha-wait-until","z":"04b5da70ea694834","name":"Motion in living room","server":"8a644e13.f9644","version":2,"outputs":1,"entityId":"binary_sensor.zone_zone_02_open","entityIdFilterType":"exact","property":"state","comparator":"is","value":"on","valueType":"str","timeout":"0","timeoutType":"num","timeoutUnits":"seconds","checkCurrentState":true,"blockInputOverrides":true,"outputProperties":[],"entityLocation":"data","entityLocationType":"none","x":340,"y":960,"wires":[["4bd1e8d33daf18b6"]]},{"id":"4bd1e8d33daf18b6","type":"time-range-switch","z":"04b5da70ea694834","name":"","lat":"","lon":"","startTime":"05:00","endTime":"12:00","startOffset":0,"endOffset":0,"x":560,"y":900,"wires":[["0d45455f42b2a985"],["febfbe98250e14a5"]]},{"id":"394f9fbe43ed3603","type":"api-call-service","z":"04b5da70ea694834","name":"Go to bin","server":"8a644e13.f9644","version":5,"debugenabled":false,"domain":"xiaomi_miio","service":"vacuum_goto","areaId":[],"deviceId":["3ab0d503fda3b4b41f5fc06dcfadc1ba"],"entityId":["vacuum.roborock_s6_maxv"],"data":"{\"x_coord\":\"34634\",\"y_coord\":\"28777\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1240,"y":920,"wires":[["ed5e0a531bd9148c"]]},{"id":"9a6ac0fb60ce699b","type":"ha-wait-until","z":"04b5da70ea694834","name":"Not returned after 3 hrs?","server":"8a644e13.f9644","version":2,"outputs":2,"entityId":"vacuum.roborock_s6_maxv","entityIdFilterType":"exact","property":"state","comparator":"is","value":"returning","valueType":"str","timeout":"3","timeoutType":"num","timeoutUnits":"hours","checkCurrentState":true,"blockInputOverrides":true,"outputProperties":[],"entityLocation":"data","entityLocationType":"none","x":1570,"y":360,"wires":[[],["df4147cd7693e4d3"]]},{"id":"df4147cd7693e4d3","type":"api-call-service","z":"04b5da70ea694834","name":"Return to base","server":"8a644e13.f9644","version":5,"debugenabled":false,"domain":"vacuum","service":"return_to_base","areaId":[],"deviceId":["3ab0d503fda3b4b41f5fc06dcfadc1ba"],"entityId":["vacuum.roborock_s6_maxv"],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1820,"y":360,"wires":[[]]},{"id":"7713901732acd9aa","type":"api-call-service","z":"04b5da70ea694834","name":"Return to base","server":"8a644e13.f9644","version":5,"debugenabled":false,"domain":"vacuum","service":"return_to_base","areaId":[],"deviceId":["3ab0d503fda3b4b41f5fc06dcfadc1ba"],"entityId":["vacuum.roborock_s6_maxv"],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1880,"y":600,"wires":[[]]},{"id":"31f81969e12bccbb","type":"ha-wait-until","z":"04b5da70ea694834","name":"Not returned after 3 hrs?","server":"8a644e13.f9644","version":2,"outputs":2,"entityId":"vacuum.roborock_s6_maxv","entityIdFilterType":"exact","property":"state","comparator":"is","value":"returning","valueType":"str","timeout":"3","timeoutType":"num","timeoutUnits":"hours","checkCurrentState":true,"blockInputOverrides":true,"outputProperties":[],"entityLocation":"data","entityLocationType":"none","x":1630,"y":600,"wires":[[],["7713901732acd9aa"]]},{"id":"3e97b3ae0de58085","type":"api-call-service","z":"04b5da70ea694834","name":"Return to base","server":"8a644e13.f9644","version":5,"debugenabled":false,"domain":"vacuum","service":"return_to_base","areaId":[],"deviceId":["3ab0d503fda3b4b41f5fc06dcfadc1ba"],"entityId":["vacuum.roborock_s6_maxv"],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1840,"y":700,"wires":[[]]},{"id":"4e85ffba5a31a649","type":"ha-wait-until","z":"04b5da70ea694834","name":"Not returned after 3 hrs?","server":"8a644e13.f9644","version":2,"outputs":2,"entityId":"vacuum.roborock_s6_maxv","entityIdFilterType":"exact","property":"state","comparator":"is","value":"returning","valueType":"str","timeout":"3","timeoutType":"num","timeoutUnits":"hours","checkCurrentState":true,"blockInputOverrides":true,"outputProperties":[],"entityLocation":"data","entityLocationType":"none","x":1610,"y":700,"wires":[[],["3e97b3ae0de58085"]]},{"id":"74197e14982a878d","type":"api-call-service","z":"04b5da70ea694834","name":"Return to base","server":"8a644e13.f9644","version":5,"debugenabled":false,"domain":"vacuum","service":"return_to_base","areaId":[],"deviceId":["3ab0d503fda3b4b41f5fc06dcfadc1ba"],"entityId":["vacuum.roborock_s6_maxv"],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1660,"y":920,"wires":[["bbecf4f263c962a1"]]},{"id":"ed5e0a531bd9148c","type":"ha-wait-until","z":"04b5da70ea694834","name":"Not returned after 3 hrs?","server":"8a644e13.f9644","version":2,"outputs":2,"entityId":"vacuum.roborock_s6_maxv","entityIdFilterType":"exact","property":"state","comparator":"is","value":"returning","valueType":"str","timeout":"3","timeoutType":"num","timeoutUnits":"hours","checkCurrentState":true,"blockInputOverrides":true,"outputProperties":[],"entityLocation":"data","entityLocationType":"none","x":1430,"y":920,"wires":[[],["74197e14982a878d"]]},{"id":"bbecf4f263c962a1","type":"change","z":"04b5da70ea694834","name":"Set msg","rules":[{"t":"set","p":"message","pt":"msg","to":"Vacuum is sick of your bullshit. Empty it when you get the chance.","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1640,"y":1040,"wires":[["1b0a032939757419","65896a1ab0e09928"]]},{"id":"1b0a032939757419","type":"api-call-service","z":"04b5da70ea694834","name":"notify.","server":"8a644e13.f9644","version":5,"debugenabled":false,"domain":"notify","service":"mobile_app_oneplus_6t_bbe","areaId":[],"deviceId":[],"entityId":[],"data":"{\"message\":\"{{message}}\",\"data\":{\"actions\":[{\"action\":\"{{action1}}\",\"title\":\"{{actionTitle1}}\",\"icon\":\"sfsymbols:bell\"},{\"action\":\"{{action2}}\",\"title\":\"{{actionTitle2}}\"}],\"ttl\":0,\"priority\":\"high\"}}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1810,"y":1000,"wires":[[]]},{"id":"65896a1ab0e09928","type":"api-call-service","z":"04b5da70ea694834","name":"notify","server":"8a644e13.f9644","version":5,"debugenabled":false,"domain":"notify","service":"mobile_app_loz21fe","areaId":[],"deviceId":[],"entityId":[],"data":"{\"message\":\"{{message}}\",\"data\":{\"actions\":[{\"action\":\"{{action1}}\",\"title\":\"{{actionTitle1}}\",\"icon\":\"sfsymbols:bell\"},{\"action\":\"{{action2}}\",\"title\":\"{{actionTitle2}}\"}],\"ttl\":0,\"priority\":\"high\"}}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1810,"y":1080,"wires":[[]]},{"id":"692f211c01a3b3ac","type":"function","z":"04b5da70ea694834","name":"Get batt lvl attr","func":"msg.payload = msg.data.attributes.battery_level;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1180,"y":420,"wires":[["033ad1d9c7271ecf"]]},{"id":"647c6dca4b14988a","type":"api-current-state","z":"04b5da70ea694834","name":"current_state","server":"8a644e13.f9644","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"vacuum.roborock_s6_maxv","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":1000,"y":420,"wires":[["692f211c01a3b3ac"]]},{"id":"033ad1d9c7271ecf","type":"switch","z":"04b5da70ea694834","name":">=20","property":"payload","propertyType":"msg","rules":[{"t":"gte","v":"20","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":1330,"y":420,"wires":[["db4ab86588fc2b9a"]]},{"id":"b2d5dd5fcc931589","type":"function","z":"04b5da70ea694834","name":"Get batt lvl attr","func":"msg.payload = msg.data.attributes.battery_level;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1080,"y":540,"wires":[["8f0f3930106140e7"]]},{"id":"42e754e83e5cfb40","type":"api-current-state","z":"04b5da70ea694834","name":"current_state","server":"8a644e13.f9644","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"vacuum.roborock_s6_maxv","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":900,"y":540,"wires":[["b2d5dd5fcc931589"]]},{"id":"8f0f3930106140e7","type":"switch","z":"04b5da70ea694834","name":">=20","property":"payload","propertyType":"msg","rules":[{"t":"gte","v":"20","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":1230,"y":540,"wires":[["351276abca7c4ba2"]]},{"id":"4a84b2518d1f8dde","type":"function","z":"04b5da70ea694834","name":"Get batt lvl attr","func":"msg.payload = msg.data.attributes.battery_level;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1080,"y":700,"wires":[["ebd88eccdc3904dc"]]},{"id":"42dc51c86da4a329","type":"api-current-state","z":"04b5da70ea694834","name":"current_state","server":"8a644e13.f9644","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"vacuum.roborock_s6_maxv","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":900,"y":700,"wires":[["4a84b2518d1f8dde"]]},{"id":"ebd88eccdc3904dc","type":"switch","z":"04b5da70ea694834","name":">=20","property":"payload","propertyType":"msg","rules":[{"t":"gte","v":"20","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":1230,"y":700,"wires":[["cfd35ffce5862f2c"]]},{"id":"edfbf7524756338a","type":"function","z":"04b5da70ea694834","name":"Get batt lvl attr","func":"msg.payload = msg.data.attributes.battery_level;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":960,"y":920,"wires":[["dc65189d466d46e1"]]},{"id":"0d45455f42b2a985","type":"api-current-state","z":"04b5da70ea694834","name":"current_state","server":"8a644e13.f9644","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"vacuum.roborock_s6_maxv","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":780,"y":920,"wires":[["edfbf7524756338a"]]},{"id":"dc65189d466d46e1","type":"switch","z":"04b5da70ea694834","name":">=20","property":"payload","propertyType":"msg","rules":[{"t":"gte","v":"20","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":1110,"y":920,"wires":[["394f9fbe43ed3603"]]},{"id":"64aa2eae48eef1d0","type":"inject","z":"04b5da70ea694834","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":160,"y":120,"wires":[["916c267050e49453"]]},{"id":"26839cd6e58b013b","type":"inject","z":"04b5da70ea694834","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":160,"y":500,"wires":[["3ec8e251ad25cb40"]]},{"id":"3e1508894b84b3f3","type":"debug","z":"04b5da70ea694834","name":"debug 3","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":840,"y":240,"wires":[]},{"id":"e7ee9f587c2c2f1f","type":"nooperation","z":"04b5da70ea694834","name":"DO NOTHING","x":1200,"y":80,"wires":[[]]},{"id":"062088199e55c657","type":"time-range-switch","z":"04b5da70ea694834","name":"","lat":"","lon":"","startTime":"07:00","endTime":"20:00","startOffset":0,"endOffset":0,"x":820,"y":420,"wires":[["647c6dca4b14988a"],["febfbe98250e14a5"]]},{"id":"644632fe2380b5ee","type":"time-range-switch","z":"04b5da70ea694834","name":"","lat":"","lon":"","startTime":"07:00","endTime":"20:00","startOffset":0,"endOffset":0,"x":720,"y":540,"wires":[["42e754e83e5cfb40"],["febfbe98250e14a5"]]},{"id":"8a644e13.f9644","type":"server","name":"Home Assistant","addon":true}]
2 Likes

Hey guys,

I’m now encountering a problem with my automation. The vacuum is correctly heading to the trash can when area cleaned has increased by X meters. I empty the dustbin, and press the home button on the vacuum itself. It then immediately re-triggers the automation, and parks itself back at the trashcan. Essentially sending it to dock is ending a clean…

Is there a simple way around this that I’m not seeing?

Got it! I’ve used a trigger node to check if total clean count has increased by 1 when the vacuum finishes cleaning. If it has, then the vacuum has literally finished a clean, and it parks at the trash can. When I press the home button, the total clean count has not increased by one, therefor the vacuum returns to dock correctly.