I still haven't managed to figure out why the app works only via the web page after accessing my LM4
but it does not works while running any of the scripts that they have been working before:
Do you see any abnormal configuration on the below script?
I have also added sonos.lua and sonos.lp files in the same /user/ folder of my LM4. (you can find them enclosed)
Please note that my LM4's IP is 10.20.30.5 and the Sonos players have all the IP addresses mentioned in the script.
but it does not works while running any of the scripts that they have been working before:
Do you see any abnormal configuration on the below script?
Code:
-- Load modules
require('json')
require('socket.http')
-- Set timout
socket.http.TIMEOUT = 5
-- Set SONOS ip
Sonos_Kitchen_ip = '10.20.30.20'
Sonos_Living_ip = '10.20.30.30'
Sonos_Bedroom_ip = '10.20.30.40'
Sonos_Office_ip = '10.20.30.50'
-- Get event value
value = event.getvalue()
-- Set stepsize volume
Volume_Step = 5
-- Set Action
if value == 0 then
Sonos_Action = 'stop'
else
action = 'none'
end
-- Execute action on value 0
if value >= 0 and value < 1 then
local reply = socket.http.request('http://admin:passwordnotdisclosed@127.0.0.1/user/sonos.lp?action=' .. Sonos_Action .. '&ip=' .. Sonos_Kitchen_ip .. '')
end
-- Execute action on value 0
if value >= 0 and value < 1 then
local reply = socket.http.request('http://admin:passwordnotdisclosed@127.0.0.1/user/sonos.lp?action=' .. Sonos_Action .. '&ip=' .. Sonos_Living_ip .. '')
end
-- Execute action on value 0
if value >= 0 and value < 1 then
local reply = socket.http.request('http://admin:passwordnotdisclosed@127.0.0.1/user/sonos.lp?action=' .. Sonos_Action .. '&ip=' .. Sonos_Bedroom_ip .. '')
end
-- Execute action on value 0
if value >= 0 and value < 1 then
local reply = socket.http.request('http://admin:passwordnotdisclosed@127.0.0.1/user/sonos.lp?action=' .. Sonos_Action .. '&ip=' .. Sonos_Office_ip .. '')
end
I have also added sonos.lua and sonos.lp files in the same /user/ folder of my LM4. (you can find them enclosed)
Please note that my LM4's IP is 10.20.30.5 and the Sonos players have all the IP addresses mentioned in the script.