Skip to content

Commit

Permalink
Add Not Ready status, Remove Cleaning Timestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeremy Willans authored and Jeremy Willans committed Sep 7, 2020
1 parent 897d074 commit 235f04b
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions vacuum.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ sensor:
{{ state_attr('sensor.rest980', 'name') }}
value_template: >-
{% if state_attr('sensor.rest980', 'cleanMissionStatus')['cycle'] == 'none' and state_attr('sensor.rest980', 'cleanMissionStatus')['notReady'] == 39 %}
Pending
Pending
{% elif state_attr('sensor.rest980', 'cleanMissionStatus')['notReady'] > 0 %}
Not Ready
{% else %}
{% set mapper = {
'clean' : 'Clean',
Expand All @@ -46,6 +48,13 @@ sensor:
{% endif %}
icon_template: mdi:robot-vacuum
attribute_templates:
message: >-
{% set mapper = {
2 : 'Uneven Ground',
15 : 'Low Battery',
39 : 'Pending' } %}
{% set state = state_attr('sensor.rest980', 'cleanMissionStatus')['notReady'] %}
{{ mapper[state] if state in mapper else 'n-a' }}
battery: >-
{{ state_attr('sensor.rest980', 'batPct') }} %
phase: >-
Expand Down Expand Up @@ -212,9 +221,9 @@ sensor:
{% endif %}
maint_due: >-
{% if is_state('input_boolean.vacuum_maint_due', 'on') %}
true
True
{% else %}
false
False
{% endif %}
# pmap0_id I7/S9 Models
pmap0_id: >-
Expand All @@ -223,13 +232,6 @@ sensor:
{% else %}
n-a
{% endif %}
# pmap0_timestamp I7/S9 Models
pmap0_timestamp: >-
{% if state_attr('sensor.rest980', 'pmaps')[0] is defined %}
{{ state_attr('sensor.rest980', 'pmaps')[0] | regex_findall_index("{'[\w\-]+': '(\w+)'}") }}
{% else %}
n-a
{% endif %}
vacuum_location:
friendly_name_template: >-
{{ state_attr('sensor.rest980', 'name') }} Location
Expand Down Expand Up @@ -396,8 +398,7 @@ automation:
"regions": [{% for id in rooms %}
{% set room = 'input_text.vacuum_clean_' + id %} {{ states(room) | string }} {%- if not loop.last %},{%- endif %}
{%- endfor %}
],
"user_pmapv_id": "{{ state_attr('sensor.vacuum', 'pmap0_timestamp') | string }}"
]
}
- service: input_text.set_value
data:
Expand Down

0 comments on commit 235f04b

Please sign in to comment.