Code Monkey home page Code Monkey logo

Comments (12)

mampfes avatar mampfes commented on May 28, 2024

The picture you are refering to, is the details view of an entity - which shows up if you click on an entity. I don't know if you can show this view directly within a lovelace card.

from hacs_waste_collection_schedule.

GLehnhoff avatar GLehnhoff commented on May 28, 2024

Ok, Steffen, thanks, got it.

First challenge:
I tried hard but I did not mange to get a Card with the information of the next three collections like the detail view (though I know how to get a list of the next three entries only with "count: 3"):

  • date - collection type
  • date - collection type
  • date - collection type

I managed to get a lot of other views, but not this one. Any hint?

Second challenge:
I have to change the entries from "HIS Restmüll, 2-wöchentliche Abfuhr" to just "Restmüll", I think I have to do that with additional templates/sensors I have to create.

Third challenge:
I am not interested in "HIS Restmüll, wöchentliche Abfuhr" so have to omit somehow these entries. I do not yet know how.

Sorry for boring you with this probably simple stuff for experts :-)

lg, gl

from hacs_waste_collection_schedule.

GLehnhoff avatar GLehnhoff commented on May 28, 2024

Well, I am speeding up. I solved the third challenge:

`waste_collection_schedule:  
  sources:  
    - name: muellmax_de  
      args:  
        service: His  
        mm_frm_str_sel: xxx  
      customize:  
        - type: HIS Restmüll, wöchentliche Abfuhr  
          show: no`

And here I probably will also solve the second challenge with "alias".

from hacs_waste_collection_schedule.

GLehnhoff avatar GLehnhoff commented on May 28, 2024

And I solved the second challenge:

waste_collection_schedule:
  sources:
    - name: muellmax_de
      args:
        service: His
        mm_frm_str_sel: xxx
      customize:
        - type: HIS Restmüll, wöchentliche Abfuhr
          show: no
        - type: HIS Restmüll, 2-wöchentliche Abfuhr
          alias: Restmüll
        - type: HIS Papier
          alias: Papier
        - type: HIS GS/Leichtverpackungen
          alias: Gelbe Tonne
        - type: HIS Biomüll
          alias: Biomüll

So for now only the first challenge is left.

from hacs_waste_collection_schedule.

mampfes avatar mampfes commented on May 28, 2024

Great to hear that you already solved most of your problems.

Regarding the first "challenge": In the end this issue can't be solved by the Waste Collection Schedule integration itself, but only in combination with a matching lovelace card.

Here are some suggestions:

If you really want to see the next (3) upcoming events, regardless of the waste type, you could use the https://github.com/thomasloven/lovelace-more-info-card to display to content of the details view. This card can be easily installed via HACS.

If you instead want to see the upcoming events of 3 dedicated waste types (like Restmuell + Papier + Gelber Sack) you could setup 3 discrete sensors - 1 per waste type - and use the "Entities" card to display the entities in one frame.

from hacs_waste_collection_schedule.

GLehnhoff avatar GLehnhoff commented on May 28, 2024

Thanks, Steffen, I have done both. And just in case it is display in "...in 1 days" rep. "...in 0 days", which I do not know yet but assume, I have a solution for that also which shows "tomorrow", resp. "today".

I am speeding up.

PS: A few more examples in your description would have make my life a bit easier. If you would like me to deliver one, see below (I can even change German wording to English).

from hacs_waste_collection_schedule.

GLehnhoff avatar GLehnhoff commented on May 28, 2024
#--------------------------
# Müllabfuhr His
# https://github.com/mampfes/hacs_waste_collection_schedule
    
# Nächste Leerung    
  - platform: waste_collection_schedule
    name: Nächste Leerung
    details_format: upcoming
    value_template: '{{value.types|join(", ")}} in {{value.daysTo}} Tagen ({{value.date.strftime("%d.%m.%Y")}})'   
    count: 4
    
 # Nächste Biomüll-Leerung   
  - platform: waste_collection_schedule
    name: Biomüll
    details_format: upcoming
    value_template: 'in {{value.daysTo}} Tagen ({{value.date.strftime("%d.%m.%Y")}})'
    count: 1
    types:
      - Bio Tonne
    
 # Nächste Gelbe Tonne   
  - platform: waste_collection_schedule
    name: Gelbe Tonne
    details_format: upcoming
    value_template: 'in {{value.daysTo}} Tagen ({{value.date.strftime("%d.%m.%y")}})'
    count: 1
    types:
      - Gelbe Tonne
     
 # Nächste Papier-Leerung   
  - platform: waste_collection_schedule
    name: Papier
    details_format: upcoming
    value_template: 'in {{value.daysTo}} Tagen ({{value.date.strftime("%d.%m.%y")}})'
    count: 1
    types:
      - Papier

 # Nächster Restmüll   
  - platform: waste_collection_schedule
    name: Restmüll
    details_format: upcoming
    value_template: 'in {{value.daysTo}} Tagen ({{value.date.strftime("%d.%m.%y")}})'
    count: 1
    types:
      - Restmüll

waste_collection_schedule:
  sources:
    - name: muellmax_de
      args:
        service: His
        mm_frm_str_sel: <my-street>
      customize:
        - type: HIS Restmüll, wöchentliche Abfuhr
          show: no
        - type: HIS Restmüll, 2-wöchentliche Abfuhr
          alias: Restmüll
        - type: HIS Papier
          alias: Papier
        - type: HIS GS/Leichtverpackungen
          alias: Gelbe Tonne
        - type: HIS Biomüll
          alias: Bio Tonne

#--------------------------

This is the more-info-card I loaded from HACS:
grafik
These are lovelace standard cards:
grafik

What is left is changing the dates format in the first card to German format. Currently I do not know how to do it.

from hacs_waste_collection_schedule.

mampfes avatar mampfes commented on May 28, 2024

Hi,

you can use the following template which displays "today"/"tomorrow" instead of "in 0 days" / "in 1 days":
value_template: '{% if value.daysTo == 0 %}Today{% elif value.daysTo == 1 %}Tomorrow{% else %}in {{value.daysTo}} days{% endif %}'

Regarding your offering with the examples:
I decided to tidy the whole documentation a little bit. I would really appreciate your feedback once I have the first draft. May I ask you to review it?

from hacs_waste_collection_schedule.

mampfes avatar mampfes commented on May 28, 2024

What is left is changing the dates format in the first card to German format. Currently I do not know how to do it.

Use date_template (in addition to value_template), e.g.

date_template: '{{value.date.strftime("%d.%m.%y")}}'

from hacs_waste_collection_schedule.

GLehnhoff avatar GLehnhoff commented on May 28, 2024

May I ask you to review it?

Yes, of course. If you drop me an email to [email protected], I will reply with my real one.

from hacs_waste_collection_schedule.

GLehnhoff avatar GLehnhoff commented on May 28, 2024

date_template: '{{value.date.strftime("%d.%m.%y")}}'

Very good. Worked. All done.

from hacs_waste_collection_schedule.

GLehnhoff avatar GLehnhoff commented on May 28, 2024

Just in case, anybody is interested in, here again the modified yaml and pics:

#--------------------------
# Müllabfuhr His
# https://github.com/mampfes/hacs_waste_collection_schedule
    
# Nächste Leerung    
  - platform: waste_collection_schedule
    name: Nächste Leerung
    details_format: upcoming
    value_template: '{{value.types|join(", ")}} {% if value.daysTo == 0 %}heute{% elif value.daysTo == 1 %}morgen{% else %}in {{value.daysTo}} Tagen{% endif %} ({{value.date.strftime("%d.%m.%y")}})'   
    count: 4
    date_template: '{{value.date.strftime("%d.%m.%y")}}'
    
 # Nächste Biomüll-Leerung   
  - platform: waste_collection_schedule
    name: Biomüll
    details_format: upcoming
    value_template: '{% if value.daysTo == 0 %}heute{% elif value.daysTo == 1 %}morgen{% else %}in {{value.daysTo}} Tagen{% endif %} ({{value.date.strftime("%d.%m.%y")}})'
    count: 1
    types:
      - Bio Tonne
    
 # Nächste Gelbe Tonne   
  - platform: waste_collection_schedule
    name: Gelbe Tonne
    details_format: upcoming
    value_template: '{% if value.daysTo == 0 %}heute{% elif value.daysTo == 1 %}morgen{% else %}in {{value.daysTo}} Tagen{% endif %} ({{value.date.strftime("%d.%m.%y")}})'    
    count: 1
    types:
      - Gelbe Tonne
     
 # Nächste Papier-Leerung   
  - platform: waste_collection_schedule
    name: Papier
    details_format: upcoming
    value_template: '{% if value.daysTo == 0 %}heute{% elif value.daysTo == 1 %}morgen{% else %}in {{value.daysTo}} Tagen{% endif %} ({{value.date.strftime("%d.%m.%y")}})'    
    count: 1
    types:
      - Papier

 # Nächster Restmüll   
  - platform: waste_collection_schedule
    name: Restmüll
    details_format: upcoming
    value_template: '{% if value.daysTo == 0 %}heute{% elif value.daysTo == 1 %}morgen{% else %}in {{value.daysTo}} Tagen{% endif %} ({{value.date.strftime("%d.%m.%y")}})'    
    count: 1
    types:
      - Restmüll

waste_collection_schedule:
  sources:
    - name: muellmax_de
      args:
        service: His
        mm_frm_str_sel: <my_street>
      customize:
        - type: HIS Restmüll, wöchentliche Abfuhr
          show: no
        - type: HIS Restmüll, 2-wöchentliche Abfuhr
          alias: Restmüll
        - type: HIS Papier
          alias: Papier
        - type: HIS GS/Leichtverpackungen
          alias: Gelbe Tonne
        - type: HIS Biomüll
          alias: Bio Tonne
# Ende Müllabfuhr
#--------------------------

grafik
grafik

As this ticket is solved, I will close it.

from hacs_waste_collection_schedule.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.