(29.03.2021, 06:49)admin Wrote: For Yamaha run this script once and if it works correctly you should be a table with various status info in Logs tab. Change ip variable to Yamaha speakers IP address.Hi
Code:ip = '192.168.1.2'
json = require('json')
http = require('socket.http')
ltn12 = require('ltn12')
respbody = {}
res, code, hdrs = http.request({
url = 'http://' .. ip .. '/YamahaExtendedControl/v1/main/getStatus',
headers = {
['X-AppName'] = 'MusicCast/1.0',
['X-AppPort'] = '41100',
},
sink = ltn12.sink.table(respbody)
})
if res then
data = json.pdecode(table.concat(respbody))
log(data)
else
log('request failed', res, code)
end
I endered the script on the Resident Script tab (I don't know if I have done well or I had to choose another Script tab to create this Script) by creating a new Script and named it as YAMAHA. Also I entered the IP of the Yamaha Speaker and I checked the logs. It runs the script and now how I am going to visualize it and make it usable and make the functions like controlling volume , changing tracks or web radios or even changing the source from LM application something like SONOS app?
Thank you in advance for your help
Also I forgot to mentioned that the IP at line 2 I changed it to 192.168.1.169 which is the IP address of the Yamaha Musicast Speaker
Also is this something to do with KNX? I mean can we make some restrictions for example in volume like having levels in volume for specific hours of time?