JS1
1
In HA this used to work:
'curl "http://192.168.1.30:11000/Status" 2>&1 | grep -oPm1 "(?<=<title2>)[^<]+"'
But now I’ve moved my configuration over to HASS.IO I get the following error:
ERROR (SyncWorker_5) [homeassistant.components.sensor.command_line] Command failed: curl "http://192.168.1.30:11000/Status" 2>&1 | grep -oPm1 "(?<=<title2>)[^<]+"
Can anybody help me work out what’s wrong with my code please?
Klex1404
(Klex1404)
2
In resinos one of the grep options is not supported.
I found a workaround.
curl "http://xxx.xxx.x.xxx/real_time_data.xml" 2>&1 | grep -E -m1 -o "<v-grid>(.*)</v-grid>" | sed -e "s,.*<v-grid>\([^<]*\)</v-grid>.*,\1,g"
This gets the v-grid value from the XML.
2 Likes
JS1
3
Thank you so much, that worked perfectly. You are a genius!
1 Like