Hello
i’m trying to get status of a light sending an http request to the relais like this:
http://192.168.1.50:8081/command=get?element?17
and the xml result is:
“elemento id=“17” type=“8” status=“1” currentvalue=“0” title=“Luce Tavolo” label_value=“mV” id_group=“114” currenttextvalue=”" des_group=“Cucina”/"
status=“0” mean current state is OFF
status=“1” mean current state is ON
I try something like this but won’t work:
- platform: command_line
name: Luce Tavolo
command: ‘curl -X get “http://192.168.1.50:8081/command=get?element?17” 2>&1 | grep -oPm1 “(?<=)[^<]+”’
scan_interval: 5
Any Idea?
Thanks in advance