This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Squeezebox + KNX
#3
Thanks Erwin!

here a short function to send commands to your squeezebox players. I have added them to a user library.

Code:
--Functions for Logitech Media Server integration
squeezboxserverip = '192.168.0.XX' -- IP of the Logitech Media Server

function squeezeboxsendcommand(player,command)
 socket=require('socket')
  local client = socket.connect(squeezboxserverip, 9090)
 client:send(player .. ' ' .. command .. '\n')
  local result=client:receive()
  log(result)
  client:close()
end

and this is an example for an object turning on or off the player

Code:
require('user.squeezebox')

onoff = event.getvalue() and 1 or 0

squeezeboxsendcommand('b8:27:eb:ad:6b:c2', 'power ' .. onoff)
Reply


Messages In This Thread
Squeezebox + KNX - by managementboy - 30.10.2015, 17:18
RE: Squeezebox + KNX - by Erwin van der Zwart - 01.11.2015, 18:32
RE: Squeezebox + KNX - by managementboy - 20.01.2016, 15:05

Forum Jump: