Antwort auf: Abfallkalender über ICS Datei

Forum Forum Schnelle Frage Abfallkalender über ICS Datei Antwort auf: Abfallkalender über ICS Datei

#1778
Avatarjayjay2178
Teilnehmer

config.yaml

<code class="language-markup-templating">#Müllkalender#
waste_collection_schedule:
  sources:
    - name: ics
      args:
        url: "https://calendar.google.com/calendar/ical/sdddo9lj0blr1mbptnncdnjl0o%40group.calendar.google.com/private-15ecb34382e202dace45ba7314a1aa5e/basic.ics"
sensor:
  - platform: waste_collection_schedule
    name: Papierabfall_date
    value_template: '{{value.date.strftime("%d.%m.%Y")}}'
    types:
      - Papiertonne
  - platform: waste_collection_schedule
    name: Papierabfall_collection
    value_template: "{{value.daysTo}}"
    types:
      - Papiertonne

  - platform: waste_collection_schedule
    name: Restmuelltonne_date
    value_template: '{{value.date.strftime("%d.%m.%Y")}}'
    types:
      - Restmüll
  - platform: waste_collection_schedule
    name: Restmuelltonne_collection
    value_template: "{{value.daysTo}}"
    types:
      - Restmüll

  - platform: waste_collection_schedule
    name: Wertstofftonne_date
    value_template: '{{value.date.strftime("%d.%m.%Y")}}'
    types:
      - Wertstoff
  - platform: waste_collection_schedule
    name: Wertstofftonne_collection
    value_template: "{{value.daysTo}}"
    types:
      - Wertstoff

  - platform: waste_collection_schedule
    name: Biotonne_date
    value_template: '{{value.date.strftime("%d.%m.%Y")}}'
    types:
      - Biotonne
  - platform: waste_collection_schedule
    name: Biotonne_collection
    value_template: "{{value.daysTo}}"
    types:
      - Biotonne

  - platform: waste_collection_schedule
    name: next_waste_collection_daysto
    details_format: upcoming
    value_template: '{{value.types|join(", ")}} in {{value.daysTo}} Tagen'

    #button-card#
  - platform: waste_collection_schedule
    name: MyButtonCardSensor
    value_template: '{{value.types|join(", ")}}|{{value.daysTo}}|{{value.date.strftime("%d.%m.%Y")}}|{{value.date.strftime("%a")}}'

Kachel

<code class="language-markup-templating">type: entities
entities:
  - entity: sensor.biotonne_date
    style: |
      :host {
        color: brown;
      }  
    icon: 'mdi:bio'
    show_state: false
    type: 'custom:multiple-entity-row'
    name: Biotonne
    secondary_info: last-changed
    entities:
      - entity: sensor.biotonne_collection
        name: Abholung in
        unit: Tage(n)
      - entity: sensor.biotonne_date
        name: Datum
  - entity: sensor.restmuelltonne_date
    style: |
      :host {
        color: grey;
      }      
    icon: 'mdi:delete-empty'
    show_state: false
    type: 'custom:multiple-entity-row'
    name: Restmüll
    secondary_info: last-changed
    entities:
      - entity: sensor.restmuelltonne_collection
        name: Abholung in
        unit: Tage(n)
      - entity: sensor.restmuelltonne_date
        name: Datum
  - entity: sensor.wertstofftonne_date
    style: |
      :host {
        color: yellow;
      }  
    icon: 'mdi:recycle'
    show_state: false
    type: 'custom:multiple-entity-row'
    name: Wertstoff
    secondary_info: last-changed
    entities:
      - entity: sensor.wertstofftonne_collection
        name: Abholung
        unit: Tage(n)
      - entity: sensor.wertstofftonne_date
        name: Datum
  - entity: sensor.papierabfall_date
    style: |
      :host {
        color: green
      }  
    icon: 'mdi:tree'
    show_state: false
    type: 'custom:multiple-entity-row'
    name: Papiertonne
    secondary_info: last-changed
    entities:
      - entity: sensor.papierabfall_collection
        name: Abholung in
        unit: Tage(n)
      - entity: sensor.papierabfall_date
        name: Datum
  - entity: sensor.mybuttoncardsensor
    type: 'custom:button-card'
    layout: icon_name_state2nd
    show_label: true
    label: |
      [[[
       var days_to = entity.state.split("|")[1]
       if (days_to == 0)
       { return "Heute" }
       else if (days_to == 1)
       { return "Morgen" }
       else
       { return "in " + days_to + " Tagen" }
      ]]]
    show_name: true
    name: |
      [[[
        return entity.state.split("|")[0]
      ]]]
    state:
      - color: red
        operator: template
        value: '[[[ return entity.state.split("|")[1] == 0 ]]]'
      - color: orange
        operator: template
        value: '[[[ return entity.state.split("|")[1] == 1 ]]]'
      - value: default

Stimmt das denn mit den Leerstellen in der Config? hab hier gelesen, das ist wichtig.

Anhänge: