Skip to content

Instantly share code, notes, and snippets.

@ironicbadger
Created March 29, 2020 03:18
Show Gist options
  • Select an option

  • Save ironicbadger/1a4504b3a23d9952cec0c61127b6ac4f to your computer and use it in GitHub Desktop.

Select an option

Save ironicbadger/1a4504b3a23d9952cec0c61127b6ac4f to your computer and use it in GitHub Desktop.

Revisions

  1. ironicbadger created this gist Mar 29, 2020.
    34 changes: 34 additions & 0 deletions snippet-lovelace-ui.yaml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,34 @@
    cards:
    - content: >-
    # Quarantine-o-meter
    The gauge meters display the amount of time spend at home in the last 7
    days. Where Alex left the house (on average) {{
    (states("sensor.quarantine_meter_alex_times_left")|int / 7) | round(1) }}
    times per day and Cat {{
    (states("sensor.quarantine_meter_cat_times_left")|int / 7) | round(1) }}
    times per day.
    type: markdown
    - cards:
    - entity: sensor.quarantine_meter_alex
    max: 100
    min: 0
    name: Alex Home %
    severity:
    green: 95
    red: 0
    yellow: 80
    theme: Backend-selected
    type: gauge
    - entity: sensor.quarantine_meter_cat
    max: 100
    min: 0
    name: Cat Home %
    severity:
    green: 95
    red: 0
    yellow: 80
    theme: Backend-selected
    type: gauge
    type: horizontal-stack
    type: vertical-stack
    33 changes: 33 additions & 0 deletions snippet-sensors.yaml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,33 @@
    ## covid
    - platform: history_stats
    name: Quarantine meter Alex
    entity_id: person.alex
    state: "home"
    type: ratio
    duration:
    days: 7
    end: "{{ now() }}"
    - platform: history_stats
    name: Quarantine meter Cat
    entity_id: person.cat
    state: "home"
    type: ratio
    duration:
    days: 7
    end: "{{ now() }}"
    - platform: history_stats
    name: Quarantine meter Alex times left
    entity_id: person.alex
    state: "home"
    type: count
    duration:
    days: 7
    end: "{{ now() }}"
    - platform: history_stats
    name: Quarantine meter Cat times left
    entity_id: person.cat
    state: "home"
    type: count
    duration:
    days: 7
    end: "{{ now() }}"