Hi,
Thank you for the reply. I apologize for not including information required to offer support. I have taken a number of plugins and put them together to control the HTD system via GW-SL21(RS232). I have a working plugin for the HTD MA66 and working on one for the HTD Lync system… It works for everything including volume up to 34. To control the volume in a slider you need to send an on and then the volume. I managed to get this working using the following code, again only to 0 to 34;
local keyPad = luup.attr_get(‘altid’, lul_device)
local keyCode = luup.attr_get(‘altid’, lul_device)
KeyString = “0x” … string.format( “%02x”, keyCode )
newtttxxx = lul_settings.newTargetValue + 196
newttt = “0x” … string.format( “%02x”, newtttxxx )
luup.log("Volume is 123 " … newttt )
local chksums = 0x02 + 0x00 + KeyString + 0x04 + 0x57
newchkcc = “0x” … string.format( “%02x”, chksums )
local chksums1 = 0x02 + 0x01 + KeyString + 0x15 + newttt
newchk = “0x” … string.char( chksums1 % 0x80 )
–string.char((chksum % 0x80), 0xF7)
luup.log("Volume chk " … chksums1 )
luup.log("Volume chkHH " … newchk )
-- Volume Level = newttt
local sres, serr = c:send(string.char(0x02,0x00,KeyString,0x04,0x57,newchkcc)) -- zone on
print("Send:", sres, serr)
local sres, serr = c:send(string.char(0x02,0x01,KeyString,0x15,newttt,newchk)) -- volume
print("Send:", sres, serr)
local sres, serr = c:send(string.char(0x02,0x00,KeyString,0x04,0x57,newchkcc)) -- zone on
print("Send:", sres, serr)
local sres, serr = c:send(string.char(0x02,0x01,KeyString,0x15,newttt,newchk)) -- volume
print("Send:", sres, serr)
luup.log("Send:",sres, serr)
However the code will only control the volume up to a setpoint of 34, 35 and up will not work. Apparently the string.char is only good for 255 (0xFF). Most everything else is working, still trying to get the feedback worked out.
I have tried the following and it works for everything ewith ther exception of volume, the only thing that would work was the above and a scene. The scene actually works from 0 to 60, so perfectly…
– Mute Zone On When i send it in this manner but volume will not.
local keyPad = luup.attr_get(‘altid’, lul_device)
local keyCode = luup.attr_get(‘altid’, lul_device)
KeyString = “0x” … string.format( “%02x”, keyCode )
local chksums = 0x02 + 0x00 + KeyString + 0x04 + 0x1E
– Send command
cmdString = { 0x02, 0x00, KeyString, 0x04, 0x1E, chksums }
sendCommand(makeCommand(cmdString))
This is the scene
local socket = require(“socket”)
host = “192.168.2.88”
c = assert(socket.connect(host, 10006))
c:settimeout(5)
local sres, serr = c:send(string.char(0x02,0x00,0x01,0x04,0x57,0x5E))-- zone on
print(“Send:”, sres, serr)
local sres, serr = c:send(string.char(0x02,0x01,0x01,0x15,0xEA,0x03)) – volume 38
print(“Send:”, sres, serr)
local sres, serr = c:send(string.char(0x02,0x00,0x01,0x04,0x57,0x5E))-- zone on
print(“Send:”, sres, serr)
local sres, serr = c:send(string.char(0x02,0x01,0x01,0x15,0xEA,0x03)) – volume 38
print(“Send:”, sres, serr)
c:close()
THis is the plugin
local keyCode = luup.attr_get(‘altid’, lul_device)
KeyString = “0x” … string.format( “%02x”, keyCode )
– calculates check sum with variable
local chksums = 0x02 + 0x00 + KeyString + 0x04 + 0x57
local chksums66 = 0x02 + 0x01 + KeyString + 0x15 + 0x1E
– Send command
cmdString = { 0x02, 0x01, 0x01, 0x15, 0xC9, 0xE2 }
sendCommand(makeCommand(cmdString))
cmdString = { 0x02, 0x00, KeyString, 0x04, 0x57, chksums }
sendCommand(makeCommand(cmdString))
cmdString = { 0x02, 0x01, 0x01, 0x15, 0xC9, 0xE2 }
sendCommand(makeCommand(cmdString))
cmdString = { 0x02, 0x00, KeyString, 0x04, 0x57, chksums }
sendCommand(makeCommand(cmdString))
cmdString = { 0x02, 0x01, 0x01, 0x15, 0xC9, 0xE2 }
sendCommand(makeCommand(cmdString))
The plugin will turn on the zone but will not set the volume. To set the volume the unit is required to send a zone on command first and then a set volume. I need to do this twice to set the volume.
The actually plugin was based on the RNET plugin and included items from a few TV and DVR plugins. ANything to make it work.
Any help would be greatly appreciated.
Thanks