my sensor.recycling gets the follownig state: Next Collection Day Friday, 16 August 2019
I’d like to strip all the text left of the comma, so that the final result will be just 16 August 2019
Using the Template editor I was able to get rid of Next Collection Day with this template {{ states.sensor.recycling.state|replace('Next Collection Day','')}}, but I’d like to get rid of the comma and the weekday as well.
Could anyone help me out with this?
Thanks
Now I have another problem.
As soon as there’s only one day until the thrash is being collected, the date changes to “Tomorrow” the day before collection, respectively “Today”.
I just solved the problem with the help of @skalavala and @Vasiley (I hope I’m tagging the right people) - thanks guys again.
There was a small issue because my scraper scraped some invisible spaces and newline characters as well.
The unshaped result is this
{% if 'Tomorrow' in states('sensor.rubbish') %}
Rubbish Tomorrow
{% else %}
Rubbish Not Tomorrow
{% endif %}