|
|
|
@ -10,22 +10,34 @@
|
|
|
|
automation:
|
|
|
|
automation:
|
|
|
|
- alias: 'Vacuum -Tweet'
|
|
|
|
- alias: 'Vacuum -Tweet'
|
|
|
|
id: 2346efcd-e8a8-4e86-b5b6-43e54a72a95f
|
|
|
|
id: 2346efcd-e8a8-4e86-b5b6-43e54a72a95f
|
|
|
|
|
|
|
|
mode: single
|
|
|
|
trigger:
|
|
|
|
trigger:
|
|
|
|
- platform: state
|
|
|
|
- platform: state
|
|
|
|
entity_id: vacuum.carlo_neato
|
|
|
|
entity_id: vacuum.carlo_neato
|
|
|
|
to: 'cleaning'
|
|
|
|
to: 'cleaning'
|
|
|
|
|
|
|
|
|
|
|
|
condition:
|
|
|
|
condition:
|
|
|
|
- condition: template
|
|
|
|
|
|
|
|
value_template: "{{ states.vacuum.carlo_neato.attributes.battery_level |int < 20 }}"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- condition: template
|
|
|
|
- condition: numeric_state
|
|
|
|
value_template: >
|
|
|
|
entity_id: vacuum.carlo_neato
|
|
|
|
{%- if states.automation.vacuum_tweet.attributes.last_triggered -%}
|
|
|
|
attribute: battery_level
|
|
|
|
{{ (as_timestamp(now()) - as_timestamp(states.automation.vacuum_tweet.attributes.last_triggered)) > 15000 }}
|
|
|
|
below: 20
|
|
|
|
{%- else -%}
|
|
|
|
|
|
|
|
true
|
|
|
|
- condition: numeric_state
|
|
|
|
{%- endif -%}
|
|
|
|
entity_id: automation.vacuum_tweet
|
|
|
|
|
|
|
|
attribute: last_triggered
|
|
|
|
|
|
|
|
above: 15000
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# - condition: template
|
|
|
|
|
|
|
|
# value_template: "{{ states.vacuum.carlo_neato.attributes.battery_level |int < 20 }}"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# - condition: template
|
|
|
|
|
|
|
|
# value_template: >
|
|
|
|
|
|
|
|
# {%- if states.automation.vacuum_tweet.attributes.last_triggered -%}
|
|
|
|
|
|
|
|
# {{ (as_timestamp(now()) - as_timestamp(states.automation.vacuum_tweet.attributes.last_triggered)) > 15000 }}
|
|
|
|
|
|
|
|
# {%- else -%}
|
|
|
|
|
|
|
|
# true
|
|
|
|
|
|
|
|
# {%- endif -%}
|
|
|
|
|
|
|
|
|
|
|
|
action:
|
|
|
|
action:
|
|
|
|
- service: script.tweet_engine_image
|
|
|
|
- service: script.tweet_engine_image
|
|
|
|
|