Full project / how-to use command_line, fetch unsupported states of Dennon AVRs available in the web frontend of network accessable Denon/Marantz AVRs at the end of this post
(here the original question - as description of my problem)
Hi and sorry if id should have found the exact answer in an existing thread. All I found didn’t really match my needs. I’m a total rookie - started yesterday.
So I have setup home assistant (docker) on my synology NAS. denonavr integration is running and already sending notifications to my LG Smart TV.
Unfortunatly I’m not able to get source signal information (I want to dissplay the source output channel like 5.1 and 2.0).
If someone knows the exact attribute to fetch this information it would be great. I did not find it
Denon AVR Network Receivers - Home Assistant
So a simple way would be to add a trigger to call my bash script which gets the source format/channel information using GNU Linux commands like wget, grep and head. The information I am looking can be read out from the AVRs web frontend.
So long story short: Is it possible to fetch output of a bash/shell script to use it as a variable for an automatition?
Thanks in advance
Edit: If your’e asking why I want do to this - the TV is connected via eARC and so there is no way to have an on screen display from the receiver with these information.
How to fetch information eg from web fronted of Denon network enabled AVRs that are not supported but viewable on the Web frontend
First - Open a Chrome/Chromium or derivat browser using other browsers may vary
- visit your AVRs web frontend (by entering its ip or by url) - make sure you are at the main page(!)
- press F12 - a developer console appears on the right site of the browsers page
- notice the dot on the upper left side of this developer console is red and you are on the “Network” register (right above the dot mentioned is the list with “Elements” “Console” “Sources”)
- now that you have checked everything and it’s recording take a look back to the left side where your web frontend is: navigate to the “Information” overview where you have an overview of the information you want to fetch for (code in this thread could easily be modified)
- after you have navigated to the Information panel take a look at the lift side where you’ve recorded the network activity an stop recording by clicking on the (red) dot.
Here you have the information - different request URLs(? don’t now the term of this actually)
The one we searched for should be the last in the list - klick on it.
Now you should see the exact lURL looking something like this:
https://(YOUR.AVRs.IP):(PORT)/ajax/general/get_config?type=12(bla bla bla)
You only need the part up to (…)get_config?type=12 (on my AVR its the #12 - this may vary like your IP also does)
Now you could check, if you are getting some information from your Denon AVR by entering the whole URL in to your browser (a source code XML should appear)
- If testing the URL was successful:
Copy the request URL to this yan replace the ###
sensor:
- platform: command_line
name: Source_Channel
command: wget --no-check-certificate -q ### -O wget.txt && grep -P -o "(?<=\<Format\>).*(?=\</Format\>)" wget.txt && rm wget.txt
Last step is to copy this block in to your ~/config/configuration.yaml
Check the configuration throug the home assistant GUI and restart the instance
Done
You can access your variable/value as sensor (like you named it) in my case " sensor.source_channel"