Hi.
I’m trying to split the output from a sensor I’ve got.
The restful_api part is working and it outputs “Time until the next NLSS: 0 hours, 5 minutes, 4 seconds”.
I would like to only display the time, vut whenever I try to split the output, it either goes blank or says unknown.
It works when I write do it in the template developer tool.
sensor:
- platform: rest
name: 'NLSS'
resource: https://whenisnlss.com/when.php
- platform: template
sensors:
nlss:
friendly_name: 'NLSS'
value_template: '{{ states.sensor.nlss.state.split(", ")[0]|replace("Time until the next NLSS:", " ") }} {{ states.sensor.nlss.state.split(", ")[1] }}'
Thanks in advance!