Skip to content

Commit

Permalink
Add support for clean zones
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremywillans committed Dec 6, 2020
1 parent bc99493 commit 3054967
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 17 deletions.
6 changes: 3 additions & 3 deletions FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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://<ip or fqdn of docker host>:<rest980port>/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!

Expand Down
1 change: 1 addition & 0 deletions lovelace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
21 changes: 11 additions & 10 deletions secrets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@ vacuum_notify: notify.mobile_app_xxxxxxx # You can also use a notify group here
vacuum_map: http://<ip or fqdn of docker host>:<nginxphpport>/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"}'
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"}'
15 changes: 12 additions & 3 deletions vacuum.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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 %}
Expand All @@ -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:
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 3054967

Please sign in to comment.