Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Content is not updating with day change #21

Open
GLehnhoff opened this issue Feb 4, 2021 · 0 comments
Open

Content is not updating with day change #21

GLehnhoff opened this issue Feb 4, 2021 · 0 comments

Comments

@GLehnhoff
Copy link

GLehnhoff commented Feb 4, 2021

Hi Kolja,
acording to your documentation the calender is updated dayly at day change:

force_update int false 0 Force to update the data with given intervall (seconds). This can be useful if the calendar is very dynamic, but pointless for almost static calendars. The calendar will reload at midnight and once the (start/end) of the event is over regardless of this setting. 0 = Disabled

However, not with my setup (I do not use yet the force-update switch). See pic. Today is Feb 4, but there is still the Feb 3 entry. Here is my config:

# Mein Abfallkalender
# Die ics-Datei muss von xxx runter geladen werden und ist nur ein halbes Jahr gültig.
# Doku: https://github.com/KoljaWindeler/ics#manual-configuration
sensor:
  # Erster Termin
  - platform: ics
    name: "Nächste Leerung"
    url: file:///config/local/abfallkalender/Abfallkalender_2021.ics
    id: 1
    icon: "mdi:trash-can-outline"
    n_skip: 0
    description_in_state: true    
    show_remaining: false
    show_ongoing: true
    timeformat: "%d.%m.%y:"

  # Zweiter Termin
  - platform: ics
    name: "Dann"
    url: file:///config/local/abfallkalender/Abfallkalender_2021.ics
    id: 2
    icon: "mdi:trash-can-outline"
    description_in_state: true  
    show_remaining: false  
    n_skip: 1    
    show_ongoing: true
    timeformat: "%d.%m.%y:"    
    
  # Dritter Termin  
  - platform: ics
    name: "Danach"
    url: file:///config/local/abfallkalender/Abfallkalender_2021.ics
    id: 3
    icon: "mdi:trash-can-outline"
    n_skip: 2    
    description_in_state: true
    show_remaining: false
    show_ongoing: true
    timeformat: "%d.%m.%y:"  


  # Einzeilige Benachrichtigung  
  - platform: template
    sensors:
      ics_1_txt:
        # Wenn heute die Leerung ist, zeige "Heute" an, es sei denn, es gibt morgen oder übermorgen auch eine 
        # Leerung, dann zeige die morgige an.  
        # Wenn morgen eine Leerung ist, zeige die an.     
        # Wenn übermorgen eine Leerung ist, zeige die an.  
        # Ansonsten zeige die nächste Leerung an.
        # Heutige Leerungen nach 12:00 zeige an mit "Tonne reinholen".
        # Beispiel: Heute Restmüll
        value_template: >
          {% if is_state_attr("sensor.ics_1", "remaining",0) %} 
            {% if is_state_attr("sensor.ics_2", "remaining",1) %}     
              Morgen {{ states.sensor.ics_2.attributes.description}}
            {% elif is_state_attr("sensor.ics_2", "remaining",2) %}     
              Übermorgen {{ states.sensor.ics_2.attributes.description}}
            {% elif now().hour > 12 %}
               {{states.sensor.ics_1.attributes.description}}-Tonne reinholen
            {% else %}  
              Heute {{ states.sensor.ics_1.attributes.description}}  
            {% endif %}   
          {% elif is_state_attr("sensor.ics_1", "remaining",1) %} 
            Morgen {{ states.sensor.ics_1.attributes.description}}
          {% elif is_state_attr("sensor.ics_1", "remaining",2) %} 
            Übermorgen {{ states.sensor.ics_1.attributes.description}}
          {% else %} 
            In {{ states.sensor.ics_1.attributes.remaining }} Tagen {{ states.sensor.ics_1.attributes.description}}
          {% endif %}   
        friendly_name: "Nächste Leerung"

FALSE

Screenshot_20210204-000102

CORRECT

After the restart of the HA Core, I get the correct data:
Screenshot_20210204-121549

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant