I have a MiLight remote witch I want to use to regulate some own build light stripes with ESP8266 comm.
(Nice cheap remote with touch-control)
The remote connects with Domoticz via rfLink via USB.
Now I want to intercept the commands from the RFLink MiLight hardware/device
RFLink sends to Domoticz for example:
Code: Select all
20;29;MiLightv1;ID=DB48;SWITCH=04;RGBW=5390;CMD=COLOR;
I have checked this with RFLink readout in serial console
I can use RGBW=5390 to translate to #hexcolor. (53 = color 90=Brightness)
I use Fastled witch has a conversion function.
I created a Milight device in the RFlink hardware witch reacts to the remote.
in devices.lua I have the following info:
Code: Select all
{
["AddjMulti"]= 1.0,
["AddjMulti2"]= 1.0,
["AddjValue"]= 0.0,
["AddjValue2"]= 0.0,
["BatteryLevel"]= 255,
["CustomImage"]= 0,
["Data"]= "Off",
["Description"]= "",
["Favorite"]= 0,
["HardwareID"]= 1,
["HardwareName"]= "RFLink",
["HardwareType"]= "RFLink Gateway USB",
["HardwareTypeVal"]= 46,
["HaveDimmer"]= true,
["HaveGroupCmd"]= false,
["HaveTimeout"]= false,
["ID"]= "0000DB48",
["Image"]= "Light",
["IsSubDevice"]= false,
["LastUpdate"]= "2017-01-08 11:57:02",
["Level"]= 47,
["LevelInt"]= 47,
["MaxDimLevel"]= 100,
["Name"]= "Mi-Light-m",
["Notifications"]= "false",
["PlanID"]= "0",
["PlanIDs"]= { 0 },
["Protected"]= false,
["ShowNotifications"]= true,
["SignalLevel"]= "-",
["Status"]= "Off",
["StrParam1"]= "",
["StrParam2"]= "",
["SubType"]= "RGBW",
["SwitchType"]= "Dimmer",
["SwitchTypeVal"]= 7,
["Timers"]= "false",
["Type"]= "Lighting Limitless/Applamp",
["TypeImg"]= "dimmer",
["Unit"]= 0,
["Used"]= 1,
["UsedByCamera"]= false,
["XOffset"]= "0",
["YOffset"]= "0",
["idx"]= "149"
},
I have tried the most obvious attributes but i get no data at all
I use this script for trying, it only prints 'test
Code: Select all
local idxn = 149
return {
active = true, -- set to true to activate this script
on = {
idxn, -- Mi-light remote
},
execute = function(domoticz)
print('test')
print(domoticz.devices[idxn].Name)
print(domoticz.devices[idxn].LevelInt)
print(domoticz.devices[idxn].rawData[0])
print(domoticz.devices[idxn].rawData[1])
end
}
I'm not sure if this is the way to go.
Someone who can enlighten me?
RPI-2 + SSD / ESPEasy Sensors & Switches / Sonoff / RFLink / Action Switches / TP-Link switch / Node-Red / Reacticz