Hi,
I have a NAD receiver (368) with BlueOS.
- The BlueOS integration has no functionality to switch input sources or adjust volume
With a rest_command i’m able to switch the input source of the NAD receiver.
The next step is to show the status of the current source (HDM1, HDMI 2, Optical, etc)
With a browser request i’m able to get the followwing XML:
<SyncStatus icon="/images/players/C368_nt.png" db="-48.5" modelName="C368" model="C368" brand="NAD" initialized="true" id="192.168.1.145:11000" mac="90:56:82:0E:82:27" volume="31" name="Woonkamer receiver" etag="117" schemaVersion="34" syncStat="117">
<externalSource id="9" isBluos="true" name="BluOS">
<item id="1" name="Optical 1"/>
<item id="2" name="Optical 2"/>
<item id="3" name="Coaxial 1"/>
<item id="4" name="Coaxial 2"/>
<item id="5" name="Phono"/>
<item id="6" name="Line 1"/>
<item id="7" name="Line 2"/>
<item id="8" name="Bluetooth"/>
<item id="9" isBluos="true" name="BluOS"/>
<item id="10" name="HDMI 1"/>
<item id="11" name="HDMI 2"/>
<item id="12" name="HDMI 3"/>
<item id="13" name="HDMI ARC"/>
</externalSource>
</SyncStatus>
The status I want to display is the ‘name’ of the ‘externalSource’ → ‘BluOS’
Content-type: text/xml; charset=utf-8
I used the following code within the configuration.yml:
rest:
# NAD XML webservice
- resource: "http://192.168.1.145:11000/SyncStatus"
scan_interval: 5
sensor:
- name: "Actual source"
value_template: "{{value_json.SyncStatus.externalSource._name}}"
In the Home Assistant log I only see the followwing line:
Template variable warning: 'dict object' has no attribute 'name' when rendering '{{value_json.SyncStatus.externalSource.name}}'
I don’t know what is wrong.
Regards,
Daniël