From 30549676d606130ab8b74b4985811e4cc0d48a74 Mon Sep 17 00:00:00 2001 From: jwillans Date: Mon, 7 Dec 2020 09:50:23 +1000 Subject: [PATCH] Add support for clean zones --- FAQ.md | 6 +++--- README.md | 2 +- lovelace.yaml | 1 + secrets.yaml | 21 +++++++++++---------- vacuum.yaml | 15 ++++++++++++--- 5 files changed, 28 insertions(+), 17 deletions(-) diff --git a/FAQ.md b/FAQ.md index dabcb98..6aee370 100644 --- a/FAQ.md +++ b/FAQ.md @@ -26,9 +26,9 @@ Make sure you have accurately copied your regions into the secrets.yaml file! Check for trailing commands or brackets as these will **break** the code ``` -vacuum_kitchen: '{"region_id": "16"}' <-- GOOD -vacuum_kitchen: '{"region_id": "16"},' <-- BAD - EXTRA COMMA -vacuum_kitchen: '{"region_id": "16"}}' <-- BAD - EXTRA BRACKET +vacuum_kitchen: '{"region_id": "16", "type": "rid"}' <-- GOOD +vacuum_kitchen: '{"region_id": "16", "type": "rid",}' <-- BAD - EXTRA COMMA +vacuum_kitchen: '{"region_id": "16", "type": "rid"}}' <-- BAD - EXTRA BRACKET ``` If the regions all appear correct, then the next culprit is that the is a mis-match between the map_id values for rest980 and the iRobot App. diff --git a/README.md b/README.md index 33a5f6d..1634239 100644 --- a/README.md +++ b/README.md @@ -97,7 +97,7 @@ This will create a new local addon which you can install * Initiate a Clean Rooms clean from the iRobot App, ensuring you note the order in which you select the rooms (room names are no longer shown in the api) * Navigate to ```http://:/api/local/info/state``` * Look for the "lastCommand" section and copy down the following info, noting the order as this references what you selected in the app. - - regions + - regions (type "rid" is Room, type "zid" is Zone) **Note:** If you recreate your map, you will need to repeat this process as the region_id's will most likely change! diff --git a/lovelace.yaml b/lovelace.yaml index 910dbde..c2df67a 100644 --- a/lovelace.yaml +++ b/lovelace.yaml @@ -13,6 +13,7 @@ cards: - input_boolean.vacuum_clean_master_ensuite - input_boolean.vacuum_clean_master_bedroom - input_boolean.vacuum_clean_table + - input_boolean.vacuum_clean_zone_fridge - entity: automation.vacuum_clean_rooms lock: enabled: | diff --git a/secrets.yaml b/secrets.yaml index 76170fb..cbe6ea4 100644 --- a/secrets.yaml +++ b/secrets.yaml @@ -10,13 +10,14 @@ vacuum_notify: notify.mobile_app_xxxxxxx # You can also use a notify group here vacuum_map: http://:/image.php vacuum_log: /config/vacuum/vacuum.log vacuum_dir: /config/vacuum -vacuum_kitchen: '{"region_id": "16"}' -vacuum_entry: '{"region_id": "14"}' -vacuum_hall: '{"region_id": "1"}' -vacuum_living_room: '{"region_id": "15"}' -vacuum_bedroom: '{"region_id": "13"}' -vacuum_bathroom: '{"region_id": "12"}' -vacuum_wardrobe: '{"region_id": "9"}' -vacuum_master_ensuite: '{"region_id": "10"}' -vacuum_master_bedroom: '{"region_id": "11"}' -vacuum_table: '{"region_id": "17"}' \ No newline at end of file +vacuum_kitchen: '{"region_id": "16", "type": "rid"}' +vacuum_entry: '{"region_id": "14", "type": "rid"}' +vacuum_hall: '{"region_id": "1", "type": "rid"}' +vacuum_living_room: '{"region_id": "15", "type": "rid"}' +vacuum_bedroom: '{"region_id": "13", "type": "rid"}' +vacuum_bathroom: '{"region_id": "12", "type": "rid"}' +vacuum_wardrobe: '{"region_id": "9", "type": "rid"}' +vacuum_master_ensuite: '{"region_id": "10", "type": "rid"}' +vacuum_master_bedroom: '{"region_id": "11", "type": "rid"}' +vacuum_table: '{"region_id": "17", "type": "rid"}' +vacuum_cz_fridge: '{"region_id": "0", "type": "zid"}' \ No newline at end of file diff --git a/vacuum.yaml b/vacuum.yaml index 4a37b6c..8fc44a3 100644 --- a/vacuum.yaml +++ b/vacuum.yaml @@ -293,6 +293,9 @@ input_boolean: vacuum_clean_table: name: Table icon: mdi:room-service + vacuum_clean_zone_fridge: + name: Fridge Zone + icon: mdi:fridge vacuum_maint_due: name: Vacuum Maintenance icon: mdi:wrench @@ -354,6 +357,9 @@ input_text: vacuum_clean_table: name: Table initial: !secret vacuum_table + vacuum_clean_zone_fridge: + name: Fridge Zone + initial: !secret vacuum_cz_fridge ################################### # Group @@ -372,6 +378,7 @@ group: - input_boolean.vacuum_clean_master_ensuite - input_boolean.vacuum_clean_master_bedroom - input_boolean.vacuum_clean_table + - vacuum_clean_zone_fridge ################################### # Automation @@ -569,7 +576,7 @@ automation: 'sensor.vacuum_maint_replace_wheel' ] action: - - service_template: >- + - service: >- {% set ns = namespace(count = 0) %} {% for item in states.sensor if 'sensor.vacuum_maint' in item.entity_id and (state_attr(item.entity_id, 'timeout_timestamp') < as_timestamp(now())) %} {% set ns.count = loop.index %} @@ -596,7 +603,8 @@ automation: 'input_boolean.vacuum_clean_wardrobe', 'input_boolean.vacuum_clean_master_ensuite', 'input_boolean.vacuum_clean_master_bedroom', - 'input_boolean.vacuum_clean_table' + 'input_boolean.vacuum_clean_table', + 'input_boolean.vacuum_clean_zone_fridge' ] to: 'on' action: @@ -627,7 +635,8 @@ automation: 'input_boolean.vacuum_clean_wardrobe', 'input_boolean.vacuum_clean_master_ensuite', 'input_boolean.vacuum_clean_master_bedroom', - 'input_boolean.vacuum_clean_table' + 'input_boolean.vacuum_clean_table', + 'input_boolean.vacuum_clean_zone_fridge' ] to: 'off' action: