Skip to content

Instantly share code, notes, and snippets.

@mydnic
Created January 1, 2024 19:26
Show Gist options
  • Save mydnic/8d474940cd1a556ec39c50f4833b49ce to your computer and use it in GitHub Desktop.
Save mydnic/8d474940cd1a556ec39c50f4833b49ce to your computer and use it in GitHub Desktop.
yamaha local
#!/bin/bash
ip='192.168.0.3'
# START
curl "http://$ip/YamahaRemoteControl/ctrl" -H "Origin: http://$ip" -H 'Accept-Encoding: gzip, deflate' -H 'Accept-Language: fr,en-US;q=0.8,en;q=0.6' -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.93 Safari/537.36' -H 'Content-Type: text/xml' -H 'Accept: */*' -H "Referer: http://$ip/" -H 'Connection: keep-alive' --data-binary '<YAMAHA_AV cmd="PUT"><Main_Zone><Input><Input_Sel>AUDIO2</Input_Sel></Input></Main_Zone></YAMAHA_AV>' --compressed
# STOP
curl "http://$ip/YamahaRemoteControl/ctrl" -H "Origin: http://$ip" -H 'Accept-Encoding: gzip, deflate' -H 'Accept-Language: fr,en-US;q=0.8,en;q=0.6' -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.93 Safari/537.36' -H 'Content-Type: text/xml' -H 'Accept: */*' -H "Referer: http://$ip/" -H 'Connection: keep-alive' --data-binary '<YAMAHA_AV cmd="PUT"><Main_Zone><Input><Input_Sel>AV1</Input_Sel></Input></Main_Zone></YAMAHA_AV>' --compressed
# VOLUME
curl "http://$ip/YamahaRemoteControl/ctrl" -H "Origin: http://$ip" -H 'Accept-Encoding: gzip, deflate' -H 'Accept-Language: fr,en-US;q=0.8,en;q=0.6' -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.93 Safari/537.36' -H 'Content-Type: text/xml' -H 'Accept: */*' -H "Referer: http://$ip/" -H 'Connection: keep-alive' --data-binary '<YAMAHA_AV cmd="PUT"><Main_Zone><Volume><Lvl><Val>-150</Val><Exp>1</Exp><Unit>dB</Unit></Lvl></Volume></Main_Zone></YAMAHA_AV>' --compressed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment