I am looking for a "simple" way to interface with my new Yamaha musiccast speakers and receiver.
The musiccast system is completely network controlable by http and json.
What I am trying to start with are some simple commands:
For example:
To mute a network speaker I start an shell command
- Code: Select all
curl http://192.168.1.80/YamahaExtendedControl/v1/main/setMute?enable=true
To unmute the same speaker I do
- Code: Select all
curl http://192.168.1.80/YamahaExtendedControl/v1/main/setMute?enable=false;
So far so good.
What I now need, is the possibility to get the status of that speaker
This is done with a request that looks like this:
- Code: Select all
http://192.168.1.80/YamahaExtendedControl/v1/main/getStatus
which results in the following response
- Code: Select all
{"response_code":0,"power":"on","sleep":0,"volume":29,"mute":true,"max_volume":60,"input":"mc_link","distribution_enable":false,"equalizer":{"mode":"manual","low":9,"mid":0,"high":6},"link_control":"standard","disable_flags":0}
or as json interpretation
- Code: Select all
response_code 0
power "on"
sleep 0
volume 29
mute true
max_volume 60
input "mc_link"
distribution_enable false
equalizer
mode "manual"
low 9
mid 0
high 6
link_control "standard"
disable_flags 0
I would like to feed that response into some variables, but I don't know how I would do that.
Would anybody with more knowledge than me be able to help out?
Thanks in advance
Wilhelm