PLUGIN: RGB Controller (UI5 & UI7) - V1.41

“RGBW device does not exist” You can not choose the device id under settings.

It looks as if the name was changed: D_DimmableRGBLight2.xml

What kind of RGB devices do you control ? Zipato RGBW bulb ?

You can change “J_RGBController1.js” at line 462:

if ((device.device_type == DEVICETYPE_DIMMABLE_LIGHT) && (device.disabled == 0) && (device.id_parent == 1)) {

and replace by

if (((device.device_type == DEVICETYPE_DIMMABLE_LIGHT) || (device.device_type == "D_DimmableRGBLight2.xml")) && (device.disabled == 0) && (device.id_parent == 1)) {

Aeon RGB Bulb

seeing the same with the Zipato bulb, vera seems to be building the color selection into the device now so no plugin will be needed for basic color selection

attached image of device

device_type = urn:schemas-upnp-org:device:DimmableRGBLight:1

[quote=“vosmont, post:247, topic:175646”]Here is the code to transform the dimmer in power switch, and resolve the problem with the long click.


_G.SID = {
	Dimming = "urn:upnp-org:serviceId:Dimming1"
}

_G.DeviceHelper = {
	-- Get device id by its description
	getIdByName = function (deviceName)
		if (deviceName == nil) then
			return nil
		end
		if (type(deviceName) == "number") then
			return deviceName
		else
			for deviceId, device in pairs(luup.devices) do
				if (device.description == deviceName) then
					return deviceId
				end
			end
		end
		luup.log("[DeviceHelper.getIdByName] " .. deviceName .. " doesn't exist", 1)
		return nil
	end
}

DimmerToSwitchPowerManager = {

	onDimmerLevelIsUpdated = function (lul_device, lul_service, lul_variable, lul_value_old, lul_value_new)
		local oldLevel, newLevel, forcedLevel = tonumber(lul_value_old), tonumber(lul_value_new), nil
		local message = "(DimmerToSwitchPowerManager.onDimmerLevelIsUpdated) Level of dimmer #" .. tostring(lul_device) .. "(" .. luup.devices[lul_device].description .. ") has changed from " .. tostring(oldLevel) .. "% to " .. tostring(newLevel) .. "%"
		if (oldLevel <= newLevel) then
			-- Dimmer level is increasing
			if (lul_value_new ~= "100") then
				forcedLevel = 100
			end
		elseif (lul_value_new ~= "0") then
			-- Dimmer level is decreasing
			forcedLevel = 0
		end
		if (forcedLevel ~= nil) then
			luup.log(message .. " - Force level to " .. tostring(forcedLevel) .. "%", 50)
			luup.call_action(SID.Dimming, "SetLoadLevelTarget", { newLoadlevelTarget = forcedLevel }, lul_device)
		else
			luup.log(message .. " - Nothing to do", 50)
		end
	end,

	start = function (dimmerName)
		local dimmerId = DeviceHelper.getIdByName(dimmerName)
		if (dimmerId ~= nil) then
			luup.log("(DimmerToSwitchPowerManager.start) Register #" .. tostring(dimmerId) .. "(" .. tostring(dimmerName) .. ")", 50)
			luup.variable_watch("DimmerToSwitchPowerManager.onDimmerLevelIsUpdated", SID.Dimming, "LoadLevelStatus", dimmerId)
		else
			luup.log("(DimmerToSwitchPowerManager.start) Device '" .. dimmerName .. "' is unknown", 1)
		end
	end

}
_G["DimmerToSwitchPowerManager.onDimmerLevelIsUpdated"] = DimmerToSwitchPowerManager.onDimmerLevelIsUpdated

to use it :

DimmerToSwitchPowerManager.start("Bedhead_Main1") DimmerToSwitchPowerManager.start("Bedhead_Main2") [/quote]

@vosmont

Hi, how are you?

I’m trying to use two wire motion sensor to turn on a fibaro rgbw with a led strip (like a under the bed lights when i wake up in the middle of the night). Is this code for something like this?

If yes, could you, please, explain a step by step for someone really really dumb? lol.

Thanks a lot!

Congrats for the plugin! It’s awesome!

@jouked
I’m getting the same error (V2 - 1.5.622) - how do I check the version of the JSON decoder and download the correct version if required?

I checked using ssh to connect to my vera (I think you have to go through some hoops to make ssh work with root access). The json.lua file should be in /usr/lib/lua, using ‘head json.lua’ you can inspect the version. In the file header it should state – Version: 0.9.20.

I’ve just updated to 1.7.1569 and now the RGB app doesn’t recognize my Aeon Labs RGBW E27 Lamp (AEOEZW098).
I’ve have unpaired the device and paired the device. Created a new device from the app but the drowdown menu wont let me select the device.

It seems that I’m also not able to turn the RGB ligt off throught the house modes screen

Hello,

you will find a patch here :

I will update the version on apps.mios when my tests on the Arduino branch will be finished.

[quote=“vosmont, post:89, topic:187690”]Hello,

you will find a patch here :

I will update the version on apps.mios when my tests on the Arduino branch will be finished.[/quote]

Thank you for the fast response, however now I’m not able to do anything. I’ve uploaded all the luup files, restarted the vera, recreated the device throught the app and now I’m only able to change the room.

Hi All-

Problem- I have a new Fibaro 441 w/ 2.5 FW and a Vera Lite running UI5. I included the Fibaro controller and it works fine- I can control each of R, G, and B through the Vera UI. Then I installed RGB controller 1.33 from the app store. I downloaded json.lua as instructed on this MCV thread and copied it to /usr/lib/lua with WinSCP. I then open the RGB controller device, go to settings and specify device type as the Fibaro and push save just below the device type and then the red save prompt from the UI.

This is where my problem occurs. When I go back to the RGB controller device I am told RGBW device ID not set. When I try to open the settings tab I get an infinite “Loading Data.” Any ideas what I am doing wrong?

BTW, I also tried changing json.lua to rwxr-xr–, this didn’t help; I tried executing the Lua code shown for json.lua, this didn’t help; and I tried rebooting the Vera Lite after specifying the device type and saving, and this didn’t work either.

Thanks!

Rick

Hello Rick,
I’ve reinstalled the version 1.33 on UI5 : no problem.
Have you done a refresh in your browser ?
The error you described is in the browser, can you check the logs in the console of your browser ?

If there’s no error, you can enable the debug mode (variable “Debug” = 1 in “Advanced” panel in the plugin)
Then, you can check the logs with this command in an SSH session :

tail -f /var/log/cmh/LuaUPnP.log | grep "^01\|RGBController"

You will find a new version here :

The type of the Aeon device has changed to “urn:schemas-upnp-org:device:DimmableRGBLight:2

Just upload the file “J_RGBController1.js” without Luup reload and refresh your browser.

I have a vera3 1.7.719. Paired the Aeotec ZW098-A52, and I can control on/off no problem. I put this plugin on my system, says ver 1.33, and I can make it strobe, but I can’t get it to change to a solid color. I can turn it on/off with the App device,but still can’t change color.

I tried to change the device type, but when I do, the app no longer sees it. I went to Github and I see files, but I don’t know what I should be doing with them. I do have root access to my Vera, but I don’t seem to find the files on the system.

Any help is appreciated.

OK, so I found under develop apps where I can upload the files. But when I create a device now, it says Lua Engine Failed to load and it won’t open the settings page

There has been a communication problem.

Please try to reopen this tab.

ERROR: Device not ready

vosmont
Is there a way you can add this to Zigbee devices imported by the WINK plugin?

OK, I used the debug, and figured out I was missing a carriage return at the end of the L_RGBController1.lua file. So its working now. a little slow to respond, but it does work.

Sweet plugin, thanks Vosmont

Hello Rick,
I’ve reinstalled the version 1.33 on UI5 : no problem.
Have you done a refresh in your browser ?
The error you described is in the browser, can you check the logs in the console of your browser ?

If there’s no error, you can enable the debug mode (variable “Debug” = 1 in “Advanced” panel in the plugin)
Then, you can check the logs with this command in an SSH session :

tail -f /var/log/cmh/LuaUPnP.log | grep "^01\|RGBController" [/quote]

Hi Vosmont,

Thanks for your reply. When I do a browser refresh it brings me back to the UI where I select the device, then settings, and it gets stuck all over again “loading data.” I don’t really know what to look for in the browser log, however I have tried it in Firefox, IE, and Opera and I get essentially the same behavior. I did enable debug as you suggest and I get the following entries:

Most recent is:
11/21/15 18:15:45.139 luup_log:101: (RGBController::setTarget) DEBUG: Device not initialized <0x2ba22000>04

Before that is:
11/21/15 18:13:33.305 JobHandler_LuaUPnP::HandleActionRequest device: 101 service: urn:upnp-org:serviceId:RGBController1 action: e[36;1mGetRGBDeviceTypese[0m <0x2f997680>
08 11/21/15 18:13:33.306 JobHandler_LuaUPnP::HandleActionRequest argument DeviceNum=101 <0x2f997680>
08 11/21/15 18:13:33.306 JobHandler_LuaUPnP::HandleActionRequest argument serviceId=urn:upnp-org:serviceId:RGBController1 <0x2f997680>
08 11/21/15 18:13:33.306 JobHandler_LuaUPnP::HandleActionRequest argument action=GetRGBDeviceTypes <0x2f997680>
50 11/21/15 18:13:33.307 luup_log:101: (RGBController::getRGBDeviceTypes) DEBUG: Get RGB device types <0x2f997680>
06 11/21/15 18:13:33.316 Device_Variable::m_szValue_set device: 101 service: urn:upnp-org:serviceId:RGBController1 variable: e[35;1mLastResulte[0m was: {“HYPERION”:{“name”:“Hyperion Remote”,“settings”:[{“variable”:“DeviceIp”,“name”:“Server IP”,“type”:“string”},{“variable”:“DevicePort”,“name”:“Server port”,“type”:“string”}]},“AEO_ZW098-C55”:{“name”:“Aeotec RGBW Bulb”,“settings”:[{“variable”:“DeviceId”,“name”:“Controlled device”,“type”:“ZWaveColorDevice”}]},“RGBWdimmers”:{“name”:“RGBW Dimmers”,“settings”:[{“variable”:“DeviceIdRed”,“name”:“Red”,“type”:“dimmer”},{“variable”:“DeviceIdGreen”,“name”:“Green”,“type”:“dimmer”},{“variable”:“DeviceIdBlue”,“name”:“Blue”,“type”:“dimmer”},{“variable”:“DeviceIdWarmWhite”,“name”:“Warm white”,“type”:“dimmer”},{“variable”:“DeviceIdCoolWhite”,“name”:“Cool white”,“type”:“dimmer”}]},“ZWaveColorDevice”:{“name”:“Generic Z-Wave color device”,“settings”:[{“variable”:“DeviceId”,“name”:“Controlled device”,“type”:“ZWaveColorDevice”}]},“FGRGBWM-441”:{“name”:“Fibaro RGBW Controller”,“settings”:[{“variable”:“DeviceId”,“name”:“Controlled device”,“type”:“ZWaveColorDevice”}]},“ZIP-RGBW”:{“name”:“Zipato RGBW Bulb”,“settings”:[{“variable”:“DeviceId”,“name”:“Controlled device”,“type”:“ZWaveColorDevice”}]}} now: {“HYPERION”:{“name”:“Hyperion Remote”,“settings”:[{“variable”:“DeviceIp”,“name”:“Server IP”,“type”:“string”},{“variable”:“DevicePort”,“name”:“Server port”,“type”:“string”}]},“AEO_ZW098-C55”:{“name”:“Aeotec RGBW Bulb”,“settings”:[{“variable”:“DeviceId”,“name”:“Controlled device”,“type”:“ZWaveColorDevice”}]},“RGBWdimmers”:{“name”:“RGBW Dimmers”,“settings”:[{“variable”:“DeviceIdRed”,“name”:“Red”,“type”:“dimmer”},{“variable”:“DeviceIdGreen”,“name”:“Green”,“type”:“dimmer”},{“variable”:“DeviceIdBlue”,“name”:“Blue”,“type”:“dimmer”},{“variable”:“DeviceIdWarmWhite”,“name”:“Warm white”,“type”:“dimmer”},{“variable”:“DeviceIdCoolWhite”,“name”:“Cool white”,“type”:“dimmer”}]},“ZWaveColorDevice”:{“name”:“Generic Z-Wave color device”,“settings”:[{“variable”:“DeviceId”,“name”:“Controlled device”,“type”:“ZWaveColorDevice”}]},“FGRGBWM-441”:{“name”:“Fibaro RGBW Controller”,“settings”:[{“variable”:“DeviceId”,“name”:“Controlled device”,“type”:“ZWaveColorDevice”}]},“ZIP-RGBW”:{“name”:“Zipato RGBW Bulb”,“settings”:[{“variable”:“DeviceId”,“name”:“Controlled device”,“type”:“ZWaveColorDevice”}]}} #hooks: 0 upnp: 0 v:0x10b3330/NONE duplicate:1 <0x2f997680>
02

Thanks!

Rick

You rock Vosmont; updating the 3 changed files fixed the plugin (I recently updated to the latest Vera firmware). Great work.

(what is it with Vera making breaking changes in minor firmware updates? if I do that people would kick my *ss :slight_smile:

Warning for Vera Firmware 1.7.1569!
I have a Aeotec LED Bulb ZW098. After upgrading my Vera Edge to Firmware 1.7.1569 doesn’t the RGB Controller find the Aeotec LED Bulb. :cry: