#im using content div div div bin dates

1 messages · Page 1 of 1 (latest)

grave gale
#

Using
{% set text = states.sensor.blackbin.state %}
{{ text.split(', ')[-1].strip() if ',' in text else text.strip() }}
in the dev tools template editor give me the date portion as a string, not sure how to convert that to a date for use in the HA calendar

rotund prism
grave gale
#

yes, thats what Im struggling with - i need to put this in a value template on the sensor, so Im struggling with storing the output of the text.split as a value so I can then convert it.
there are 3 steps, the scrape pulls back a long sting, with the date after a comma as a string, then I need to split this string to grab the date portion, then convert it to a date value