{"name":"SamsungTV","type":"virtual_device","properties":{"deviceIcon":1000,"currentIcon":"0","mainLoop":"","saveLogs":"1","rows":[{"type":"button","elements":[{"id":1,"lua":true,"waitForResponse":false,"caption":"Power","name":"Button11","empty":false,"msg":"-- -- \ntvIpAddress = \"192.168.1.17\" \ntvPort = 55000 \nkeycodestring = \"KEY_POWEROFF\" \n\ntvAuthString = string.char(0x00,0x14,0x00,0x69,0x70,0x68,0x6f,0x6e,0x65,0x2e,0x2e,0x69,0x61,0x70,0x70,0x2e,0x73,0x61,0x6d,0x73,0x75,0x6e,0x67,0x38,0x00,0x64,0x00,0x14,0x00,0x4d,0x54,0x6b,0x79,0x4c,0x6a,0x45,0x32,0x4f,0x43,0x34,0x77,0x4c,0x6a,0x45,0x78,0x4d,0x41,0x3d,0x3d,0x18,0x00,0x4e,0x45,0x4d,0x74,0x4e,0x7a,0x49,0x74,0x51,0x6a,0x6b,0x74,0x4e,0x44,0x4d,0x74,0x4d,0x6a,0x51,0x74,0x4f,0x45,0x49,0x3d,0x04,0x00,0x54,0x51,0x3d,0x3d)\n-- -- \n\n-- character table string \nlocal b='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' \n\n-- encoding to base64 \nfunction enc(data) \n return ((data:gsub('.', function(x) \n local r,b='',x:byte() \n for i=8,1,-1 do r=r..(b%2^i-b%2^(i-1)>0 and '1' or '0') end \n return r; \n end)..'0000'):gsub('%d%d%d?%d?%d?%d?', function(x) \n if (#x < 6) then return '' end \n local c=0 \n for i=1,6 do c=c+(x:sub(i,i)=='1' and 2^(6-i) or 0) end \n return b:sub(c+1,c+1) \n end)..({ '', '==', '=' })[#data%3+1]) \nend \n\n-- helper function \nfunction num2bytes(num) \n local retStr=\"\" \n for i=1,2 do \n retStr = retStr .. string.char(num%256) \n num = math.floor(num/256) \n end \n return retStr \nend \n\ntcpSocket = Net.FTcpSocket(tvIpAddress, tvPort) \n\n-- say hello to the TV ;) \nbytes, errorCode = tcpSocket:write(tvAuthString) \n\nkeycodebase = string.char(0x00,0x13,0x00,0x69,0x70,0x68,0x6f,0x6e,0x65,0x2e,0x69,0x61,0x70,0x70,0x2e,0x73,0x61,0x6d,0x73,0x75,0x6e,0x67) \n\n-- payload \npayloadinit = string.char(0x00,0x00,0x00) \nkeycode = enc(keycodestring) \n\nkeycodesize = num2bytes(string.len(keycode)) \n\npayloadsize = num2bytes(string.len(payloadinit .. keycode ..keycodesize)) \n\n-- combining the message \nmessage = keycodebase .. payloadsize .. payloadinit .. keycodesize .. keycode \n\n-- sending keycode \nbytes, errorCode2 = tcpSocket:write(message) \n\n\nif errorCode == 0 and errorCode2 == 0 \nthen \n -- printing log under virtual device \n fibaro:log(\"transfer OK: \" .. keycodestring) \nelse \n fibaro:log(\"transfer failed\") \nend","buttonIcon":0,"favourite":false,"main":true},{"id":2,"lua":true,"waitForResponse":false,"caption":"Source","name":"Button12","empty":false,"msg":"-- -- \ntvIpAddress = \"192.168.1.17\" \ntvPort = 55000 \nkeycodestring = \"KEY_SOURCE\" \n\ntvAuthString = string.char(0x00,0x14,0x00,0x69,0x70,0x68,0x6f,0x6e,0x65,0x2e,0x2e,0x69,0x61,0x70,0x70,0x2e,0x73,0x61,0x6d,0x73,0x75,0x6e,0x67,0x38,0x00,0x64,0x00,0x14,0x00,0x4d,0x54,0x6b,0x79,0x4c,0x6a,0x45,0x32,0x4f,0x43,0x34,0x77,0x4c,0x6a,0x45,0x78,0x4d,0x41,0x3d,0x3d,0x18,0x00,0x4e,0x45,0x4d,0x74,0x4e,0x7a,0x49,0x74,0x51,0x6a,0x6b,0x74,0x4e,0x44,0x4d,0x74,0x4d,0x6a,0x51,0x74,0x4f,0x45,0x49,0x3d,0x04,0x00,0x54,0x51,0x3d,0x3d)\n-- -- \n\n-- character table string \nlocal b='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' \n\n-- encoding to base64 \nfunction enc(data) \n return ((data:gsub('.', function(x) \n local r,b='',x:byte() \n for i=8,1,-1 do r=r..(b%2^i-b%2^(i-1)>0 and '1' or '0') end \n return r; \n end)..'0000'):gsub('%d%d%d?%d?%d?%d?', function(x) \n if (#x < 6) then return '' end \n local c=0 \n for i=1,6 do c=c+(x:sub(i,i)=='1' and 2^(6-i) or 0) end \n return b:sub(c+1,c+1) \n end)..({ '', '==', '=' })[#data%3+1]) \nend \n\n-- helper function \nfunction num2bytes(num) \n local retStr=\"\" \n for i=1,2 do \n retStr = retStr .. string.char(num%256) \n num = math.floor(num/256) \n end \n return retStr \nend \n\ntcpSocket = Net.FTcpSocket(tvIpAddress, tvPort) \n\n-- say hello to the TV ;) \nbytes, errorCode = tcpSocket:write(tvAuthString) \n\nkeycodebase = string.char(0x00,0x13,0x00,0x69,0x70,0x68,0x6f,0x6e,0x65,0x2e,0x69,0x61,0x70,0x70,0x2e,0x73,0x61,0x6d,0x73,0x75,0x6e,0x67) \n\n-- payload \npayloadinit = string.char(0x00,0x00,0x00) \nkeycode = enc(keycodestring) \n\nkeycodesize = num2bytes(string.len(keycode)) \n\npayloadsize = num2bytes(string.len(payloadinit .. keycode ..keycodesize)) \n\n-- combining the message \nmessage = keycodebase .. payloadsize .. payloadinit .. keycodesize .. keycode \n\n-- sending keycode \nbytes, errorCode2 = tcpSocket:write(message) \n\n\nif errorCode == 0 and errorCode2 == 0 \nthen \n -- printing log under virtual device \n fibaro:log(\"transfer OK: \" .. keycodestring) \nelse \n fibaro:log(\"transfer failed\") \nend","buttonIcon":0,"favourite":false,"main":false}]},{"type":"button","elements":[{"id":3,"lua":true,"waitForResponse":false,"caption":"HDMI","name":"Button21","empty":false,"msg":"-- -- \ntvIpAddress = \"192.168.1.17\" \ntvPort = 55000 \nkeycodestring = \"KEY_HDMI\" \n\ntvAuthString = string.char(0x00,0x14,0x00,0x69,0x70,0x68,0x6f,0x6e,0x65,0x2e,0x2e,0x69,0x61,0x70,0x70,0x2e,0x73,0x61,0x6d,0x73,0x75,0x6e,0x67,0x38,0x00,0x64,0x00,0x14,0x00,0x4d,0x54,0x6b,0x79,0x4c,0x6a,0x45,0x32,0x4f,0x43,0x34,0x77,0x4c,0x6a,0x45,0x78,0x4d,0x41,0x3d,0x3d,0x18,0x00,0x4e,0x45,0x4d,0x74,0x4e,0x7a,0x49,0x74,0x51,0x6a,0x6b,0x74,0x4e,0x44,0x4d,0x74,0x4d,0x6a,0x51,0x74,0x4f,0x45,0x49,0x3d,0x04,0x00,0x54,0x51,0x3d,0x3d)\n-- -- \n\n-- character table string \nlocal b='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' \n\n-- encoding to base64 \nfunction enc(data) \n return ((data:gsub('.', function(x) \n local r,b='',x:byte() \n for i=8,1,-1 do r=r..(b%2^i-b%2^(i-1)>0 and '1' or '0') end \n return r; \n end)..'0000'):gsub('%d%d%d?%d?%d?%d?', function(x) \n if (#x < 6) then return '' end \n local c=0 \n for i=1,6 do c=c+(x:sub(i,i)=='1' and 2^(6-i) or 0) end \n return b:sub(c+1,c+1) \n end)..({ '', '==', '=' })[#data%3+1]) \nend \n\n-- helper function \nfunction num2bytes(num) \n local retStr=\"\" \n for i=1,2 do \n retStr = retStr .. string.char(num%256) \n num = math.floor(num/256) \n end \n return retStr \nend \n\ntcpSocket = Net.FTcpSocket(tvIpAddress, tvPort) \n\n-- say hello to the TV ;) \nbytes, errorCode = tcpSocket:write(tvAuthString) \n\nkeycodebase = string.char(0x00,0x13,0x00,0x69,0x70,0x68,0x6f,0x6e,0x65,0x2e,0x69,0x61,0x70,0x70,0x2e,0x73,0x61,0x6d,0x73,0x75,0x6e,0x67) \n\n-- payload \npayloadinit = string.char(0x00,0x00,0x00) \nkeycode = enc(keycodestring) \n\nkeycodesize = num2bytes(string.len(keycode)) \n\npayloadsize = num2bytes(string.len(payloadinit .. keycode ..keycodesize)) \n\n-- combining the message \nmessage = keycodebase .. payloadsize .. payloadinit .. keycodesize .. keycode \n\n-- sending keycode \nbytes, errorCode2 = tcpSocket:write(message) \n\n\nif errorCode == 0 and errorCode2 == 0 \nthen \n -- printing log under virtual device \n fibaro:log(\"transfer OK: \" .. keycodestring) \nelse \n fibaro:log(\"transfer failed\") \nend","buttonIcon":0,"favourite":false,"main":false}]},{"type":"button","elements":[{"id":4,"lua":true,"waitForResponse":false,"caption":"1","name":"Button31","empty":false,"msg":"-- -- \ntvIpAddress = \"192.168.1.17\" \ntvPort = 55000 \nkeycodestring = \"KEY_1\" \n\ntvAuthString = string.char(0x00,0x14,0x00,0x69,0x70,0x68,0x6f,0x6e,0x65,0x2e,0x2e,0x69,0x61,0x70,0x70,0x2e,0x73,0x61,0x6d,0x73,0x75,0x6e,0x67,0x38,0x00,0x64,0x00,0x14,0x00,0x4d,0x54,0x6b,0x79,0x4c,0x6a,0x45,0x32,0x4f,0x43,0x34,0x77,0x4c,0x6a,0x45,0x78,0x4d,0x41,0x3d,0x3d,0x18,0x00,0x4e,0x45,0x4d,0x74,0x4e,0x7a,0x49,0x74,0x51,0x6a,0x6b,0x74,0x4e,0x44,0x4d,0x74,0x4d,0x6a,0x51,0x74,0x4f,0x45,0x49,0x3d,0x04,0x00,0x54,0x51,0x3d,0x3d)\n-- -- \n\n-- character table string \nlocal b='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' \n\n-- encoding to base64 \nfunction enc(data) \n return ((data:gsub('.', function(x) \n local r,b='',x:byte() \n for i=8,1,-1 do r=r..(b%2^i-b%2^(i-1)>0 and '1' or '0') end \n return r; \n end)..'0000'):gsub('%d%d%d?%d?%d?%d?', function(x) \n if (#x < 6) then return '' end \n local c=0 \n for i=1,6 do c=c+(x:sub(i,i)=='1' and 2^(6-i) or 0) end \n return b:sub(c+1,c+1) \n end)..({ '', '==', '=' })[#data%3+1]) \nend \n\n-- helper function \nfunction num2bytes(num) \n local retStr=\"\" \n for i=1,2 do \n retStr = retStr .. string.char(num%256) \n num = math.floor(num/256) \n end \n return retStr \nend \n\ntcpSocket = Net.FTcpSocket(tvIpAddress, tvPort) \n\n-- say hello to the TV ;) \nbytes, errorCode = tcpSocket:write(tvAuthString) \n\nkeycodebase = string.char(0x00,0x13,0x00,0x69,0x70,0x68,0x6f,0x6e,0x65,0x2e,0x69,0x61,0x70,0x70,0x2e,0x73,0x61,0x6d,0x73,0x75,0x6e,0x67) \n\n-- payload \npayloadinit = string.char(0x00,0x00,0x00) \nkeycode = enc(keycodestring) \n\nkeycodesize = num2bytes(string.len(keycode)) \n\npayloadsize = num2bytes(string.len(payloadinit .. keycode ..keycodesize)) \n\n-- combining the message \nmessage = keycodebase .. payloadsize .. payloadinit .. keycodesize .. keycode \n\n-- sending keycode \nbytes, errorCode2 = tcpSocket:write(message) \n\n\nif errorCode == 0 and errorCode2 == 0 \nthen \n -- printing log under virtual device \n fibaro:log(\"transfer OK: \" .. keycodestring) \nelse \n fibaro:log(\"transfer failed\") \nend","buttonIcon":0,"favourite":false,"main":false},{"id":5,"lua":true,"waitForResponse":false,"caption":"2","name":"Button32","empty":false,"msg":"-- -- \ntvIpAddress = \"192.168.1.17\" \ntvPort = 55000 \nkeycodestring = \"KEY_2\" \n\ntvAuthString = string.char(0x00,0x14,0x00,0x69,0x70,0x68,0x6f,0x6e,0x65,0x2e,0x2e,0x69,0x61,0x70,0x70,0x2e,0x73,0x61,0x6d,0x73,0x75,0x6e,0x67,0x38,0x00,0x64,0x00,0x14,0x00,0x4d,0x54,0x6b,0x79,0x4c,0x6a,0x45,0x32,0x4f,0x43,0x34,0x77,0x4c,0x6a,0x45,0x78,0x4d,0x41,0x3d,0x3d,0x18,0x00,0x4e,0x45,0x4d,0x74,0x4e,0x7a,0x49,0x74,0x51,0x6a,0x6b,0x74,0x4e,0x44,0x4d,0x74,0x4d,0x6a,0x51,0x74,0x4f,0x45,0x49,0x3d,0x04,0x00,0x54,0x51,0x3d,0x3d)\n-- -- \n\n-- character table string \nlocal b='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' \n\n-- encoding to base64 \nfunction enc(data) \n return ((data:gsub('.', function(x) \n local r,b='',x:byte() \n for i=8,1,-1 do r=r..(b%2^i-b%2^(i-1)>0 and '1' or '0') end \n return r; \n end)..'0000'):gsub('%d%d%d?%d?%d?%d?', function(x) \n if (#x < 6) then return '' end \n local c=0 \n for i=1,6 do c=c+(x:sub(i,i)=='1' and 2^(6-i) or 0) end \n return b:sub(c+1,c+1) \n end)..({ '', '==', '=' })[#data%3+1]) \nend \n\n-- helper function \nfunction num2bytes(num) \n local retStr=\"\" \n for i=1,2 do \n retStr = retStr .. string.char(num%256) \n num = math.floor(num/256) \n end \n return retStr \nend \n\ntcpSocket = Net.FTcpSocket(tvIpAddress, tvPort) \n\n-- say hello to the TV ;) \nbytes, errorCode = tcpSocket:write(tvAuthString) \n\nkeycodebase = string.char(0x00,0x13,0x00,0x69,0x70,0x68,0x6f,0x6e,0x65,0x2e,0x69,0x61,0x70,0x70,0x2e,0x73,0x61,0x6d,0x73,0x75,0x6e,0x67) \n\n-- payload \npayloadinit = string.char(0x00,0x00,0x00) \nkeycode = enc(keycodestring) \n\nkeycodesize = num2bytes(string.len(keycode)) \n\npayloadsize = num2bytes(string.len(payloadinit .. keycode ..keycodesize)) \n\n-- combining the message \nmessage = keycodebase .. payloadsize .. payloadinit .. keycodesize .. keycode \n\n-- sending keycode \nbytes, errorCode2 = tcpSocket:write(message) \n\n\nif errorCode == 0 and errorCode2 == 0 \nthen \n -- printing log under virtual device \n fibaro:log(\"transfer OK: \" .. keycodestring) \nelse \n fibaro:log(\"transfer failed\") \nend","buttonIcon":0,"favourite":false,"main":false},{"id":6,"lua":true,"waitForResponse":false,"caption":"3","name":"Button33","empty":false,"msg":"-- -- \ntvIpAddress = \"192.168.1.17\" \ntvPort = 55000 \nkeycodestring = \"KEY_3\" \n\ntvAuthString = string.char(0x00,0x14,0x00,0x69,0x70,0x68,0x6f,0x6e,0x65,0x2e,0x2e,0x69,0x61,0x70,0x70,0x2e,0x73,0x61,0x6d,0x73,0x75,0x6e,0x67,0x38,0x00,0x64,0x00,0x14,0x00,0x4d,0x54,0x6b,0x79,0x4c,0x6a,0x45,0x32,0x4f,0x43,0x34,0x77,0x4c,0x6a,0x45,0x78,0x4d,0x41,0x3d,0x3d,0x18,0x00,0x4e,0x45,0x4d,0x74,0x4e,0x7a,0x49,0x74,0x51,0x6a,0x6b,0x74,0x4e,0x44,0x4d,0x74,0x4d,0x6a,0x51,0x74,0x4f,0x45,0x49,0x3d,0x04,0x00,0x54,0x51,0x3d,0x3d)\n-- -- \n\n-- character table string \nlocal b='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' \n\n-- encoding to base64 \nfunction enc(data) \n return ((data:gsub('.', function(x) \n local r,b='',x:byte() \n for i=8,1,-1 do r=r..(b%2^i-b%2^(i-1)>0 and '1' or '0') end \n return r; \n end)..'0000'):gsub('%d%d%d?%d?%d?%d?', function(x) \n if (#x < 6) then return '' end \n local c=0 \n for i=1,6 do c=c+(x:sub(i,i)=='1' and 2^(6-i) or 0) end \n return b:sub(c+1,c+1) \n end)..({ '', '==', '=' })[#data%3+1]) \nend \n\n-- helper function \nfunction num2bytes(num) \n local retStr=\"\" \n for i=1,2 do \n retStr = retStr .. string.char(num%256) \n num = math.floor(num/256) \n end \n return retStr \nend \n\ntcpSocket = Net.FTcpSocket(tvIpAddress, tvPort) \n\n-- say hello to the TV ;) \nbytes, errorCode = tcpSocket:write(tvAuthString) \n\nkeycodebase = string.char(0x00,0x13,0x00,0x69,0x70,0x68,0x6f,0x6e,0x65,0x2e,0x69,0x61,0x70,0x70,0x2e,0x73,0x61,0x6d,0x73,0x75,0x6e,0x67) \n\n-- payload \npayloadinit = string.char(0x00,0x00,0x00) \nkeycode = enc(keycodestring) \n\nkeycodesize = num2bytes(string.len(keycode)) \n\npayloadsize = num2bytes(string.len(payloadinit .. keycode ..keycodesize)) \n\n-- combining the message \nmessage = keycodebase .. payloadsize .. payloadinit .. keycodesize .. keycode \n\n-- sending keycode \nbytes, errorCode2 = tcpSocket:write(message) \n\n\nif errorCode == 0 and errorCode2 == 0 \nthen \n -- printing log under virtual device \n fibaro:log(\"transfer OK: \" .. keycodestring) \nelse \n fibaro:log(\"transfer failed\") \nend","buttonIcon":0,"favourite":false,"main":false}]},{"type":"button","elements":[{"id":7,"lua":true,"waitForResponse":false,"caption":"4","name":"Button41","empty":false,"msg":"-- -- \ntvIpAddress = \"192.168.1.17\" \ntvPort = 55000 \nkeycodestring = \"KEY_4\" \n\ntvAuthString = string.char(0x00,0x14,0x00,0x69,0x70,0x68,0x6f,0x6e,0x65,0x2e,0x2e,0x69,0x61,0x70,0x70,0x2e,0x73,0x61,0x6d,0x73,0x75,0x6e,0x67,0x38,0x00,0x64,0x00,0x14,0x00,0x4d,0x54,0x6b,0x79,0x4c,0x6a,0x45,0x32,0x4f,0x43,0x34,0x77,0x4c,0x6a,0x45,0x78,0x4d,0x41,0x3d,0x3d,0x18,0x00,0x4e,0x45,0x4d,0x74,0x4e,0x7a,0x49,0x74,0x51,0x6a,0x6b,0x74,0x4e,0x44,0x4d,0x74,0x4d,0x6a,0x51,0x74,0x4f,0x45,0x49,0x3d,0x04,0x00,0x54,0x51,0x3d,0x3d)\n-- -- \n\n-- character table string \nlocal b='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' \n\n-- encoding to base64 \nfunction enc(data) \n return ((data:gsub('.', function(x) \n local r,b='',x:byte() \n for i=8,1,-1 do r=r..(b%2^i-b%2^(i-1)>0 and '1' or '0') end \n return r; \n end)..'0000'):gsub('%d%d%d?%d?%d?%d?', function(x) \n if (#x < 6) then return '' end \n local c=0 \n for i=1,6 do c=c+(x:sub(i,i)=='1' and 2^(6-i) or 0) end \n return b:sub(c+1,c+1) \n end)..({ '', '==', '=' })[#data%3+1]) \nend \n\n-- helper function \nfunction num2bytes(num) \n local retStr=\"\" \n for i=1,2 do \n retStr = retStr .. string.char(num%256) \n num = math.floor(num/256) \n end \n return retStr \nend \n\ntcpSocket = Net.FTcpSocket(tvIpAddress, tvPort) \n\n-- say hello to the TV ;) \nbytes, errorCode = tcpSocket:write(tvAuthString) \n\nkeycodebase = string.char(0x00,0x13,0x00,0x69,0x70,0x68,0x6f,0x6e,0x65,0x2e,0x69,0x61,0x70,0x70,0x2e,0x73,0x61,0x6d,0x73,0x75,0x6e,0x67) \n\n-- payload \npayloadinit = string.char(0x00,0x00,0x00) \nkeycode = enc(keycodestring) \n\nkeycodesize = num2bytes(string.len(keycode)) \n\npayloadsize = num2bytes(string.len(payloadinit .. keycode ..keycodesize)) \n\n-- combining the message \nmessage = keycodebase .. payloadsize .. payloadinit .. keycodesize .. keycode \n\n-- sending keycode \nbytes, errorCode2 = tcpSocket:write(message) \n\n\nif errorCode == 0 and errorCode2 == 0 \nthen \n -- printing log under virtual device \n fibaro:log(\"transfer OK: \" .. keycodestring) \nelse \n fibaro:log(\"transfer failed\") \nend","buttonIcon":0,"favourite":false,"main":false},{"id":8,"lua":true,"waitForResponse":false,"caption":"5","name":"Button42","empty":false,"msg":"-- -- \ntvIpAddress = \"192.168.1.17\" \ntvPort = 55000 \nkeycodestring = \"KEY_5\" \n\ntvAuthString = string.char(0x00,0x14,0x00,0x69,0x70,0x68,0x6f,0x6e,0x65,0x2e,0x2e,0x69,0x61,0x70,0x70,0x2e,0x73,0x61,0x6d,0x73,0x75,0x6e,0x67,0x38,0x00,0x64,0x00,0x14,0x00,0x4d,0x54,0x6b,0x79,0x4c,0x6a,0x45,0x32,0x4f,0x43,0x34,0x77,0x4c,0x6a,0x45,0x78,0x4d,0x41,0x3d,0x3d,0x18,0x00,0x4e,0x45,0x4d,0x74,0x4e,0x7a,0x49,0x74,0x51,0x6a,0x6b,0x74,0x4e,0x44,0x4d,0x74,0x4d,0x6a,0x51,0x74,0x4f,0x45,0x49,0x3d,0x04,0x00,0x54,0x51,0x3d,0x3d)\n-- -- \n\n-- character table string \nlocal b='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' \n\n-- encoding to base64 \nfunction enc(data) \n return ((data:gsub('.', function(x) \n local r,b='',x:byte() \n for i=8,1,-1 do r=r..(b%2^i-b%2^(i-1)>0 and '1' or '0') end \n return r; \n end)..'0000'):gsub('%d%d%d?%d?%d?%d?', function(x) \n if (#x < 6) then return '' end \n local c=0 \n for i=1,6 do c=c+(x:sub(i,i)=='1' and 2^(6-i) or 0) end \n return b:sub(c+1,c+1) \n end)..({ '', '==', '=' })[#data%3+1]) \nend \n\n-- helper function \nfunction num2bytes(num) \n local retStr=\"\" \n for i=1,2 do \n retStr = retStr .. string.char(num%256) \n num = math.floor(num/256) \n end \n return retStr \nend \n\ntcpSocket = Net.FTcpSocket(tvIpAddress, tvPort) \n\n-- say hello to the TV ;) \nbytes, errorCode = tcpSocket:write(tvAuthString) \n\nkeycodebase = string.char(0x00,0x13,0x00,0x69,0x70,0x68,0x6f,0x6e,0x65,0x2e,0x69,0x61,0x70,0x70,0x2e,0x73,0x61,0x6d,0x73,0x75,0x6e,0x67) \n\n-- payload \npayloadinit = string.char(0x00,0x00,0x00) \nkeycode = enc(keycodestring) \n\nkeycodesize = num2bytes(string.len(keycode)) \n\npayloadsize = num2bytes(string.len(payloadinit .. keycode ..keycodesize)) \n\n-- combining the message \nmessage = keycodebase .. payloadsize .. payloadinit .. keycodesize .. keycode \n\n-- sending keycode \nbytes, errorCode2 = tcpSocket:write(message) \n\n\nif errorCode == 0 and errorCode2 == 0 \nthen \n -- printing log under virtual device \n fibaro:log(\"transfer OK: \" .. keycodestring) \nelse \n fibaro:log(\"transfer failed\") \nend","buttonIcon":0,"favourite":false,"main":false},{"id":9,"lua":true,"waitForResponse":false,"caption":"6","name":"Button43","empty":false,"msg":"-- -- \ntvIpAddress = \"192.168.1.17\" \ntvPort = 55000 \nkeycodestring = \"KEY_6\" \n\ntvAuthString = string.char(0x00,0x14,0x00,0x69,0x70,0x68,0x6f,0x6e,0x65,0x2e,0x2e,0x69,0x61,0x70,0x70,0x2e,0x73,0x61,0x6d,0x73,0x75,0x6e,0x67,0x38,0x00,0x64,0x00,0x14,0x00,0x4d,0x54,0x6b,0x79,0x4c,0x6a,0x45,0x32,0x4f,0x43,0x34,0x77,0x4c,0x6a,0x45,0x78,0x4d,0x41,0x3d,0x3d,0x18,0x00,0x4e,0x45,0x4d,0x74,0x4e,0x7a,0x49,0x74,0x51,0x6a,0x6b,0x74,0x4e,0x44,0x4d,0x74,0x4d,0x6a,0x51,0x74,0x4f,0x45,0x49,0x3d,0x04,0x00,0x54,0x51,0x3d,0x3d)\n-- -- \n\n-- character table string \nlocal b='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' \n\n-- encoding to base64 \nfunction enc(data) \n return ((data:gsub('.', function(x) \n local r,b='',x:byte() \n for i=8,1,-1 do r=r..(b%2^i-b%2^(i-1)>0 and '1' or '0') end \n return r; \n end)..'0000'):gsub('%d%d%d?%d?%d?%d?', function(x) \n if (#x < 6) then return '' end \n local c=0 \n for i=1,6 do c=c+(x:sub(i,i)=='1' and 2^(6-i) or 0) end \n return b:sub(c+1,c+1) \n end)..({ '', '==', '=' })[#data%3+1]) \nend \n\n-- helper function \nfunction num2bytes(num) \n local retStr=\"\" \n for i=1,2 do \n retStr = retStr .. string.char(num%256) \n num = math.floor(num/256) \n end \n return retStr \nend \n\ntcpSocket = Net.FTcpSocket(tvIpAddress, tvPort) \n\n-- say hello to the TV ;) \nbytes, errorCode = tcpSocket:write(tvAuthString) \n\nkeycodebase = string.char(0x00,0x13,0x00,0x69,0x70,0x68,0x6f,0x6e,0x65,0x2e,0x69,0x61,0x70,0x70,0x2e,0x73,0x61,0x6d,0x73,0x75,0x6e,0x67) \n\n-- payload \npayloadinit = string.char(0x00,0x00,0x00) \nkeycode = enc(keycodestring) \n\nkeycodesize = num2bytes(string.len(keycode)) \n\npayloadsize = num2bytes(string.len(payloadinit .. keycode ..keycodesize)) \n\n-- combining the message \nmessage = keycodebase .. payloadsize .. payloadinit .. keycodesize .. keycode \n\n-- sending keycode \nbytes, errorCode2 = tcpSocket:write(message) \n\n\nif errorCode == 0 and errorCode2 == 0 \nthen \n -- printing log under virtual device \n fibaro:log(\"transfer OK: \" .. keycodestring) \nelse \n fibaro:log(\"transfer failed\") \nend","buttonIcon":0,"favourite":false,"main":false}]},{"type":"button","elements":[{"id":10,"lua":true,"waitForResponse":false,"caption":"7","name":"Button51","empty":false,"msg":"-- -- \ntvIpAddress = \"192.168.1.17\" \ntvPort = 55000 \nkeycodestring = \"KEY_7\" \n\ntvAuthString = string.char(0x00,0x14,0x00,0x69,0x70,0x68,0x6f,0x6e,0x65,0x2e,0x2e,0x69,0x61,0x70,0x70,0x2e,0x73,0x61,0x6d,0x73,0x75,0x6e,0x67,0x38,0x00,0x64,0x00,0x14,0x00,0x4d,0x54,0x6b,0x79,0x4c,0x6a,0x45,0x32,0x4f,0x43,0x34,0x77,0x4c,0x6a,0x45,0x78,0x4d,0x41,0x3d,0x3d,0x18,0x00,0x4e,0x45,0x4d,0x74,0x4e,0x7a,0x49,0x74,0x51,0x6a,0x6b,0x74,0x4e,0x44,0x4d,0x74,0x4d,0x6a,0x51,0x74,0x4f,0x45,0x49,0x3d,0x04,0x00,0x54,0x51,0x3d,0x3d)\n-- -- \n\n-- character table string \nlocal b='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' \n\n-- encoding to base64 \nfunction enc(data) \n return ((data:gsub('.', function(x) \n local r,b='',x:byte() \n for i=8,1,-1 do r=r..(b%2^i-b%2^(i-1)>0 and '1' or '0') end \n return r; \n end)..'0000'):gsub('%d%d%d?%d?%d?%d?', function(x) \n if (#x < 6) then return '' end \n local c=0 \n for i=1,6 do c=c+(x:sub(i,i)=='1' and 2^(6-i) or 0) end \n return b:sub(c+1,c+1) \n end)..({ '', '==', '=' })[#data%3+1]) \nend \n\n-- helper function \nfunction num2bytes(num) \n local retStr=\"\" \n for i=1,2 do \n retStr = retStr .. string.char(num%256) \n num = math.floor(num/256) \n end \n return retStr \nend \n\ntcpSocket = Net.FTcpSocket(tvIpAddress, tvPort) \n\n-- say hello to the TV ;) \nbytes, errorCode = tcpSocket:write(tvAuthString) \n\nkeycodebase = string.char(0x00,0x13,0x00,0x69,0x70,0x68,0x6f,0x6e,0x65,0x2e,0x69,0x61,0x70,0x70,0x2e,0x73,0x61,0x6d,0x73,0x75,0x6e,0x67) \n\n-- payload \npayloadinit = string.char(0x00,0x00,0x00) \nkeycode = enc(keycodestring) \n\nkeycodesize = num2bytes(string.len(keycode)) \n\npayloadsize = num2bytes(string.len(payloadinit .. keycode ..keycodesize)) \n\n-- combining the message \nmessage = keycodebase .. payloadsize .. payloadinit .. keycodesize .. keycode \n\n-- sending keycode \nbytes, errorCode2 = tcpSocket:write(message) \n\n\nif errorCode == 0 and errorCode2 == 0 \nthen \n -- printing log under virtual device \n fibaro:log(\"transfer OK: \" .. keycodestring) \nelse \n fibaro:log(\"transfer failed\") \nend","buttonIcon":0,"favourite":false,"main":false},{"id":11,"lua":true,"waitForResponse":false,"caption":"8","name":"Button52","empty":false,"msg":"-- -- \ntvIpAddress = \"192.168.1.17\" \ntvPort = 55000 \nkeycodestring = \"KEY_8\" \n\ntvAuthString = string.char(0x00,0x14,0x00,0x69,0x70,0x68,0x6f,0x6e,0x65,0x2e,0x2e,0x69,0x61,0x70,0x70,0x2e,0x73,0x61,0x6d,0x73,0x75,0x6e,0x67,0x38,0x00,0x64,0x00,0x14,0x00,0x4d,0x54,0x6b,0x79,0x4c,0x6a,0x45,0x32,0x4f,0x43,0x34,0x77,0x4c,0x6a,0x45,0x78,0x4d,0x41,0x3d,0x3d,0x18,0x00,0x4e,0x45,0x4d,0x74,0x4e,0x7a,0x49,0x74,0x51,0x6a,0x6b,0x74,0x4e,0x44,0x4d,0x74,0x4d,0x6a,0x51,0x74,0x4f,0x45,0x49,0x3d,0x04,0x00,0x54,0x51,0x3d,0x3d)\n-- -- \n\n-- character table string \nlocal b='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' \n\n-- encoding to base64 \nfunction enc(data) \n return ((data:gsub('.', function(x) \n local r,b='',x:byte() \n for i=8,1,-1 do r=r..(b%2^i-b%2^(i-1)>0 and '1' or '0') end \n return r; \n end)..'0000'):gsub('%d%d%d?%d?%d?%d?', function(x) \n if (#x < 6) then return '' end \n local c=0 \n for i=1,6 do c=c+(x:sub(i,i)=='1' and 2^(6-i) or 0) end \n return b:sub(c+1,c+1) \n end)..({ '', '==', '=' })[#data%3+1]) \nend \n\n-- helper function \nfunction num2bytes(num) \n local retStr=\"\" \n for i=1,2 do \n retStr = retStr .. string.char(num%256) \n num = math.floor(num/256) \n end \n return retStr \nend \n\ntcpSocket = Net.FTcpSocket(tvIpAddress, tvPort) \n\n-- say hello to the TV ;) \nbytes, errorCode = tcpSocket:write(tvAuthString) \n\nkeycodebase = string.char(0x00,0x13,0x00,0x69,0x70,0x68,0x6f,0x6e,0x65,0x2e,0x69,0x61,0x70,0x70,0x2e,0x73,0x61,0x6d,0x73,0x75,0x6e,0x67) \n\n-- payload \npayloadinit = string.char(0x00,0x00,0x00) \nkeycode = enc(keycodestring) \n\nkeycodesize = num2bytes(string.len(keycode)) \n\npayloadsize = num2bytes(string.len(payloadinit .. keycode ..keycodesize)) \n\n-- combining the message \nmessage = keycodebase .. payloadsize .. payloadinit .. keycodesize .. keycode \n\n-- sending keycode \nbytes, errorCode2 = tcpSocket:write(message) \n\n\nif errorCode == 0 and errorCode2 == 0 \nthen \n -- printing log under virtual device \n fibaro:log(\"transfer OK: \" .. keycodestring) \nelse \n fibaro:log(\"transfer failed\") \nend","buttonIcon":0,"favourite":false,"main":false},{"id":12,"lua":true,"waitForResponse":false,"caption":"9","name":"Button53","empty":false,"msg":"-- -- \ntvIpAddress = \"192.168.1.17\" \ntvPort = 55000 \nkeycodestring = \"KEY_9\" \n\ntvAuthString = string.char(0x00,0x14,0x00,0x69,0x70,0x68,0x6f,0x6e,0x65,0x2e,0x2e,0x69,0x61,0x70,0x70,0x2e,0x73,0x61,0x6d,0x73,0x75,0x6e,0x67,0x38,0x00,0x64,0x00,0x14,0x00,0x4d,0x54,0x6b,0x79,0x4c,0x6a,0x45,0x32,0x4f,0x43,0x34,0x77,0x4c,0x6a,0x45,0x78,0x4d,0x41,0x3d,0x3d,0x18,0x00,0x4e,0x45,0x4d,0x74,0x4e,0x7a,0x49,0x74,0x51,0x6a,0x6b,0x74,0x4e,0x44,0x4d,0x74,0x4d,0x6a,0x51,0x74,0x4f,0x45,0x49,0x3d,0x04,0x00,0x54,0x51,0x3d,0x3d)\n-- -- \n\n-- character table string \nlocal b='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' \n\n-- encoding to base64 \nfunction enc(data) \n return ((data:gsub('.', function(x) \n local r,b='',x:byte() \n for i=8,1,-1 do r=r..(b%2^i-b%2^(i-1)>0 and '1' or '0') end \n return r; \n end)..'0000'):gsub('%d%d%d?%d?%d?%d?', function(x) \n if (#x < 6) then return '' end \n local c=0 \n for i=1,6 do c=c+(x:sub(i,i)=='1' and 2^(6-i) or 0) end \n return b:sub(c+1,c+1) \n end)..({ '', '==', '=' })[#data%3+1]) \nend \n\n-- helper function \nfunction num2bytes(num) \n local retStr=\"\" \n for i=1,2 do \n retStr = retStr .. string.char(num%256) \n num = math.floor(num/256) \n end \n return retStr \nend \n\ntcpSocket = Net.FTcpSocket(tvIpAddress, tvPort) \n\n-- say hello to the TV ;) \nbytes, errorCode = tcpSocket:write(tvAuthString) \n\nkeycodebase = string.char(0x00,0x13,0x00,0x69,0x70,0x68,0x6f,0x6e,0x65,0x2e,0x69,0x61,0x70,0x70,0x2e,0x73,0x61,0x6d,0x73,0x75,0x6e,0x67) \n\n-- payload \npayloadinit = string.char(0x00,0x00,0x00) \nkeycode = enc(keycodestring) \n\nkeycodesize = num2bytes(string.len(keycode)) \n\npayloadsize = num2bytes(string.len(payloadinit .. keycode ..keycodesize)) \n\n-- combining the message \nmessage = keycodebase .. payloadsize .. payloadinit .. keycodesize .. keycode \n\n-- sending keycode \nbytes, errorCode2 = tcpSocket:write(message) \n\n\nif errorCode == 0 and errorCode2 == 0 \nthen \n -- printing log under virtual device \n fibaro:log(\"transfer OK: \" .. keycodestring) \nelse \n fibaro:log(\"transfer failed\") \nend","buttonIcon":0,"favourite":false,"main":false}]},{"type":"button","elements":[{"id":13,"lua":true,"waitForResponse":false,"caption":"ttx/mix","name":"Button61","empty":false,"msg":"-- -- \ntvIpAddress = \"192.168.1.17\" \ntvPort = 55000 \nkeycodestring = \"KEY_TTX_MIX\" \n\ntvAuthString = string.char(0x00,0x14,0x00,0x69,0x70,0x68,0x6f,0x6e,0x65,0x2e,0x2e,0x69,0x61,0x70,0x70,0x2e,0x73,0x61,0x6d,0x73,0x75,0x6e,0x67,0x38,0x00,0x64,0x00,0x14,0x00,0x4d,0x54,0x6b,0x79,0x4c,0x6a,0x45,0x32,0x4f,0x43,0x34,0x77,0x4c,0x6a,0x45,0x78,0x4d,0x41,0x3d,0x3d,0x18,0x00,0x4e,0x45,0x4d,0x74,0x4e,0x7a,0x49,0x74,0x51,0x6a,0x6b,0x74,0x4e,0x44,0x4d,0x74,0x4d,0x6a,0x51,0x74,0x4f,0x45,0x49,0x3d,0x04,0x00,0x54,0x51,0x3d,0x3d)\n-- -- \n\n-- character table string \nlocal b='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' \n\n-- encoding to base64 \nfunction enc(data) \n return ((data:gsub('.', function(x) \n local r,b='',x:byte() \n for i=8,1,-1 do r=r..(b%2^i-b%2^(i-1)>0 and '1' or '0') end \n return r; \n end)..'0000'):gsub('%d%d%d?%d?%d?%d?', function(x) \n if (#x < 6) then return '' end \n local c=0 \n for i=1,6 do c=c+(x:sub(i,i)=='1' and 2^(6-i) or 0) end \n return b:sub(c+1,c+1) \n end)..({ '', '==', '=' })[#data%3+1]) \nend \n\n-- helper function \nfunction num2bytes(num) \n local retStr=\"\" \n for i=1,2 do \n retStr = retStr .. string.char(num%256) \n num = math.floor(num/256) \n end \n return retStr \nend \n\ntcpSocket = Net.FTcpSocket(tvIpAddress, tvPort) \n\n-- say hello to the TV ;) \nbytes, errorCode = tcpSocket:write(tvAuthString) \n\nkeycodebase = string.char(0x00,0x13,0x00,0x69,0x70,0x68,0x6f,0x6e,0x65,0x2e,0x69,0x61,0x70,0x70,0x2e,0x73,0x61,0x6d,0x73,0x75,0x6e,0x67) \n\n-- payload \npayloadinit = string.char(0x00,0x00,0x00) \nkeycode = enc(keycodestring) \n\nkeycodesize = num2bytes(string.len(keycode)) \n\npayloadsize = num2bytes(string.len(payloadinit .. keycode ..keycodesize)) \n\n-- combining the message \nmessage = keycodebase .. payloadsize .. payloadinit .. keycodesize .. keycode \n\n-- sending keycode \nbytes, errorCode2 = tcpSocket:write(message) \n\n\nif errorCode == 0 and errorCode2 == 0 \nthen \n -- printing log under virtual device \n fibaro:log(\"transfer OK: \" .. keycodestring) \nelse \n fibaro:log(\"transfer failed\") \nend","buttonIcon":0,"favourite":false,"main":false},{"id":14,"lua":true,"waitForResponse":false,"caption":"0","name":"Button62","empty":false,"msg":"-- -- \ntvIpAddress = \"192.168.1.17\" \ntvPort = 55000 \nkeycodestring = \"KEY_0\" \n\ntvAuthString = string.char(0x00,0x14,0x00,0x69,0x70,0x68,0x6f,0x6e,0x65,0x2e,0x2e,0x69,0x61,0x70,0x70,0x2e,0x73,0x61,0x6d,0x73,0x75,0x6e,0x67,0x38,0x00,0x64,0x00,0x14,0x00,0x4d,0x54,0x6b,0x79,0x4c,0x6a,0x45,0x32,0x4f,0x43,0x34,0x77,0x4c,0x6a,0x45,0x78,0x4d,0x41,0x3d,0x3d,0x18,0x00,0x4e,0x45,0x4d,0x74,0x4e,0x7a,0x49,0x74,0x51,0x6a,0x6b,0x74,0x4e,0x44,0x4d,0x74,0x4d,0x6a,0x51,0x74,0x4f,0x45,0x49,0x3d,0x04,0x00,0x54,0x51,0x3d,0x3d)\n-- -- \n\n-- character table string \nlocal b='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' \n\n-- encoding to base64 \nfunction enc(data) \n return ((data:gsub('.', function(x) \n local r,b='',x:byte() \n for i=8,1,-1 do r=r..(b%2^i-b%2^(i-1)>0 and '1' or '0') end \n return r; \n end)..'0000'):gsub('%d%d%d?%d?%d?%d?', function(x) \n if (#x < 6) then return '' end \n local c=0 \n for i=1,6 do c=c+(x:sub(i,i)=='1' and 2^(6-i) or 0) end \n return b:sub(c+1,c+1) \n end)..({ '', '==', '=' })[#data%3+1]) \nend \n\n-- helper function \nfunction num2bytes(num) \n local retStr=\"\" \n for i=1,2 do \n retStr = retStr .. string.char(num%256) \n num = math.floor(num/256) \n end \n return retStr \nend \n\ntcpSocket = Net.FTcpSocket(tvIpAddress, tvPort) \n\n-- say hello to the TV ;) \nbytes, errorCode = tcpSocket:write(tvAuthString) \n\nkeycodebase = string.char(0x00,0x13,0x00,0x69,0x70,0x68,0x6f,0x6e,0x65,0x2e,0x69,0x61,0x70,0x70,0x2e,0x73,0x61,0x6d,0x73,0x75,0x6e,0x67) \n\n-- payload \npayloadinit = string.char(0x00,0x00,0x00) \nkeycode = enc(keycodestring) \n\nkeycodesize = num2bytes(string.len(keycode)) \n\npayloadsize = num2bytes(string.len(payloadinit .. keycode ..keycodesize)) \n\n-- combining the message \nmessage = keycodebase .. payloadsize .. payloadinit .. keycodesize .. keycode \n\n-- sending keycode \nbytes, errorCode2 = tcpSocket:write(message) \n\n\nif errorCode == 0 and errorCode2 == 0 \nthen \n -- printing log under virtual device \n fibaro:log(\"transfer OK: \" .. keycodestring) \nelse \n fibaro:log(\"transfer failed\") \nend","buttonIcon":0,"favourite":false,"main":false},{"id":15,"lua":true,"waitForResponse":false,"caption":"pre-ch","name":"Button63","empty":false,"msg":"-- -- \ntvIpAddress = \"192.168.1.17\" \ntvPort = 55000 \nkeycodestring = \"KEY_PRECH\" \n\ntvAuthString = string.char(0x00,0x14,0x00,0x69,0x70,0x68,0x6f,0x6e,0x65,0x2e,0x2e,0x69,0x61,0x70,0x70,0x2e,0x73,0x61,0x6d,0x73,0x75,0x6e,0x67,0x38,0x00,0x64,0x00,0x14,0x00,0x4d,0x54,0x6b,0x79,0x4c,0x6a,0x45,0x32,0x4f,0x43,0x34,0x77,0x4c,0x6a,0x45,0x78,0x4d,0x41,0x3d,0x3d,0x18,0x00,0x4e,0x45,0x4d,0x74,0x4e,0x7a,0x49,0x74,0x51,0x6a,0x6b,0x74,0x4e,0x44,0x4d,0x74,0x4d,0x6a,0x51,0x74,0x4f,0x45,0x49,0x3d,0x04,0x00,0x54,0x51,0x3d,0x3d)\n-- -- \n\n-- character table string \nlocal b='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' \n\n-- encoding to base64 \nfunction enc(data) \n return ((data:gsub('.', function(x) \n local r,b='',x:byte() \n for i=8,1,-1 do r=r..(b%2^i-b%2^(i-1)>0 and '1' or '0') end \n return r; \n end)..'0000'):gsub('%d%d%d?%d?%d?%d?', function(x) \n if (#x < 6) then return '' end \n local c=0 \n for i=1,6 do c=c+(x:sub(i,i)=='1' and 2^(6-i) or 0) end \n return b:sub(c+1,c+1) \n end)..({ '', '==', '=' })[#data%3+1]) \nend \n\n-- helper function \nfunction num2bytes(num) \n local retStr=\"\" \n for i=1,2 do \n retStr = retStr .. string.char(num%256) \n num = math.floor(num/256) \n end \n return retStr \nend \n\ntcpSocket = Net.FTcpSocket(tvIpAddress, tvPort) \n\n-- say hello to the TV ;) \nbytes, errorCode = tcpSocket:write(tvAuthString) \n\nkeycodebase = string.char(0x00,0x13,0x00,0x69,0x70,0x68,0x6f,0x6e,0x65,0x2e,0x69,0x61,0x70,0x70,0x2e,0x73,0x61,0x6d,0x73,0x75,0x6e,0x67) \n\n-- payload \npayloadinit = string.char(0x00,0x00,0x00) \nkeycode = enc(keycodestring) \n\nkeycodesize = num2bytes(string.len(keycode)) \n\npayloadsize = num2bytes(string.len(payloadinit .. keycode ..keycodesize)) \n\n-- combining the message \nmessage = keycodebase .. payloadsize .. payloadinit .. keycodesize .. keycode \n\n-- sending keycode \nbytes, errorCode2 = tcpSocket:write(message) \n\n\nif errorCode == 0 and errorCode2 == 0 \nthen \n -- printing log under virtual device \n fibaro:log(\"transfer OK: \" .. keycodestring) \nelse \n fibaro:log(\"transfer failed\") \nend","buttonIcon":0,"favourite":false,"main":false}]},{"type":"button","elements":[{"id":16,"lua":true,"waitForResponse":false,"caption":"Vol +","name":"Button71","empty":false,"msg":"-- -- \ntvIpAddress = \"192.168.1.17\" \ntvPort = 55000 \nkeycodestring = \"KEY_VOLUP\" \n\ntvAuthString = string.char(0x00,0x14,0x00,0x69,0x70,0x68,0x6f,0x6e,0x65,0x2e,0x2e,0x69,0x61,0x70,0x70,0x2e,0x73,0x61,0x6d,0x73,0x75,0x6e,0x67,0x38,0x00,0x64,0x00,0x14,0x00,0x4d,0x54,0x6b,0x79,0x4c,0x6a,0x45,0x32,0x4f,0x43,0x34,0x77,0x4c,0x6a,0x45,0x78,0x4d,0x41,0x3d,0x3d,0x18,0x00,0x4e,0x45,0x4d,0x74,0x4e,0x7a,0x49,0x74,0x51,0x6a,0x6b,0x74,0x4e,0x44,0x4d,0x74,0x4d,0x6a,0x51,0x74,0x4f,0x45,0x49,0x3d,0x04,0x00,0x54,0x51,0x3d,0x3d)\n-- -- \n\n-- character table string \nlocal b='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' \n\n-- encoding to base64 \nfunction enc(data) \n return ((data:gsub('.', function(x) \n local r,b='',x:byte() \n for i=8,1,-1 do r=r..(b%2^i-b%2^(i-1)>0 and '1' or '0') end \n return r; \n end)..'0000'):gsub('%d%d%d?%d?%d?%d?', function(x) \n if (#x < 6) then return '' end \n local c=0 \n for i=1,6 do c=c+(x:sub(i,i)=='1' and 2^(6-i) or 0) end \n return b:sub(c+1,c+1) \n end)..({ '', '==', '=' })[#data%3+1]) \nend \n\n-- helper function \nfunction num2bytes(num) \n local retStr=\"\" \n for i=1,2 do \n retStr = retStr .. string.char(num%256) \n num = math.floor(num/256) \n end \n return retStr \nend \n\ntcpSocket = Net.FTcpSocket(tvIpAddress, tvPort) \n\n-- say hello to the TV ;) \nbytes, errorCode = tcpSocket:write(tvAuthString) \n\nkeycodebase = string.char(0x00,0x13,0x00,0x69,0x70,0x68,0x6f,0x6e,0x65,0x2e,0x69,0x61,0x70,0x70,0x2e,0x73,0x61,0x6d,0x73,0x75,0x6e,0x67) \n\n-- payload \npayloadinit = string.char(0x00,0x00,0x00) \nkeycode = enc(keycodestring) \n\nkeycodesize = num2bytes(string.len(keycode)) \n\npayloadsize = num2bytes(string.len(payloadinit .. keycode ..keycodesize)) \n\n-- combining the message \nmessage = keycodebase .. payloadsize .. payloadinit .. keycodesize .. keycode \n\n-- sending keycode \nbytes, errorCode2 = tcpSocket:write(message) \n\n\nif errorCode == 0 and errorCode2 == 0 \nthen \n -- printing log under virtual device \n fibaro:log(\"transfer OK: \" .. keycodestring) \nelse \n fibaro:log(\"transfer failed\") \nend","buttonIcon":0,"favourite":false,"main":false},{"id":17,"lua":true,"waitForResponse":false,"caption":"Mute","name":"Button72","empty":false,"msg":"-- -- \ntvIpAddress = \"192.168.1.17\" \ntvPort = 55000 \nkeycodestring = \"KEY_MUTE\" \n\ntvAuthString = string.char(0x00,0x14,0x00,0x69,0x70,0x68,0x6f,0x6e,0x65,0x2e,0x2e,0x69,0x61,0x70,0x70,0x2e,0x73,0x61,0x6d,0x73,0x75,0x6e,0x67,0x38,0x00,0x64,0x00,0x14,0x00,0x4d,0x54,0x6b,0x79,0x4c,0x6a,0x45,0x32,0x4f,0x43,0x34,0x77,0x4c,0x6a,0x45,0x78,0x4d,0x41,0x3d,0x3d,0x18,0x00,0x4e,0x45,0x4d,0x74,0x4e,0x7a,0x49,0x74,0x51,0x6a,0x6b,0x74,0x4e,0x44,0x4d,0x74,0x4d,0x6a,0x51,0x74,0x4f,0x45,0x49,0x3d,0x04,0x00,0x54,0x51,0x3d,0x3d)\n-- -- \n\n-- character table string \nlocal b='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' \n\n-- encoding to base64 \nfunction enc(data) \n return ((data:gsub('.', function(x) \n local r,b='',x:byte() \n for i=8,1,-1 do r=r..(b%2^i-b%2^(i-1)>0 and '1' or '0') end \n return r; \n end)..'0000'):gsub('%d%d%d?%d?%d?%d?', function(x) \n if (#x < 6) then return '' end \n local c=0 \n for i=1,6 do c=c+(x:sub(i,i)=='1' and 2^(6-i) or 0) end \n return b:sub(c+1,c+1) \n end)..({ '', '==', '=' })[#data%3+1]) \nend \n\n-- helper function \nfunction num2bytes(num) \n local retStr=\"\" \n for i=1,2 do \n retStr = retStr .. string.char(num%256) \n num = math.floor(num/256) \n end \n return retStr \nend \n\ntcpSocket = Net.FTcpSocket(tvIpAddress, tvPort) \n\n-- say hello to the TV ;) \nbytes, errorCode = tcpSocket:write(tvAuthString) \n\nkeycodebase = string.char(0x00,0x13,0x00,0x69,0x70,0x68,0x6f,0x6e,0x65,0x2e,0x69,0x61,0x70,0x70,0x2e,0x73,0x61,0x6d,0x73,0x75,0x6e,0x67) \n\n-- payload \npayloadinit = string.char(0x00,0x00,0x00) \nkeycode = enc(keycodestring) \n\nkeycodesize = num2bytes(string.len(keycode)) \n\npayloadsize = num2bytes(string.len(payloadinit .. keycode ..keycodesize)) \n\n-- combining the message \nmessage = keycodebase .. payloadsize .. payloadinit .. keycodesize .. keycode \n\n-- sending keycode \nbytes, errorCode2 = tcpSocket:write(message) \n\n\nif errorCode == 0 and errorCode2 == 0 \nthen \n -- printing log under virtual device \n fibaro:log(\"transfer OK: \" .. keycodestring) \nelse \n fibaro:log(\"transfer failed\") \nend","buttonIcon":0,"favourite":false,"main":false},{"id":18,"lua":true,"waitForResponse":false,"caption":"Ch +","name":"Button73","empty":false,"msg":"-- -- \ntvIpAddress = \"192.168.1.17\" \ntvPort = 55000 \nkeycodestring = \"KEY_CHUP\" \n\ntvAuthString = string.char(0x00,0x14,0x00,0x69,0x70,0x68,0x6f,0x6e,0x65,0x2e,0x2e,0x69,0x61,0x70,0x70,0x2e,0x73,0x61,0x6d,0x73,0x75,0x6e,0x67,0x38,0x00,0x64,0x00,0x14,0x00,0x4d,0x54,0x6b,0x79,0x4c,0x6a,0x45,0x32,0x4f,0x43,0x34,0x77,0x4c,0x6a,0x45,0x78,0x4d,0x41,0x3d,0x3d,0x18,0x00,0x4e,0x45,0x4d,0x74,0x4e,0x7a,0x49,0x74,0x51,0x6a,0x6b,0x74,0x4e,0x44,0x4d,0x74,0x4d,0x6a,0x51,0x74,0x4f,0x45,0x49,0x3d,0x04,0x00,0x54,0x51,0x3d,0x3d)\n-- -- \n\n-- character table string \nlocal b='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' \n\n-- encoding to base64 \nfunction enc(data) \n return ((data:gsub('.', function(x) \n local r,b='',x:byte() \n for i=8,1,-1 do r=r..(b%2^i-b%2^(i-1)>0 and '1' or '0') end \n return r; \n end)..'0000'):gsub('%d%d%d?%d?%d?%d?', function(x) \n if (#x < 6) then return '' end \n local c=0 \n for i=1,6 do c=c+(x:sub(i,i)=='1' and 2^(6-i) or 0) end \n return b:sub(c+1,c+1) \n end)..({ '', '==', '=' })[#data%3+1]) \nend \n\n-- helper function \nfunction num2bytes(num) \n local retStr=\"\" \n for i=1,2 do \n retStr = retStr .. string.char(num%256) \n num = math.floor(num/256) \n end \n return retStr \nend \n\ntcpSocket = Net.FTcpSocket(tvIpAddress, tvPort) \n\n-- say hello to the TV ;) \nbytes, errorCode = tcpSocket:write(tvAuthString) \n\nkeycodebase = string.char(0x00,0x13,0x00,0x69,0x70,0x68,0x6f,0x6e,0x65,0x2e,0x69,0x61,0x70,0x70,0x2e,0x73,0x61,0x6d,0x73,0x75,0x6e,0x67) \n\n-- payload \npayloadinit = string.char(0x00,0x00,0x00) \nkeycode = enc(keycodestring) \n\nkeycodesize = num2bytes(string.len(keycode)) \n\npayloadsize = num2bytes(string.len(payloadinit .. keycode ..keycodesize)) \n\n-- combining the message \nmessage = keycodebase .. payloadsize .. payloadinit .. keycodesize .. keycode \n\n-- sending keycode \nbytes, errorCode2 = tcpSocket:write(message) \n\n\nif errorCode == 0 and errorCode2 == 0 \nthen \n -- printing log under virtual device \n fibaro:log(\"transfer OK: \" .. keycodestring) \nelse \n fibaro:log(\"transfer failed\") \nend","buttonIcon":0,"favourite":false,"main":false}]},{"type":"button","elements":[{"id":19,"lua":true,"waitForResponse":false,"caption":"Vol -","name":"Button81","empty":false,"msg":"-- -- \ntvIpAddress = \"192.168.1.17\" \ntvPort = 55000 \nkeycodestring = \"KEY_VOLDOWN\" \n\ntvAuthString = string.char(0x00,0x14,0x00,0x69,0x70,0x68,0x6f,0x6e,0x65,0x2e,0x2e,0x69,0x61,0x70,0x70,0x2e,0x73,0x61,0x6d,0x73,0x75,0x6e,0x67,0x38,0x00,0x64,0x00,0x14,0x00,0x4d,0x54,0x6b,0x79,0x4c,0x6a,0x45,0x32,0x4f,0x43,0x34,0x77,0x4c,0x6a,0x45,0x78,0x4d,0x41,0x3d,0x3d,0x18,0x00,0x4e,0x45,0x4d,0x74,0x4e,0x7a,0x49,0x74,0x51,0x6a,0x6b,0x74,0x4e,0x44,0x4d,0x74,0x4d,0x6a,0x51,0x74,0x4f,0x45,0x49,0x3d,0x04,0x00,0x54,0x51,0x3d,0x3d)\n-- -- \n\n-- character table string \nlocal b='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' \n\n-- encoding to base64 \nfunction enc(data) \n return ((data:gsub('.', function(x) \n local r,b='',x:byte() \n for i=8,1,-1 do r=r..(b%2^i-b%2^(i-1)>0 and '1' or '0') end \n return r; \n end)..'0000'):gsub('%d%d%d?%d?%d?%d?', function(x) \n if (#x < 6) then return '' end \n local c=0 \n for i=1,6 do c=c+(x:sub(i,i)=='1' and 2^(6-i) or 0) end \n return b:sub(c+1,c+1) \n end)..({ '', '==', '=' })[#data%3+1]) \nend \n\n-- helper function \nfunction num2bytes(num) \n local retStr=\"\" \n for i=1,2 do \n retStr = retStr .. string.char(num%256) \n num = math.floor(num/256) \n end \n return retStr \nend \n\ntcpSocket = Net.FTcpSocket(tvIpAddress, tvPort) \n\n-- say hello to the TV ;) \nbytes, errorCode = tcpSocket:write(tvAuthString) \n\nkeycodebase = string.char(0x00,0x13,0x00,0x69,0x70,0x68,0x6f,0x6e,0x65,0x2e,0x69,0x61,0x70,0x70,0x2e,0x73,0x61,0x6d,0x73,0x75,0x6e,0x67) \n\n-- payload \npayloadinit = string.char(0x00,0x00,0x00) \nkeycode = enc(keycodestring) \n\nkeycodesize = num2bytes(string.len(keycode)) \n\npayloadsize = num2bytes(string.len(payloadinit .. keycode ..keycodesize)) \n\n-- combining the message \nmessage = keycodebase .. payloadsize .. payloadinit .. keycodesize .. keycode \n\n-- sending keycode \nbytes, errorCode2 = tcpSocket:write(message) \n\n\nif errorCode == 0 and errorCode2 == 0 \nthen \n -- printing log under virtual device \n fibaro:log(\"transfer OK: \" .. keycodestring) \nelse \n fibaro:log(\"transfer failed\") \nend","buttonIcon":0,"favourite":false,"main":false},{"id":20,"lua":true,"waitForResponse":false,"caption":"ch list","name":"Button82","empty":false,"msg":"KEY_CH_LIST\n-- -- \ntvIpAddress = \"192.168.1.17\" \ntvPort = 55000 \nkeycodestring = \"KEY_CHLIST\" \n\ntvAuthString = string.char(0x00,0x14,0x00,0x69,0x70,0x68,0x6f,0x6e,0x65,0x2e,0x2e,0x69,0x61,0x70,0x70,0x2e,0x73,0x61,0x6d,0x73,0x75,0x6e,0x67,0x38,0x00,0x64,0x00,0x14,0x00,0x4d,0x54,0x6b,0x79,0x4c,0x6a,0x45,0x32,0x4f,0x43,0x34,0x77,0x4c,0x6a,0x45,0x78,0x4d,0x41,0x3d,0x3d,0x18,0x00,0x4e,0x45,0x4d,0x74,0x4e,0x7a,0x49,0x74,0x51,0x6a,0x6b,0x74,0x4e,0x44,0x4d,0x74,0x4d,0x6a,0x51,0x74,0x4f,0x45,0x49,0x3d,0x04,0x00,0x54,0x51,0x3d,0x3d)\n-- -- \n\n-- character table string \nlocal b='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' \n\n-- encoding to base64 \nfunction enc(data) \n return ((data:gsub('.', function(x) \n local r,b='',x:byte() \n for i=8,1,-1 do r=r..(b%2^i-b%2^(i-1)>0 and '1' or '0') end \n return r; \n end)..'0000'):gsub('%d%d%d?%d?%d?%d?', function(x) \n if (#x < 6) then return '' end \n local c=0 \n for i=1,6 do c=c+(x:sub(i,i)=='1' and 2^(6-i) or 0) end \n return b:sub(c+1,c+1) \n end)..({ '', '==', '=' })[#data%3+1]) \nend \n\n-- helper function \nfunction num2bytes(num) \n local retStr=\"\" \n for i=1,2 do \n retStr = retStr .. string.char(num%256) \n num = math.floor(num/256) \n end \n return retStr \nend \n\ntcpSocket = Net.FTcpSocket(tvIpAddress, tvPort) \n\n-- say hello to the TV ;) \nbytes, errorCode = tcpSocket:write(tvAuthString) \n\nkeycodebase = string.char(0x00,0x13,0x00,0x69,0x70,0x68,0x6f,0x6e,0x65,0x2e,0x69,0x61,0x70,0x70,0x2e,0x73,0x61,0x6d,0x73,0x75,0x6e,0x67) \n\n-- payload \npayloadinit = string.char(0x00,0x00,0x00) \nkeycode = enc(keycodestring) \n\nkeycodesize = num2bytes(string.len(keycode)) \n\npayloadsize = num2bytes(string.len(payloadinit .. keycode ..keycodesize)) \n\n-- combining the message \nmessage = keycodebase .. payloadsize .. payloadinit .. keycodesize .. keycode \n\n-- sending keycode \nbytes, errorCode2 = tcpSocket:write(message) \n\n\nif errorCode == 0 and errorCode2 == 0 \nthen \n -- printing log under virtual device \n fibaro:log(\"transfer OK: \" .. keycodestring) \nelse \n fibaro:log(\"transfer failed\") \nend","buttonIcon":0,"favourite":false,"main":false},{"id":21,"lua":true,"waitForResponse":false,"caption":"Ch -","name":"Button83","empty":false,"msg":"-- -- \ntvIpAddress = \"192.168.1.17\" \ntvPort = 55000 \nkeycodestring = \"KEY_CHDOWN\" \n\ntvAuthString = string.char(0x00,0x14,0x00,0x69,0x70,0x68,0x6f,0x6e,0x65,0x2e,0x2e,0x69,0x61,0x70,0x70,0x2e,0x73,0x61,0x6d,0x73,0x75,0x6e,0x67,0x38,0x00,0x64,0x00,0x14,0x00,0x4d,0x54,0x6b,0x79,0x4c,0x6a,0x45,0x32,0x4f,0x43,0x34,0x77,0x4c,0x6a,0x45,0x78,0x4d,0x41,0x3d,0x3d,0x18,0x00,0x4e,0x45,0x4d,0x74,0x4e,0x7a,0x49,0x74,0x51,0x6a,0x6b,0x74,0x4e,0x44,0x4d,0x74,0x4d,0x6a,0x51,0x74,0x4f,0x45,0x49,0x3d,0x04,0x00,0x54,0x51,0x3d,0x3d)\n-- -- \n\n-- character table string \nlocal b='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' \n\n-- encoding to base64 \nfunction enc(data) \n return ((data:gsub('.', function(x) \n local r,b='',x:byte() \n for i=8,1,-1 do r=r..(b%2^i-b%2^(i-1)>0 and '1' or '0') end \n return r; \n end)..'0000'):gsub('%d%d%d?%d?%d?%d?', function(x) \n if (#x < 6) then return '' end \n local c=0 \n for i=1,6 do c=c+(x:sub(i,i)=='1' and 2^(6-i) or 0) end \n return b:sub(c+1,c+1) \n end)..({ '', '==', '=' })[#data%3+1]) \nend \n\n-- helper function \nfunction num2bytes(num) \n local retStr=\"\" \n for i=1,2 do \n retStr = retStr .. string.char(num%256) \n num = math.floor(num/256) \n end \n return retStr \nend \n\ntcpSocket = Net.FTcpSocket(tvIpAddress, tvPort) \n\n-- say hello to the TV ;) \nbytes, errorCode = tcpSocket:write(tvAuthString) \n\nkeycodebase = string.char(0x00,0x13,0x00,0x69,0x70,0x68,0x6f,0x6e,0x65,0x2e,0x69,0x61,0x70,0x70,0x2e,0x73,0x61,0x6d,0x73,0x75,0x6e,0x67) \n\n-- payload \npayloadinit = string.char(0x00,0x00,0x00) \nkeycode = enc(keycodestring) \n\nkeycodesize = num2bytes(string.len(keycode)) \n\npayloadsize = num2bytes(string.len(payloadinit .. keycode ..keycodesize)) \n\n-- combining the message \nmessage = keycodebase .. payloadsize .. payloadinit .. keycodesize .. keycode \n\n-- sending keycode \nbytes, errorCode2 = tcpSocket:write(message) \n\n\nif errorCode == 0 and errorCode2 == 0 \nthen \n -- printing log under virtual device \n fibaro:log(\"transfer OK: \" .. keycodestring) \nelse \n fibaro:log(\"transfer failed\") \nend","buttonIcon":0,"favourite":false,"main":false}]},{"type":"button","elements":[{"id":22,"lua":true,"waitForResponse":false,"caption":"Menu","name":"Button91","empty":false,"msg":"-- -- \ntvIpAddress = \"192.168.1.17\" \ntvPort = 55000 \nkeycodestring = \"KEY_MENU\" \n\ntvAuthString = string.char(0x00,0x14,0x00,0x69,0x70,0x68,0x6f,0x6e,0x65,0x2e,0x2e,0x69,0x61,0x70,0x70,0x2e,0x73,0x61,0x6d,0x73,0x75,0x6e,0x67,0x38,0x00,0x64,0x00,0x14,0x00,0x4d,0x54,0x6b,0x79,0x4c,0x6a,0x45,0x32,0x4f,0x43,0x34,0x77,0x4c,0x6a,0x45,0x78,0x4d,0x41,0x3d,0x3d,0x18,0x00,0x4e,0x45,0x4d,0x74,0x4e,0x7a,0x49,0x74,0x51,0x6a,0x6b,0x74,0x4e,0x44,0x4d,0x74,0x4d,0x6a,0x51,0x74,0x4f,0x45,0x49,0x3d,0x04,0x00,0x54,0x51,0x3d,0x3d)\n-- -- \n\n-- character table string \nlocal b='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' \n\n-- encoding to base64 \nfunction enc(data) \n return ((data:gsub('.', function(x) \n local r,b='',x:byte() \n for i=8,1,-1 do r=r..(b%2^i-b%2^(i-1)>0 and '1' or '0') end \n return r; \n end)..'0000'):gsub('%d%d%d?%d?%d?%d?', function(x) \n if (#x < 6) then return '' end \n local c=0 \n for i=1,6 do c=c+(x:sub(i,i)=='1' and 2^(6-i) or 0) end \n return b:sub(c+1,c+1) \n end)..({ '', '==', '=' })[#data%3+1]) \nend \n\n-- helper function \nfunction num2bytes(num) \n local retStr=\"\" \n for i=1,2 do \n retStr = retStr .. string.char(num%256) \n num = math.floor(num/256) \n end \n return retStr \nend \n\ntcpSocket = Net.FTcpSocket(tvIpAddress, tvPort) \n\n-- say hello to the TV ;) \nbytes, errorCode = tcpSocket:write(tvAuthString) \n\nkeycodebase = string.char(0x00,0x13,0x00,0x69,0x70,0x68,0x6f,0x6e,0x65,0x2e,0x69,0x61,0x70,0x70,0x2e,0x73,0x61,0x6d,0x73,0x75,0x6e,0x67) \n\n-- payload \npayloadinit = string.char(0x00,0x00,0x00) \nkeycode = enc(keycodestring) \n\nkeycodesize = num2bytes(string.len(keycode)) \n\npayloadsize = num2bytes(string.len(payloadinit .. keycode ..keycodesize)) \n\n-- combining the message \nmessage = keycodebase .. payloadsize .. payloadinit .. keycodesize .. keycode \n\n-- sending keycode \nbytes, errorCode2 = tcpSocket:write(message) \n\n\nif errorCode == 0 and errorCode2 == 0 \nthen \n -- printing log under virtual device \n fibaro:log(\"transfer OK: \" .. keycodestring) \nelse \n fibaro:log(\"transfer failed\") \nend","buttonIcon":0,"favourite":false,"main":false},{"id":23,"lua":true,"waitForResponse":false,"caption":"Smart","name":"Button92","empty":false,"msg":"-- -- \ntvIpAddress = \"192.168.1.17\" \ntvPort = 55000 \nkeycodestring = \"KEY_RSS\" \n\ntvAuthString = string.char(0x00,0x14,0x00,0x69,0x70,0x68,0x6f,0x6e,0x65,0x2e,0x2e,0x69,0x61,0x70,0x70,0x2e,0x73,0x61,0x6d,0x73,0x75,0x6e,0x67,0x38,0x00,0x64,0x00,0x14,0x00,0x4d,0x54,0x6b,0x79,0x4c,0x6a,0x45,0x32,0x4f,0x43,0x34,0x77,0x4c,0x6a,0x45,0x78,0x4d,0x41,0x3d,0x3d,0x18,0x00,0x4e,0x45,0x4d,0x74,0x4e,0x7a,0x49,0x74,0x51,0x6a,0x6b,0x74,0x4e,0x44,0x4d,0x74,0x4d,0x6a,0x51,0x74,0x4f,0x45,0x49,0x3d,0x04,0x00,0x54,0x51,0x3d,0x3d)\n-- -- \n\n-- character table string \nlocal b='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' \n\n-- encoding to base64 \nfunction enc(data) \n return ((data:gsub('.', function(x) \n local r,b='',x:byte() \n for i=8,1,-1 do r=r..(b%2^i-b%2^(i-1)>0 and '1' or '0') end \n return r; \n end)..'0000'):gsub('%d%d%d?%d?%d?%d?', function(x) \n if (#x < 6) then return '' end \n local c=0 \n for i=1,6 do c=c+(x:sub(i,i)=='1' and 2^(6-i) or 0) end \n return b:sub(c+1,c+1) \n end)..({ '', '==', '=' })[#data%3+1]) \nend \n\n-- helper function \nfunction num2bytes(num) \n local retStr=\"\" \n for i=1,2 do \n retStr = retStr .. string.char(num%256) \n num = math.floor(num/256) \n end \n return retStr \nend \n\ntcpSocket = Net.FTcpSocket(tvIpAddress, tvPort) \n\n-- say hello to the TV ;) \nbytes, errorCode = tcpSocket:write(tvAuthString) \n\nkeycodebase = string.char(0x00,0x13,0x00,0x69,0x70,0x68,0x6f,0x6e,0x65,0x2e,0x69,0x61,0x70,0x70,0x2e,0x73,0x61,0x6d,0x73,0x75,0x6e,0x67) \n\n-- payload \npayloadinit = string.char(0x00,0x00,0x00) \nkeycode = enc(keycodestring) \n\nkeycodesize = num2bytes(string.len(keycode)) \n\npayloadsize = num2bytes(string.len(payloadinit .. keycode ..keycodesize)) \n\n-- combining the message \nmessage = keycodebase .. payloadsize .. payloadinit .. keycodesize .. keycode \n\n-- sending keycode \nbytes, errorCode2 = tcpSocket:write(message) \n\n\nif errorCode == 0 and errorCode2 == 0 \nthen \n -- printing log under virtual device \n fibaro:log(\"transfer OK: \" .. keycodestring) \nelse \n fibaro:log(\"transfer failed\") \nend","buttonIcon":0,"favourite":false,"main":false},{"id":24,"lua":true,"waitForResponse":false,"caption":"Guide","name":"Button93","empty":false,"msg":"-- -- \ntvIpAddress = \"192.168.1.17\" \ntvPort = 55000 \nkeycodestring = \"KEY_GUIDE\" \n\ntvAuthString = string.char(0x00,0x14,0x00,0x69,0x70,0x68,0x6f,0x6e,0x65,0x2e,0x2e,0x69,0x61,0x70,0x70,0x2e,0x73,0x61,0x6d,0x73,0x75,0x6e,0x67,0x38,0x00,0x64,0x00,0x14,0x00,0x4d,0x54,0x6b,0x79,0x4c,0x6a,0x45,0x32,0x4f,0x43,0x34,0x77,0x4c,0x6a,0x45,0x78,0x4d,0x41,0x3d,0x3d,0x18,0x00,0x4e,0x45,0x4d,0x74,0x4e,0x7a,0x49,0x74,0x51,0x6a,0x6b,0x74,0x4e,0x44,0x4d,0x74,0x4d,0x6a,0x51,0x74,0x4f,0x45,0x49,0x3d,0x04,0x00,0x54,0x51,0x3d,0x3d)\n-- -- \n\n-- character table string \nlocal b='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' \n\n-- encoding to base64 \nfunction enc(data) \n return ((data:gsub('.', function(x) \n local r,b='',x:byte() \n for i=8,1,-1 do r=r..(b%2^i-b%2^(i-1)>0 and '1' or '0') end \n return r; \n end)..'0000'):gsub('%d%d%d?%d?%d?%d?', function(x) \n if (#x < 6) then return '' end \n local c=0 \n for i=1,6 do c=c+(x:sub(i,i)=='1' and 2^(6-i) or 0) end \n return b:sub(c+1,c+1) \n end)..({ '', '==', '=' })[#data%3+1]) \nend \n\n-- helper function \nfunction num2bytes(num) \n local retStr=\"\" \n for i=1,2 do \n retStr = retStr .. string.char(num%256) \n num = math.floor(num/256) \n end \n return retStr \nend \n\ntcpSocket = Net.FTcpSocket(tvIpAddress, tvPort) \n\n-- say hello to the TV ;) \nbytes, errorCode = tcpSocket:write(tvAuthString) \n\nkeycodebase = string.char(0x00,0x13,0x00,0x69,0x70,0x68,0x6f,0x6e,0x65,0x2e,0x69,0x61,0x70,0x70,0x2e,0x73,0x61,0x6d,0x73,0x75,0x6e,0x67) \n\n-- payload \npayloadinit = string.char(0x00,0x00,0x00) \nkeycode = enc(keycodestring) \n\nkeycodesize = num2bytes(string.len(keycode)) \n\npayloadsize = num2bytes(string.len(payloadinit .. keycode ..keycodesize)) \n\n-- combining the message \nmessage = keycodebase .. payloadsize .. payloadinit .. keycodesize .. keycode \n\n-- sending keycode \nbytes, errorCode2 = tcpSocket:write(message) \n\n\nif errorCode == 0 and errorCode2 == 0 \nthen \n -- printing log under virtual device \n fibaro:log(\"transfer OK: \" .. keycodestring) \nelse \n fibaro:log(\"transfer failed\") \nend","buttonIcon":0,"favourite":false,"main":false}]},{"type":"button","elements":[{"id":25,"lua":true,"waitForResponse":false,"caption":"Tools","name":"Button101","empty":false,"msg":"-- -- \ntvIpAddress = \"192.168.1.17\" \ntvPort = 55000 \nkeycodestring = \"KEY_TOOLS\" \n\ntvAuthString = string.char(0x00,0x14,0x00,0x69,0x70,0x68,0x6f,0x6e,0x65,0x2e,0x2e,0x69,0x61,0x70,0x70,0x2e,0x73,0x61,0x6d,0x73,0x75,0x6e,0x67,0x38,0x00,0x64,0x00,0x14,0x00,0x4d,0x54,0x6b,0x79,0x4c,0x6a,0x45,0x32,0x4f,0x43,0x34,0x77,0x4c,0x6a,0x45,0x78,0x4d,0x41,0x3d,0x3d,0x18,0x00,0x4e,0x45,0x4d,0x74,0x4e,0x7a,0x49,0x74,0x51,0x6a,0x6b,0x74,0x4e,0x44,0x4d,0x74,0x4d,0x6a,0x51,0x74,0x4f,0x45,0x49,0x3d,0x04,0x00,0x54,0x51,0x3d,0x3d)\n-- -- \n\n-- character table string \nlocal b='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' \n\n-- encoding to base64 \nfunction enc(data) \n return ((data:gsub('.', function(x) \n local r,b='',x:byte() \n for i=8,1,-1 do r=r..(b%2^i-b%2^(i-1)>0 and '1' or '0') end \n return r; \n end)..'0000'):gsub('%d%d%d?%d?%d?%d?', function(x) \n if (#x < 6) then return '' end \n local c=0 \n for i=1,6 do c=c+(x:sub(i,i)=='1' and 2^(6-i) or 0) end \n return b:sub(c+1,c+1) \n end)..({ '', '==', '=' })[#data%3+1]) \nend \n\n-- helper function \nfunction num2bytes(num) \n local retStr=\"\" \n for i=1,2 do \n retStr = retStr .. string.char(num%256) \n num = math.floor(num/256) \n end \n return retStr \nend \n\ntcpSocket = Net.FTcpSocket(tvIpAddress, tvPort) \n\n-- say hello to the TV ;) \nbytes, errorCode = tcpSocket:write(tvAuthString) \n\nkeycodebase = string.char(0x00,0x13,0x00,0x69,0x70,0x68,0x6f,0x6e,0x65,0x2e,0x69,0x61,0x70,0x70,0x2e,0x73,0x61,0x6d,0x73,0x75,0x6e,0x67) \n\n-- payload \npayloadinit = string.char(0x00,0x00,0x00) \nkeycode = enc(keycodestring) \n\nkeycodesize = num2bytes(string.len(keycode)) \n\npayloadsize = num2bytes(string.len(payloadinit .. keycode ..keycodesize)) \n\n-- combining the message \nmessage = keycodebase .. payloadsize .. payloadinit .. keycodesize .. keycode \n\n-- sending keycode \nbytes, errorCode2 = tcpSocket:write(message) \n\n\nif errorCode == 0 and errorCode2 == 0 \nthen \n -- printing log under virtual device \n fibaro:log(\"transfer OK: \" .. keycodestring) \nelse \n fibaro:log(\"transfer failed\") \nend","buttonIcon":0,"favourite":false,"main":false},{"id":26,"lua":true,"waitForResponse":false,"caption":"up","name":"Button102","empty":false,"msg":"-- -- \ntvIpAddress = \"192.168.1.17\" \ntvPort = 55000 \nkeycodestring = \"KEY_UP\" \n\ntvAuthString = string.char(0x00,0x14,0x00,0x69,0x70,0x68,0x6f,0x6e,0x65,0x2e,0x2e,0x69,0x61,0x70,0x70,0x2e,0x73,0x61,0x6d,0x73,0x75,0x6e,0x67,0x38,0x00,0x64,0x00,0x14,0x00,0x4d,0x54,0x6b,0x79,0x4c,0x6a,0x45,0x32,0x4f,0x43,0x34,0x77,0x4c,0x6a,0x45,0x78,0x4d,0x41,0x3d,0x3d,0x18,0x00,0x4e,0x45,0x4d,0x74,0x4e,0x7a,0x49,0x74,0x51,0x6a,0x6b,0x74,0x4e,0x44,0x4d,0x74,0x4d,0x6a,0x51,0x74,0x4f,0x45,0x49,0x3d,0x04,0x00,0x54,0x51,0x3d,0x3d)\n-- -- \n\n-- character table string \nlocal b='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' \n\n-- encoding to base64 \nfunction enc(data) \n return ((data:gsub('.', function(x) \n local r,b='',x:byte() \n for i=8,1,-1 do r=r..(b%2^i-b%2^(i-1)>0 and '1' or '0') end \n return r; \n end)..'0000'):gsub('%d%d%d?%d?%d?%d?', function(x) \n if (#x < 6) then return '' end \n local c=0 \n for i=1,6 do c=c+(x:sub(i,i)=='1' and 2^(6-i) or 0) end \n return b:sub(c+1,c+1) \n end)..({ '', '==', '=' })[#data%3+1]) \nend \n\n-- helper function \nfunction num2bytes(num) \n local retStr=\"\" \n for i=1,2 do \n retStr = retStr .. string.char(num%256) \n num = math.floor(num/256) \n end \n return retStr \nend \n\ntcpSocket = Net.FTcpSocket(tvIpAddress, tvPort) \n\n-- say hello to the TV ;) \nbytes, errorCode = tcpSocket:write(tvAuthString) \n\nkeycodebase = string.char(0x00,0x13,0x00,0x69,0x70,0x68,0x6f,0x6e,0x65,0x2e,0x69,0x61,0x70,0x70,0x2e,0x73,0x61,0x6d,0x73,0x75,0x6e,0x67) \n\n-- payload \npayloadinit = string.char(0x00,0x00,0x00) \nkeycode = enc(keycodestring) \n\nkeycodesize = num2bytes(string.len(keycode)) \n\npayloadsize = num2bytes(string.len(payloadinit .. keycode ..keycodesize)) \n\n-- combining the message \nmessage = keycodebase .. payloadsize .. payloadinit .. keycodesize .. keycode \n\n-- sending keycode \nbytes, errorCode2 = tcpSocket:write(message) \n\n\nif errorCode == 0 and errorCode2 == 0 \nthen \n -- printing log under virtual device \n fibaro:log(\"transfer OK: \" .. keycodestring) \nelse \n fibaro:log(\"transfer failed\") \nend","buttonIcon":0,"favourite":false,"main":false},{"id":27,"lua":true,"waitForResponse":false,"caption":"info","name":"Button103","empty":false,"msg":"-- -- \ntvIpAddress = \"192.168.1.17\" \ntvPort = 55000 \nkeycodestring = \"KEY_INFO\" \n\ntvAuthString = string.char(0x00,0x14,0x00,0x69,0x70,0x68,0x6f,0x6e,0x65,0x2e,0x2e,0x69,0x61,0x70,0x70,0x2e,0x73,0x61,0x6d,0x73,0x75,0x6e,0x67,0x38,0x00,0x64,0x00,0x14,0x00,0x4d,0x54,0x6b,0x79,0x4c,0x6a,0x45,0x32,0x4f,0x43,0x34,0x77,0x4c,0x6a,0x45,0x78,0x4d,0x41,0x3d,0x3d,0x18,0x00,0x4e,0x45,0x4d,0x74,0x4e,0x7a,0x49,0x74,0x51,0x6a,0x6b,0x74,0x4e,0x44,0x4d,0x74,0x4d,0x6a,0x51,0x74,0x4f,0x45,0x49,0x3d,0x04,0x00,0x54,0x51,0x3d,0x3d)\n-- -- \n\n-- character table string \nlocal b='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' \n\n-- encoding to base64 \nfunction enc(data) \n return ((data:gsub('.', function(x) \n local r,b='',x:byte() \n for i=8,1,-1 do r=r..(b%2^i-b%2^(i-1)>0 and '1' or '0') end \n return r; \n end)..'0000'):gsub('%d%d%d?%d?%d?%d?', function(x) \n if (#x < 6) then return '' end \n local c=0 \n for i=1,6 do c=c+(x:sub(i,i)=='1' and 2^(6-i) or 0) end \n return b:sub(c+1,c+1) \n end)..({ '', '==', '=' })[#data%3+1]) \nend \n\n-- helper function \nfunction num2bytes(num) \n local retStr=\"\" \n for i=1,2 do \n retStr = retStr .. string.char(num%256) \n num = math.floor(num/256) \n end \n return retStr \nend \n\ntcpSocket = Net.FTcpSocket(tvIpAddress, tvPort) \n\n-- say hello to the TV ;) \nbytes, errorCode = tcpSocket:write(tvAuthString) \n\nkeycodebase = string.char(0x00,0x13,0x00,0x69,0x70,0x68,0x6f,0x6e,0x65,0x2e,0x69,0x61,0x70,0x70,0x2e,0x73,0x61,0x6d,0x73,0x75,0x6e,0x67) \n\n-- payload \npayloadinit = string.char(0x00,0x00,0x00) \nkeycode = enc(keycodestring) \n\nkeycodesize = num2bytes(string.len(keycode)) \n\npayloadsize = num2bytes(string.len(payloadinit .. keycode ..keycodesize)) \n\n-- combining the message \nmessage = keycodebase .. payloadsize .. payloadinit .. keycodesize .. keycode \n\n-- sending keycode \nbytes, errorCode2 = tcpSocket:write(message) \n\n\nif errorCode == 0 and errorCode2 == 0 \nthen \n -- printing log under virtual device \n fibaro:log(\"transfer OK: \" .. keycodestring) \nelse \n fibaro:log(\"transfer failed\") \nend","buttonIcon":0,"favourite":false,"main":false}]},{"type":"button","elements":[{"id":28,"lua":true,"waitForResponse":false,"caption":"left","name":"Button111","empty":false,"msg":"-- -- \ntvIpAddress = \"192.168.1.17\" \ntvPort = 55000 \nkeycodestring = \"KEY_LEFT\" \n\ntvAuthString = string.char(0x00,0x14,0x00,0x69,0x70,0x68,0x6f,0x6e,0x65,0x2e,0x2e,0x69,0x61,0x70,0x70,0x2e,0x73,0x61,0x6d,0x73,0x75,0x6e,0x67,0x38,0x00,0x64,0x00,0x14,0x00,0x4d,0x54,0x6b,0x79,0x4c,0x6a,0x45,0x32,0x4f,0x43,0x34,0x77,0x4c,0x6a,0x45,0x78,0x4d,0x41,0x3d,0x3d,0x18,0x00,0x4e,0x45,0x4d,0x74,0x4e,0x7a,0x49,0x74,0x51,0x6a,0x6b,0x74,0x4e,0x44,0x4d,0x74,0x4d,0x6a,0x51,0x74,0x4f,0x45,0x49,0x3d,0x04,0x00,0x54,0x51,0x3d,0x3d)\n-- -- \n\n-- character table string \nlocal b='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' \n\n-- encoding to base64 \nfunction enc(data) \n return ((data:gsub('.', function(x) \n local r,b='',x:byte() \n for i=8,1,-1 do r=r..(b%2^i-b%2^(i-1)>0 and '1' or '0') end \n return r; \n end)..'0000'):gsub('%d%d%d?%d?%d?%d?', function(x) \n if (#x < 6) then return '' end \n local c=0 \n for i=1,6 do c=c+(x:sub(i,i)=='1' and 2^(6-i) or 0) end \n return b:sub(c+1,c+1) \n end)..({ '', '==', '=' })[#data%3+1]) \nend \n\n-- helper function \nfunction num2bytes(num) \n local retStr=\"\" \n for i=1,2 do \n retStr = retStr .. string.char(num%256) \n num = math.floor(num/256) \n end \n return retStr \nend \n\ntcpSocket = Net.FTcpSocket(tvIpAddress, tvPort) \n\n-- say hello to the TV ;) \nbytes, errorCode = tcpSocket:write(tvAuthString) \n\nkeycodebase = string.char(0x00,0x13,0x00,0x69,0x70,0x68,0x6f,0x6e,0x65,0x2e,0x69,0x61,0x70,0x70,0x2e,0x73,0x61,0x6d,0x73,0x75,0x6e,0x67) \n\n-- payload \npayloadinit = string.char(0x00,0x00,0x00) \nkeycode = enc(keycodestring) \n\nkeycodesize = num2bytes(string.len(keycode)) \n\npayloadsize = num2bytes(string.len(payloadinit .. keycode ..keycodesize)) \n\n-- combining the message \nmessage = keycodebase .. payloadsize .. payloadinit .. keycodesize .. keycode \n\n-- sending keycode \nbytes, errorCode2 = tcpSocket:write(message) \n\n\nif errorCode == 0 and errorCode2 == 0 \nthen \n -- printing log under virtual device \n fibaro:log(\"transfer OK: \" .. keycodestring) \nelse \n fibaro:log(\"transfer failed\") \nend","buttonIcon":0,"favourite":false,"main":false},{"id":29,"lua":true,"waitForResponse":false,"caption":"enter","name":"Button112","empty":false,"msg":"-- -- \ntvIpAddress = \"192.168.1.17\" \ntvPort = 55000 \nkeycodestring = \"KEY_ENTER\" \n\ntvAuthString = string.char(0x00,0x14,0x00,0x69,0x70,0x68,0x6f,0x6e,0x65,0x2e,0x2e,0x69,0x61,0x70,0x70,0x2e,0x73,0x61,0x6d,0x73,0x75,0x6e,0x67,0x38,0x00,0x64,0x00,0x14,0x00,0x4d,0x54,0x6b,0x79,0x4c,0x6a,0x45,0x32,0x4f,0x43,0x34,0x77,0x4c,0x6a,0x45,0x78,0x4d,0x41,0x3d,0x3d,0x18,0x00,0x4e,0x45,0x4d,0x74,0x4e,0x7a,0x49,0x74,0x51,0x6a,0x6b,0x74,0x4e,0x44,0x4d,0x74,0x4d,0x6a,0x51,0x74,0x4f,0x45,0x49,0x3d,0x04,0x00,0x54,0x51,0x3d,0x3d)\n-- -- \n\n-- character table string \nlocal b='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' \n\n-- encoding to base64 \nfunction enc(data) \n return ((data:gsub('.', function(x) \n local r,b='',x:byte() \n for i=8,1,-1 do r=r..(b%2^i-b%2^(i-1)>0 and '1' or '0') end \n return r; \n end)..'0000'):gsub('%d%d%d?%d?%d?%d?', function(x) \n if (#x < 6) then return '' end \n local c=0 \n for i=1,6 do c=c+(x:sub(i,i)=='1' and 2^(6-i) or 0) end \n return b:sub(c+1,c+1) \n end)..({ '', '==', '=' })[#data%3+1]) \nend \n\n-- helper function \nfunction num2bytes(num) \n local retStr=\"\" \n for i=1,2 do \n retStr = retStr .. string.char(num%256) \n num = math.floor(num/256) \n end \n return retStr \nend \n\ntcpSocket = Net.FTcpSocket(tvIpAddress, tvPort) \n\n-- say hello to the TV ;) \nbytes, errorCode = tcpSocket:write(tvAuthString) \n\nkeycodebase = string.char(0x00,0x13,0x00,0x69,0x70,0x68,0x6f,0x6e,0x65,0x2e,0x69,0x61,0x70,0x70,0x2e,0x73,0x61,0x6d,0x73,0x75,0x6e,0x67) \n\n-- payload \npayloadinit = string.char(0x00,0x00,0x00) \nkeycode = enc(keycodestring) \n\nkeycodesize = num2bytes(string.len(keycode)) \n\npayloadsize = num2bytes(string.len(payloadinit .. keycode ..keycodesize)) \n\n-- combining the message \nmessage = keycodebase .. payloadsize .. payloadinit .. keycodesize .. keycode \n\n-- sending keycode \nbytes, errorCode2 = tcpSocket:write(message) \n\n\nif errorCode == 0 and errorCode2 == 0 \nthen \n -- printing log under virtual device \n fibaro:log(\"transfer OK: \" .. keycodestring) \nelse \n fibaro:log(\"transfer failed\") \nend","buttonIcon":0,"favourite":false,"main":false},{"id":30,"lua":true,"waitForResponse":false,"caption":"right","name":"Button113","empty":false,"msg":"-- -- \ntvIpAddress = \"192.168.1.17\" \ntvPort = 55000 \nkeycodestring = \"KEY_RIGHT\" \n\ntvAuthString = string.char(0x00,0x14,0x00,0x69,0x70,0x68,0x6f,0x6e,0x65,0x2e,0x2e,0x69,0x61,0x70,0x70,0x2e,0x73,0x61,0x6d,0x73,0x75,0x6e,0x67,0x38,0x00,0x64,0x00,0x14,0x00,0x4d,0x54,0x6b,0x79,0x4c,0x6a,0x45,0x32,0x4f,0x43,0x34,0x77,0x4c,0x6a,0x45,0x78,0x4d,0x41,0x3d,0x3d,0x18,0x00,0x4e,0x45,0x4d,0x74,0x4e,0x7a,0x49,0x74,0x51,0x6a,0x6b,0x74,0x4e,0x44,0x4d,0x74,0x4d,0x6a,0x51,0x74,0x4f,0x45,0x49,0x3d,0x04,0x00,0x54,0x51,0x3d,0x3d)\n-- -- \n\n-- character table string \nlocal b='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' \n\n-- encoding to base64 \nfunction enc(data) \n return ((data:gsub('.', function(x) \n local r,b='',x:byte() \n for i=8,1,-1 do r=r..(b%2^i-b%2^(i-1)>0 and '1' or '0') end \n return r; \n end)..'0000'):gsub('%d%d%d?%d?%d?%d?', function(x) \n if (#x < 6) then return '' end \n local c=0 \n for i=1,6 do c=c+(x:sub(i,i)=='1' and 2^(6-i) or 0) end \n return b:sub(c+1,c+1) \n end)..({ '', '==', '=' })[#data%3+1]) \nend \n\n-- helper function \nfunction num2bytes(num) \n local retStr=\"\" \n for i=1,2 do \n retStr = retStr .. string.char(num%256) \n num = math.floor(num/256) \n end \n return retStr \nend \n\ntcpSocket = Net.FTcpSocket(tvIpAddress, tvPort) \n\n-- say hello to the TV ;) \nbytes, errorCode = tcpSocket:write(tvAuthString) \n\nkeycodebase = string.char(0x00,0x13,0x00,0x69,0x70,0x68,0x6f,0x6e,0x65,0x2e,0x69,0x61,0x70,0x70,0x2e,0x73,0x61,0x6d,0x73,0x75,0x6e,0x67) \n\n-- payload \npayloadinit = string.char(0x00,0x00,0x00) \nkeycode = enc(keycodestring) \n\nkeycodesize = num2bytes(string.len(keycode)) \n\npayloadsize = num2bytes(string.len(payloadinit .. keycode ..keycodesize)) \n\n-- combining the message \nmessage = keycodebase .. payloadsize .. payloadinit .. keycodesize .. keycode \n\n-- sending keycode \nbytes, errorCode2 = tcpSocket:write(message) \n\n\nif errorCode == 0 and errorCode2 == 0 \nthen \n -- printing log under virtual device \n fibaro:log(\"transfer OK: \" .. keycodestring) \nelse \n fibaro:log(\"transfer failed\") \nend","buttonIcon":0,"favourite":false,"main":false}]},{"type":"button","elements":[{"id":31,"lua":true,"waitForResponse":false,"caption":"Return","name":"Button121","empty":false,"msg":"-- -- \ntvIpAddress = \"192.168.1.17\" \ntvPort = 55000 \nkeycodestring = \"KEY_RETURN\" \n\ntvAuthString = string.char(0x00,0x14,0x00,0x69,0x70,0x68,0x6f,0x6e,0x65,0x2e,0x2e,0x69,0x61,0x70,0x70,0x2e,0x73,0x61,0x6d,0x73,0x75,0x6e,0x67,0x38,0x00,0x64,0x00,0x14,0x00,0x4d,0x54,0x6b,0x79,0x4c,0x6a,0x45,0x32,0x4f,0x43,0x34,0x77,0x4c,0x6a,0x45,0x78,0x4d,0x41,0x3d,0x3d,0x18,0x00,0x4e,0x45,0x4d,0x74,0x4e,0x7a,0x49,0x74,0x51,0x6a,0x6b,0x74,0x4e,0x44,0x4d,0x74,0x4d,0x6a,0x51,0x74,0x4f,0x45,0x49,0x3d,0x04,0x00,0x54,0x51,0x3d,0x3d)\n-- -- \n\n-- character table string \nlocal b='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' \n\n-- encoding to base64 \nfunction enc(data) \n return ((data:gsub('.', function(x) \n local r,b='',x:byte() \n for i=8,1,-1 do r=r..(b%2^i-b%2^(i-1)>0 and '1' or '0') end \n return r; \n end)..'0000'):gsub('%d%d%d?%d?%d?%d?', function(x) \n if (#x < 6) then return '' end \n local c=0 \n for i=1,6 do c=c+(x:sub(i,i)=='1' and 2^(6-i) or 0) end \n return b:sub(c+1,c+1) \n end)..({ '', '==', '=' })[#data%3+1]) \nend \n\n-- helper function \nfunction num2bytes(num) \n local retStr=\"\" \n for i=1,2 do \n retStr = retStr .. string.char(num%256) \n num = math.floor(num/256) \n end \n return retStr \nend \n\ntcpSocket = Net.FTcpSocket(tvIpAddress, tvPort) \n\n-- say hello to the TV ;) \nbytes, errorCode = tcpSocket:write(tvAuthString) \n\nkeycodebase = string.char(0x00,0x13,0x00,0x69,0x70,0x68,0x6f,0x6e,0x65,0x2e,0x69,0x61,0x70,0x70,0x2e,0x73,0x61,0x6d,0x73,0x75,0x6e,0x67) \n\n-- payload \npayloadinit = string.char(0x00,0x00,0x00) \nkeycode = enc(keycodestring) \n\nkeycodesize = num2bytes(string.len(keycode)) \n\npayloadsize = num2bytes(string.len(payloadinit .. keycode ..keycodesize)) \n\n-- combining the message \nmessage = keycodebase .. payloadsize .. payloadinit .. keycodesize .. keycode \n\n-- sending keycode \nbytes, errorCode2 = tcpSocket:write(message) \n\n\nif errorCode == 0 and errorCode2 == 0 \nthen \n -- printing log under virtual device \n fibaro:log(\"transfer OK: \" .. keycodestring) \nelse \n fibaro:log(\"transfer failed\") \nend","buttonIcon":0,"favourite":false,"main":false},{"id":32,"lua":true,"waitForResponse":false,"caption":"down","name":"Button122","empty":false,"msg":"-- -- \ntvIpAddress = \"192.168.1.17\" \ntvPort = 55000 \nkeycodestring = \"KEY_DOWN\" \n\ntvAuthString = string.char(0x00,0x14,0x00,0x69,0x70,0x68,0x6f,0x6e,0x65,0x2e,0x2e,0x69,0x61,0x70,0x70,0x2e,0x73,0x61,0x6d,0x73,0x75,0x6e,0x67,0x38,0x00,0x64,0x00,0x14,0x00,0x4d,0x54,0x6b,0x79,0x4c,0x6a,0x45,0x32,0x4f,0x43,0x34,0x77,0x4c,0x6a,0x45,0x78,0x4d,0x41,0x3d,0x3d,0x18,0x00,0x4e,0x45,0x4d,0x74,0x4e,0x7a,0x49,0x74,0x51,0x6a,0x6b,0x74,0x4e,0x44,0x4d,0x74,0x4d,0x6a,0x51,0x74,0x4f,0x45,0x49,0x3d,0x04,0x00,0x54,0x51,0x3d,0x3d)\n-- -- \n\n-- character table string \nlocal b='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' \n\n-- encoding to base64 \nfunction enc(data) \n return ((data:gsub('.', function(x) \n local r,b='',x:byte() \n for i=8,1,-1 do r=r..(b%2^i-b%2^(i-1)>0 and '1' or '0') end \n return r; \n end)..'0000'):gsub('%d%d%d?%d?%d?%d?', function(x) \n if (#x < 6) then return '' end \n local c=0 \n for i=1,6 do c=c+(x:sub(i,i)=='1' and 2^(6-i) or 0) end \n return b:sub(c+1,c+1) \n end)..({ '', '==', '=' })[#data%3+1]) \nend \n\n-- helper function \nfunction num2bytes(num) \n local retStr=\"\" \n for i=1,2 do \n retStr = retStr .. string.char(num%256) \n num = math.floor(num/256) \n end \n return retStr \nend \n\ntcpSocket = Net.FTcpSocket(tvIpAddress, tvPort) \n\n-- say hello to the TV ;) \nbytes, errorCode = tcpSocket:write(tvAuthString) \n\nkeycodebase = string.char(0x00,0x13,0x00,0x69,0x70,0x68,0x6f,0x6e,0x65,0x2e,0x69,0x61,0x70,0x70,0x2e,0x73,0x61,0x6d,0x73,0x75,0x6e,0x67) \n\n-- payload \npayloadinit = string.char(0x00,0x00,0x00) \nkeycode = enc(keycodestring) \n\nkeycodesize = num2bytes(string.len(keycode)) \n\npayloadsize = num2bytes(string.len(payloadinit .. keycode ..keycodesize)) \n\n-- combining the message \nmessage = keycodebase .. payloadsize .. payloadinit .. keycodesize .. keycode \n\n-- sending keycode \nbytes, errorCode2 = tcpSocket:write(message) \n\n\nif errorCode == 0 and errorCode2 == 0 \nthen \n -- printing log under virtual device \n fibaro:log(\"transfer OK: \" .. keycodestring) \nelse \n fibaro:log(\"transfer failed\") \nend","buttonIcon":0,"favourite":false,"main":false},{"id":33,"lua":true,"waitForResponse":false,"caption":"exit","name":"Button123","empty":false,"msg":"-- -- \ntvIpAddress = \"192.168.1.17\" \ntvPort = 55000 \nkeycodestring = \"KEY_EXIT\" \n\ntvAuthString = string.char(0x00,0x14,0x00,0x69,0x70,0x68,0x6f,0x6e,0x65,0x2e,0x2e,0x69,0x61,0x70,0x70,0x2e,0x73,0x61,0x6d,0x73,0x75,0x6e,0x67,0x38,0x00,0x64,0x00,0x14,0x00,0x4d,0x54,0x6b,0x79,0x4c,0x6a,0x45,0x32,0x4f,0x43,0x34,0x77,0x4c,0x6a,0x45,0x78,0x4d,0x41,0x3d,0x3d,0x18,0x00,0x4e,0x45,0x4d,0x74,0x4e,0x7a,0x49,0x74,0x51,0x6a,0x6b,0x74,0x4e,0x44,0x4d,0x74,0x4d,0x6a,0x51,0x74,0x4f,0x45,0x49,0x3d,0x04,0x00,0x54,0x51,0x3d,0x3d)\n-- -- \n\n-- character table string \nlocal b='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' \n\n-- encoding to base64 \nfunction enc(data) \n return ((data:gsub('.', function(x) \n local r,b='',x:byte() \n for i=8,1,-1 do r=r..(b%2^i-b%2^(i-1)>0 and '1' or '0') end \n return r; \n end)..'0000'):gsub('%d%d%d?%d?%d?%d?', function(x) \n if (#x < 6) then return '' end \n local c=0 \n for i=1,6 do c=c+(x:sub(i,i)=='1' and 2^(6-i) or 0) end \n return b:sub(c+1,c+1) \n end)..({ '', '==', '=' })[#data%3+1]) \nend \n\n-- helper function \nfunction num2bytes(num) \n local retStr=\"\" \n for i=1,2 do \n retStr = retStr .. string.char(num%256) \n num = math.floor(num/256) \n end \n return retStr \nend \n\ntcpSocket = Net.FTcpSocket(tvIpAddress, tvPort) \n\n-- say hello to the TV ;) \nbytes, errorCode = tcpSocket:write(tvAuthString) \n\nkeycodebase = string.char(0x00,0x13,0x00,0x69,0x70,0x68,0x6f,0x6e,0x65,0x2e,0x69,0x61,0x70,0x70,0x2e,0x73,0x61,0x6d,0x73,0x75,0x6e,0x67) \n\n-- payload \npayloadinit = string.char(0x00,0x00,0x00) \nkeycode = enc(keycodestring) \n\nkeycodesize = num2bytes(string.len(keycode)) \n\npayloadsize = num2bytes(string.len(payloadinit .. keycode ..keycodesize)) \n\n-- combining the message \nmessage = keycodebase .. payloadsize .. payloadinit .. keycodesize .. keycode \n\n-- sending keycode \nbytes, errorCode2 = tcpSocket:write(message) \n\n\nif errorCode == 0 and errorCode2 == 0 \nthen \n -- printing log under virtual device \n fibaro:log(\"transfer OK: \" .. keycodestring) \nelse \n fibaro:log(\"transfer failed\") \nend","buttonIcon":0,"favourite":false,"main":false}]},{"type":"button","elements":[{"id":34,"lua":true,"waitForResponse":false,"caption":"A","name":"Button131","empty":false,"msg":"-- -- \ntvIpAddress = \"192.168.1.17\" \ntvPort = 55000 \nkeycodestring = \"KEY_RED\" \n\ntvAuthString = string.char(0x00,0x14,0x00,0x69,0x70,0x68,0x6f,0x6e,0x65,0x2e,0x2e,0x69,0x61,0x70,0x70,0x2e,0x73,0x61,0x6d,0x73,0x75,0x6e,0x67,0x38,0x00,0x64,0x00,0x14,0x00,0x4d,0x54,0x6b,0x79,0x4c,0x6a,0x45,0x32,0x4f,0x43,0x34,0x77,0x4c,0x6a,0x45,0x78,0x4d,0x41,0x3d,0x3d,0x18,0x00,0x4e,0x45,0x4d,0x74,0x4e,0x7a,0x49,0x74,0x51,0x6a,0x6b,0x74,0x4e,0x44,0x4d,0x74,0x4d,0x6a,0x51,0x74,0x4f,0x45,0x49,0x3d,0x04,0x00,0x54,0x51,0x3d,0x3d)\n-- -- \n\n-- character table string \nlocal b='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' \n\n-- encoding to base64 \nfunction enc(data) \n return ((data:gsub('.', function(x) \n local r,b='',x:byte() \n for i=8,1,-1 do r=r..(b%2^i-b%2^(i-1)>0 and '1' or '0') end \n return r; \n end)..'0000'):gsub('%d%d%d?%d?%d?%d?', function(x) \n if (#x < 6) then return '' end \n local c=0 \n for i=1,6 do c=c+(x:sub(i,i)=='1' and 2^(6-i) or 0) end \n return b:sub(c+1,c+1) \n end)..({ '', '==', '=' })[#data%3+1]) \nend \n\n-- helper function \nfunction num2bytes(num) \n local retStr=\"\" \n for i=1,2 do \n retStr = retStr .. string.char(num%256) \n num = math.floor(num/256) \n end \n return retStr \nend \n\ntcpSocket = Net.FTcpSocket(tvIpAddress, tvPort) \n\n-- say hello to the TV ;) \nbytes, errorCode = tcpSocket:write(tvAuthString) \n\nkeycodebase = string.char(0x00,0x13,0x00,0x69,0x70,0x68,0x6f,0x6e,0x65,0x2e,0x69,0x61,0x70,0x70,0x2e,0x73,0x61,0x6d,0x73,0x75,0x6e,0x67) \n\n-- payload \npayloadinit = string.char(0x00,0x00,0x00) \nkeycode = enc(keycodestring) \n\nkeycodesize = num2bytes(string.len(keycode)) \n\npayloadsize = num2bytes(string.len(payloadinit .. keycode ..keycodesize)) \n\n-- combining the message \nmessage = keycodebase .. payloadsize .. payloadinit .. keycodesize .. keycode \n\n-- sending keycode \nbytes, errorCode2 = tcpSocket:write(message) \n\n\nif errorCode == 0 and errorCode2 == 0 \nthen \n -- printing log under virtual device \n fibaro:log(\"transfer OK: \" .. keycodestring) \nelse \n fibaro:log(\"transfer failed\") \nend","buttonIcon":0,"favourite":false,"main":false},{"id":35,"lua":true,"waitForResponse":false,"caption":"B","name":"Button132","empty":false,"msg":"-- -- \ntvIpAddress = \"192.168.1.17\" \ntvPort = 55000 \nkeycodestring = \"KEY_GREEN\" \n\ntvAuthString = string.char(0x00,0x14,0x00,0x69,0x70,0x68,0x6f,0x6e,0x65,0x2e,0x2e,0x69,0x61,0x70,0x70,0x2e,0x73,0x61,0x6d,0x73,0x75,0x6e,0x67,0x38,0x00,0x64,0x00,0x14,0x00,0x4d,0x54,0x6b,0x79,0x4c,0x6a,0x45,0x32,0x4f,0x43,0x34,0x77,0x4c,0x6a,0x45,0x78,0x4d,0x41,0x3d,0x3d,0x18,0x00,0x4e,0x45,0x4d,0x74,0x4e,0x7a,0x49,0x74,0x51,0x6a,0x6b,0x74,0x4e,0x44,0x4d,0x74,0x4d,0x6a,0x51,0x74,0x4f,0x45,0x49,0x3d,0x04,0x00,0x54,0x51,0x3d,0x3d)\n-- -- \n\n-- character table string \nlocal b='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' \n\n-- encoding to base64 \nfunction enc(data) \n return ((data:gsub('.', function(x) \n local r,b='',x:byte() \n for i=8,1,-1 do r=r..(b%2^i-b%2^(i-1)>0 and '1' or '0') end \n return r; \n end)..'0000'):gsub('%d%d%d?%d?%d?%d?', function(x) \n if (#x < 6) then return '' end \n local c=0 \n for i=1,6 do c=c+(x:sub(i,i)=='1' and 2^(6-i) or 0) end \n return b:sub(c+1,c+1) \n end)..({ '', '==', '=' })[#data%3+1]) \nend \n\n-- helper function \nfunction num2bytes(num) \n local retStr=\"\" \n for i=1,2 do \n retStr = retStr .. string.char(num%256) \n num = math.floor(num/256) \n end \n return retStr \nend \n\ntcpSocket = Net.FTcpSocket(tvIpAddress, tvPort) \n\n-- say hello to the TV ;) \nbytes, errorCode = tcpSocket:write(tvAuthString) \n\nkeycodebase = string.char(0x00,0x13,0x00,0x69,0x70,0x68,0x6f,0x6e,0x65,0x2e,0x69,0x61,0x70,0x70,0x2e,0x73,0x61,0x6d,0x73,0x75,0x6e,0x67) \n\n-- payload \npayloadinit = string.char(0x00,0x00,0x00) \nkeycode = enc(keycodestring) \n\nkeycodesize = num2bytes(string.len(keycode)) \n\npayloadsize = num2bytes(string.len(payloadinit .. keycode ..keycodesize)) \n\n-- combining the message \nmessage = keycodebase .. payloadsize .. payloadinit .. keycodesize .. keycode \n\n-- sending keycode \nbytes, errorCode2 = tcpSocket:write(message) \n\n\nif errorCode == 0 and errorCode2 == 0 \nthen \n -- printing log under virtual device \n fibaro:log(\"transfer OK: \" .. keycodestring) \nelse \n fibaro:log(\"transfer failed\") \nend","buttonIcon":0,"favourite":false,"main":false},{"id":36,"lua":true,"waitForResponse":false,"caption":"C","name":"Button133","empty":false,"msg":"-- -- \ntvIpAddress = \"192.168.1.17\" \ntvPort = 55000 \nkeycodestring = \"KEY_YELLOW\" \n\ntvAuthString = string.char(0x00,0x14,0x00,0x69,0x70,0x68,0x6f,0x6e,0x65,0x2e,0x2e,0x69,0x61,0x70,0x70,0x2e,0x73,0x61,0x6d,0x73,0x75,0x6e,0x67,0x38,0x00,0x64,0x00,0x14,0x00,0x4d,0x54,0x6b,0x79,0x4c,0x6a,0x45,0x32,0x4f,0x43,0x34,0x77,0x4c,0x6a,0x45,0x78,0x4d,0x41,0x3d,0x3d,0x18,0x00,0x4e,0x45,0x4d,0x74,0x4e,0x7a,0x49,0x74,0x51,0x6a,0x6b,0x74,0x4e,0x44,0x4d,0x74,0x4d,0x6a,0x51,0x74,0x4f,0x45,0x49,0x3d,0x04,0x00,0x54,0x51,0x3d,0x3d)\n-- -- \n\n-- character table string \nlocal b='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' \n\n-- encoding to base64 \nfunction enc(data) \n return ((data:gsub('.', function(x) \n local r,b='',x:byte() \n for i=8,1,-1 do r=r..(b%2^i-b%2^(i-1)>0 and '1' or '0') end \n return r; \n end)..'0000'):gsub('%d%d%d?%d?%d?%d?', function(x) \n if (#x < 6) then return '' end \n local c=0 \n for i=1,6 do c=c+(x:sub(i,i)=='1' and 2^(6-i) or 0) end \n return b:sub(c+1,c+1) \n end)..({ '', '==', '=' })[#data%3+1]) \nend \n\n-- helper function \nfunction num2bytes(num) \n local retStr=\"\" \n for i=1,2 do \n retStr = retStr .. string.char(num%256) \n num = math.floor(num/256) \n end \n return retStr \nend \n\ntcpSocket = Net.FTcpSocket(tvIpAddress, tvPort) \n\n-- say hello to the TV ;) \nbytes, errorCode = tcpSocket:write(tvAuthString) \n\nkeycodebase = string.char(0x00,0x13,0x00,0x69,0x70,0x68,0x6f,0x6e,0x65,0x2e,0x69,0x61,0x70,0x70,0x2e,0x73,0x61,0x6d,0x73,0x75,0x6e,0x67) \n\n-- payload \npayloadinit = string.char(0x00,0x00,0x00) \nkeycode = enc(keycodestring) \n\nkeycodesize = num2bytes(string.len(keycode)) \n\npayloadsize = num2bytes(string.len(payloadinit .. keycode ..keycodesize)) \n\n-- combining the message \nmessage = keycodebase .. payloadsize .. payloadinit .. keycodesize .. keycode \n\n-- sending keycode \nbytes, errorCode2 = tcpSocket:write(message) \n\n\nif errorCode == 0 and errorCode2 == 0 \nthen \n -- printing log under virtual device \n fibaro:log(\"transfer OK: \" .. keycodestring) \nelse \n fibaro:log(\"transfer failed\") \nend","buttonIcon":0,"favourite":false,"main":false},{"id":37,"lua":true,"waitForResponse":false,"caption":"D","name":"Button134","empty":false,"msg":"-- -- \ntvIpAddress = \"192.168.1.17\" \ntvPort = 55000 \nkeycodestring = \"KEY_BLUE\" \n\ntvAuthString = string.char(0x00,0x14,0x00,0x69,0x70,0x68,0x6f,0x6e,0x65,0x2e,0x2e,0x69,0x61,0x70,0x70,0x2e,0x73,0x61,0x6d,0x73,0x75,0x6e,0x67,0x38,0x00,0x64,0x00,0x14,0x00,0x4d,0x54,0x6b,0x79,0x4c,0x6a,0x45,0x32,0x4f,0x43,0x34,0x77,0x4c,0x6a,0x45,0x78,0x4d,0x41,0x3d,0x3d,0x18,0x00,0x4e,0x45,0x4d,0x74,0x4e,0x7a,0x49,0x74,0x51,0x6a,0x6b,0x74,0x4e,0x44,0x4d,0x74,0x4d,0x6a,0x51,0x74,0x4f,0x45,0x49,0x3d,0x04,0x00,0x54,0x51,0x3d,0x3d)\n-- -- \n\n-- character table string \nlocal b='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' \n\n-- encoding to base64 \nfunction enc(data) \n return ((data:gsub('.', function(x) \n local r,b='',x:byte() \n for i=8,1,-1 do r=r..(b%2^i-b%2^(i-1)>0 and '1' or '0') end \n return r; \n end)..'0000'):gsub('%d%d%d?%d?%d?%d?', function(x) \n if (#x < 6) then return '' end \n local c=0 \n for i=1,6 do c=c+(x:sub(i,i)=='1' and 2^(6-i) or 0) end \n return b:sub(c+1,c+1) \n end)..({ '', '==', '=' })[#data%3+1]) \nend \n\n-- helper function \nfunction num2bytes(num) \n local retStr=\"\" \n for i=1,2 do \n retStr = retStr .. string.char(num%256) \n num = math.floor(num/256) \n end \n return retStr \nend \n\ntcpSocket = Net.FTcpSocket(tvIpAddress, tvPort) \n\n-- say hello to the TV ;) \nbytes, errorCode = tcpSocket:write(tvAuthString) \n\nkeycodebase = string.char(0x00,0x13,0x00,0x69,0x70,0x68,0x6f,0x6e,0x65,0x2e,0x69,0x61,0x70,0x70,0x2e,0x73,0x61,0x6d,0x73,0x75,0x6e,0x67) \n\n-- payload \npayloadinit = string.char(0x00,0x00,0x00) \nkeycode = enc(keycodestring) \n\nkeycodesize = num2bytes(string.len(keycode)) \n\npayloadsize = num2bytes(string.len(payloadinit .. keycode ..keycodesize)) \n\n-- combining the message \nmessage = keycodebase .. payloadsize .. payloadinit .. keycodesize .. keycode \n\n-- sending keycode \nbytes, errorCode2 = tcpSocket:write(message) \n\n\nif errorCode == 0 and errorCode2 == 0 \nthen \n -- printing log under virtual device \n fibaro:log(\"transfer OK: \" .. keycodestring) \nelse \n fibaro:log(\"transfer failed\") \nend","buttonIcon":0,"favourite":false,"main":false}]}]},"actions":{"pressButton":1,"setSlider":2,"setProperty":2}}