amaximus / garbage-collection-card

Custom Lovelace card for Garbage Collection custom component
MIT License
127 stars 24 forks source link

Alert if not actioned? #79

Closed simonwicks closed 3 years ago

simonwicks commented 3 years ago

Hello there,

Not really a feature request, but more a bit of help if possible.

I've been using the garbage collection card for a number of other things as well as garbage, and finding it quite usefull because of the hide when done feature.

I'm new to Home Assistant, so still finding my way, but would there be a way to use the hide_on_click param from one of the entities to use in an automation?

Example, if I've not clicked that I've put the bin out after a certain time, then annouce it over my google devices, flashes a light etc ? I dont know if there's a better way to do this, but this it what I've currently been trying.

Any help appreciated!

Thanks,

Simon

amaximus commented 3 years ago

Hello Simon,

you cannot use frontend elements' parameters (e.g. a configuration parameter of a card) in automations.

In this specific case, the hide_on_click invokes service collect_garbage of garbage_collection custom platform that manipulates the last_collection date parameter of the sensor. You may set up an automation triggered at e.g. 10:00 to see if the collection is due today (sensor state 0, if not using verbose_state for the sensor) and compare the last_collection date with the current date and if their date (discard the time part) differ then you may announce it via your google devices, flash a light, etc.

regards, Atticus

amaximus commented 3 years ago

Hello Simon,

do you need further assistance with this tracker or it can be closed?

regards, Atticus

simonwicks commented 3 years ago

Hey Atticus

Thanks for your reply, I didnt think it would be easy :) I'll keep playing around or see if there's something else that suits my needs.

Thanks again .

Simon