Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 95925

Value template, modify date format from restful sensor

$
0
0

@samtwilliams wrote:

Hi All,

I’ve got a sensor pulling using restful, the value returned is a date format as follows
“2020-01-01”

I want to convert it to “01/01/2020” style but can’t get the custom date format to work, any ideas? It just returns “none”

{% set date = states('sensor.grey_bin') | regex_replace(find='"', replace='', ignorecase=False) %}
{{ as_timestamp(date) | timestamp_custom("%d/%m/%y", True) }}

n.b. the data comes back with double quotes hence the strip.

Posts: 18

Participants: 4

Read full topic


Viewing all articles
Browse latest Browse all 95925

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>