bruxy70 / Garbage-Collection

🗑 Custom Home Assistant sensor for scheduling garbage collection (or other regularly re-occurring events - weekly on given days, semi-weekly or monthly)
MIT License
382 stars 90 forks source link

How to configure different weekly collections #377

Closed swin66 closed 2 years ago

swin66 commented 2 years ago

Before you submit a new bug report, please check that

Write your question here

Can this cater for weekly collections that alternate each week? e.g. our collections are weekly, but alternate between recycled (pink bags) and non-cycled (black bags). So, we get a pink collection every 2 weeks, and a black bag collection every 2 weeks. i.e. week 1 - pink, 2 - black, 3 - pink, 4 - black etc etc And I'd like the UI to show an appropriately coloured bag icon. Thanks

bruxy70 commented 2 years ago

Yes. Configure 2 integration entities, one for pink, one for black. Both with collection every n days, with period 14 days, with different first date (or you can do even and odd weeks, but these are based on the week number, that resets each year).

swin66 commented 2 years ago

Thanks for this. I set up 2 entities as described and that's fine. Although, I have a small problem that if I set the entities to verbose mode, no text is shown. I left the defaults for the formatting etc. However, ideally I'd like one UI icon to show either a pink bag icon or black one depending on what's coming next. How would I achieve that?

bruxy70 commented 2 years ago

You could create a group garbage_collection entity, but it would combine the two and will not differentiate the colors. The integration considers one entity as one garbage type, it cannot handle different types in one entity. You can always create a template sensor and combine the two, if you need that desperately. Or you can use conditional cards in Lovelace, and show either the ping of black icon, depending on which one comes first. https://www.home-assistant.io/lovelace/conditional/