olibos/HomeAssistant-RecycleApp

How to use the date format relatively?

Closed this issue · 5 comments

Hello,

First of all, thanks for this integration, as someone with next to no coding knowledge this saved my life, inputting this data into home assistant is very nice.

You mention on the github page that it is possible to format the date relatively, to have the PMD sensor display: "in 2 days", instead of date/month/year. How do I do this? I've looked into the python date/time formatting but am at a complete loss, and also cannot find anything about the innate HA time templates you mentioned..

I tried a workaround creating template sensors which do the correct thing (see example), but in this case I lose the nice looking custom icons, which I definitely want to use, as otherwise I'd have to come up with custom icons somehow.

Example of my current format on the first row, and using template sensors on the second row, I'd like the timestamps combined with the icons:
image

Thanks in advance!
Kind regards,
Joris

Hello @Devairen ,

Thank you for your feedback ❤️.

To show relative dates, you may type "TIMESTAMP" in the date format field.
Sample:

timestamp-demo.mp4

Does it work for you?

Hello Olivier,

Sadly not, I figured this is what you meant initially, but Home Assistant doesn't seem to process this timestamp date correctly into relative time..

https://jmp.sh/pBBjw5tl

I've deleted and reconfigured just to make sure, and the same behavior stays.

In the sensor details, it's the full date even if on the dashboard it should display the relative date.
image

It's maybe linked to the custom card you use.
I've tried with buit-in "entities" and "tile" cards and both shows relative dates
image

Which card do you use?

Hello Olivier,

You're absolutely right, it's the cards that are messing me up! If I throw it in a standard 'entities' card or a mushroom card it shows correctly:

image

This specific card is a custom bubble card (button type, specifically).

Thanks for your support!
Cheers,
Joris

Thanks for the feedback