sensor:
- platform: command_line
name: Sonos Sleep Timer remains
command: >
curl -X POST http://10.0.3.33:1400/MediaRenderer/AVTransport/Control \
-H 'Content-Type: text/xml; charset=utf-8' \
-H 'SOAPAction: "urn:schemas-upnp-org:service:AVTransport:1#GetRemainingSleepTimerDuration"' \
--data '
0
'
value_template: >
{% set result = value | regex_findall('([\d:]+)') %}
{% if result %}
{{ result[0] }}
{% else %}
'00:00:00'
{% endif %}
scan_interval: 60
- platform: command_line
name: Simple Test Sensor
command: "echo 'Test success'"
scan_interval: 10