27.03.2018, 11:30
It probably does not work because you have password enabled for apps. Create user with login sonos and password sonos123
Then create an event script mapped to 1-byte scale object:
If this still does not work, add this at the end of the script and post what you get in Logs tab:
Then create an event script mapped to 1-byte scale object:
Code:
Sonos_Player_IP = '192.168.1.7'
value = event.getvalue() -- 0 to 100 so set object to scale
http = require('socket.http')
http.TIMEOUT = 5
reply = http.request('http://sonos:sonos123@127.0.0.1/apps/data/sonos/sonos.lp?action=setvolume&ip=' .. Sonos_Player_IP .. '&volume=' .. value)
If this still does not work, add this at the end of the script and post what you get in Logs tab:
Code:
log(reply)