Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # KITCHEN
- - binary_sensor:
- - name: "Kitchen Cleaning"
- state: "{{this.attributes.cleaning_need}}"
- attributes:
- room_id: "14"
- timestamp: "1677124229"
- name: "keittiö"
- days_since: >
- {% set today = now().date() %}
- {% set last_cleaned = this.attributes.timestamp %}
- {% set days_since = (today - as_datetime(last_cleaned).date()).days %}
- cleaning_need: >
- {{this.attributes.days_since >= 3}}
Add Comment
Please, Sign In to add comment