Hi Folks,
I have an Audio Matrix switch which I can interrogate with a single GET request. Running the curl command gives me the following XML output.
<?xml version="1.0" encoding="UTF-8"?>50,50,50,50,50,50,50,99,50,50,50,50,50,50,50,5075,95,75,75,75,75,75,75,75,75,75,75,75,75,95,950,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,095,75,95,95,95,95,95,95,95,95,95,95,95,95,75,7520,60,21,0,0,40,0,1,20,0,0,10,20,20,60,60
I have managed to use the RESTful sensor to get the data, store the βResultβ portion in a state attribute field. But I canβt get to just the single values out of that state_attribute.
Here is the state_attribute:
Result:
- β@Nameβ: Balance
β#textβ: β50,50,50,50,50,50,50,99,50,50,50,50,50,50,50,50β - β@Nameβ: Bass
β#textβ: β75,95,75,75,75,75,75,75,75,75,75,75,75,75,95,95β - β@Nameβ: LipSync
β#textβ: β0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0β - β@Nameβ: Mute
β#textβ: >-
false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false - β@Nameβ: StereoConnections
β#textβ: β0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0β - β@Nameβ: Treble
β#textβ: β95,75,95,95,95,95,95,95,95,95,95,95,95,95,75,75β - β@Nameβ: Volume
β#textβ: β20,60,21,0,0,40,0,9,20,0,0,10,20,20,60,60β
Here is the value_template for one of the sensors, I canβt more out of this data, I would just want a single number, eg, 5 below.
{{states.sensor.audio_switch.attributes.Result[4]}}
yields:
{β@Nameβ: βStereoConnectionsβ, β#textβ: β0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0β}
Alternatively, if someone can suggest a better way to extract all of these individual values cleanly, I am all ears.
Thanks in advance.