Author Topic: PLUGIN: RGB Controller (UI5 & UI7) - V1.41  (Read 37903 times)

Offline vosmont

  • Hero Member
  • *****
  • Posts: 667
  • Karma: +57/-8
PLUGIN: RGB Controller (UI5 & UI7) - V1.41
« on: June 15, 2015, 05:55:53 am »
Introduction

This plugin allows to control RGBW devices.
It's able to manage RGBW color channels and animation programs.

Compatible with
- Aeotec RGBW Bulb
- Fibaro FGRGB-101
- Qubino RGBW dimmer
- Sunricher RGBW Controller
- Zipato RGBW Bulb
- Hyperion Remote (http)
- All Z-Wave device which supports COLOR COMMAND CLASS
- Hyperion

Compliant with : UI5 / UI7 / ALTUI / ImperiHome


Installation

You will find the plugin on apps.mios.com or in "Apps->Install apps" by searching "RGB Controller".

In the "Settings" tab, select the type of the the device you want to control.

Then select its specific settings (the Z-Wave rgb device or server ip/port)

Just UI5: There's no JSON decoder installed by default.
If you have the error "No JSON decoder", you have to upload the library in "/usr/lib/lua". You can take "json.lua" or "dkjson.lua".
​You will find "json.lua" here : http://code.mios.com/trac/mios_genericutils/export/20/json.lua
This code can be executed in "Apps->Develop apps->Test Luup code (Lua)"
Code: [Select]
os.execute("wget -q -O /usr/lib/lua/json.lua http://code.mios.com/trac/mios_genericutils/export/20/json.lua")

Usage

You can control your RGBW device :

1/ from the dashboard
It's just possible to switch ON or OFF the device (keeps the last chosen color).

2/ from "Color wheel" tab
You can
- Switch ON or OFF the device
- Set the RGB colors by the wheel or the sliders (RGB and white channels).
You can apply a transition between the current color and the new chosen color. You just have to set the duration of the transition and the number of steps. In any case, the plugin wil adjust these parameters in a way that the minimal duration between two intermediate changes is of one second.
- Start or stop animation programs if your device is compatible.

3/ by LUA script

- Switch on/off the RGBW device
Code: [Select]
-- switches ON the device
luup.call_action("urn:upnp-org:serviceId:SwitchPower1", "SetTarget", {newTargetValue = 1}, <idPlugin>)

-- switches OFF the device
luup.call_action("urn:upnp-org:serviceId:SwitchPower1", "SetTarget", {newTargetValue = 0}, <idPlugin>)

- Change the RGB color
Code: [Select]
-- sets the RGB color to red
luup.call_action("urn:upnp-org:serviceId:RGBController1", "SetColorTarget", {newColorTargetValue = "#FF0000"}, <idPlugin>)

- Change the RGBW color
Code: [Select]
-- sets the RGB color to red and the warm white to 100%
luup.call_action("urn:upnp-org:serviceId:RGBController1", "SetColorTarget", {newColorTargetValue = "#FF0000FF"}, <idPlugin>)

-- sets the RGB color to red and the cool white to 100%
luup.call_action("urn:upnp-org:serviceId:RGBController1", "SetColorTarget", {newColorTargetValue = "#FF000000FF"}, <idPlugin>)

-- sets the RGB color to blue and the cool white to 50%, with a transition of 30 seconds (in 10 steps)
luup.call_action("urn:upnp-org:serviceId:RGBController1", "SetColorTarget", {newColorTargetValue = "#0000FF007F", transitionDuration = 30, transitionNbSteps = 10}, <idPlugin>)

- Start an animation program
Code: [Select]
luup.call_action("urn:upnp-org:serviceId:RGBController1", "StartAnimationProgram", {programName = "LAPD"}, <idPlugin>)
You will find the animation program names in the "Color wheel" tab.

- Stop an animation program
Code: [Select]
luup.call_action("urn:upnp-org:serviceId:RGBController1", "StopAnimationProgram", {}, <idPlugin>)

4/ by scenes
You can achieve the same operations than by LUA script, in advanced editor of the scenes.


Debug

You can enable the debug mode with setting the variable "Debug" to "1" in the "Advanced" panel.
Then, you can check the logs with this command (SSH session) :
Code: [Select]
tail -f /var/log/cmh/LuaUPnP.log | grep "^01\|RGBController"


Inspirations

- the plugin jQuery Farbtastic
https://github.com/mattfarina/farbtastic

- a merge of Farbtastic with jQueryUI sliders
http://www.emanueleferonato.com/2011/03/22/jquery-color-picker-using-farbtastic-and-jquery-ui/


Sources

https://github.com/vosmont/Vera-Plugin-RGBController
« Last Edit: March 13, 2017, 03:45:47 am by vosmont »

Offline jmarken

  • Newbie
  • *
  • Posts: 10
  • Karma: +0/-1
Re: PLUGIN: RGB Controller (UI5 & UI7) - V1.2
« Reply #1 on: June 16, 2015, 09:02:25 pm »
vosmont, it's me again.  I have not had success with your plugin (yet) and the Aeon Tech bulb on UI7 (running the latest firmware).

I hate to be a pain, but I feel like there is something that I'm missing in the setup.

I documented the steps that I took as closely as I could (see attached .doc).

Are there any other "prerequisites" (other plugins, vera system settings, etc.) that I need to change in my setup?

In the document, when I pair the Aeon bulb with Vera normally, I can control the bulb (only on/off, dimmer) but when I add the RGB controller plugin in, things just don't work.

Please let me know if there is anything else I can do differently to get this working.  It's one of my main projects with the Vera.

Thanks again for your help.
jmarken

Offline vosmont

  • Hero Member
  • *****
  • Posts: 667
  • Karma: +57/-8
Re: PLUGIN: RGB Controller (UI5 & UI7) - V1.2
« Reply #2 on: June 17, 2015, 03:25:58 am »
Ok  ;)

In 'Advanced' panel, you have several tabs :
- 'Params'; internal parameters of Vera devices
- 'Variables'; several parameters including settings of plugins

If you change the parameter 'id' in 'Params' tab... I think you crush the device which had this id (that's why your Bulb has disappeared).
You should revert id to '16' on the RGB Controller, and if the Bulb is no more here, you have to reinclude it.

How to make the RGB Controller working ?

- Change the variable 'DeviceId' in 'Variables' tab.

- Or install the version in development (some bugs fixed and Aeotec Bulb should be proposed in compatibles devices)
https://github.com/vosmont/Vera-Plugin-RGBController
(Download ZIP, Drag&Drop files in 'luup files' in 'Apps->Develop apps->Luup files')

Offline jmarken

  • Newbie
  • *
  • Posts: 10
  • Karma: +0/-1
Re: PLUGIN: RGB Controller (UI5 & UI7) - V1.2
« Reply #3 on: June 17, 2015, 11:45:20 am »
vosmont,

I got it working.  Thanks! 

The missing portion for me was that the 'DeviceId' field on the Variables tab was not present until after I selected the 'Device Type' on the RGB Controller device Settings tab.

After that, I was able to set the 'DeviceId' on the Variables tab instead of the Parameters tab and then all was working.

The response time was very slow for maybe 3-4 minutes, but after that it is quick to respond.  The Vera was probably still processing something in the background.

Thank you very much for the excellent explanation.  I hope it helps someone else down the line.

Jmarken

Offline a-lurker

  • Hero Member
  • *****
  • Posts: 701
  • Karma: +36/-7
Re: PLUGIN: RGB Controller (UI5 & UI7) - V1.2
« Reply #4 on: June 18, 2015, 06:48:26 pm »
Great to see a RGB plugin with white as well plus color wheel applied to multiple devices/lights.

I have a lot of LED strips that are controlled by Vera dimmer devices - one dimmer for each color. In your plugin, would it be possible to dial up the strip type (see blow) and just enter the IDs of these simple dimmers - one for each channel. Then issue dimmer commands to these ids depending on the color wheel selection. Master on/off would command all dimmers to turn on or off. For RGBW, optionally just the white channel when commanded to on, rather than RGB and W.

At a higher level there are some complications:
RGB is pretty clear cut. However RGB with W has complications and how do you create white: using all three RGB channels or just the white channel or both. Your plugin appears to allow all three scenarios. But you can also have two channel strips that implement just warm white and cool white, which seem not handled at the moment.

However can I please suggest something like so?:

RGBDeviceTypes["RGBdimmers"]
RGBDeviceTypes["RGBWdimmers"]
RGBDeviceTypes["WWCWdimmers"]

Something like this would probably also allow the mysensor Arduino devices to be similarly engaged.


Offline vosmont

  • Hero Member
  • *****
  • Posts: 667
  • Karma: +57/-8
Re: PLUGIN: RGB Controller (UI5 & UI7) - V1.2
« Reply #5 on: June 19, 2015, 10:48:32 am »
Hello a-lurker,
I didn't know mysensors. It's a great project.
I wait personally for the release of the SBS, which is similar to mysensors (http://www.domotique-info.fr/2015/05/smart-board-sensors-connected/).

Concerning your need to associate the colour channels to dimmers, the early version of the plugin, which was made for the Fibaro RGBW, was acting like this.
But there was lags when changing colors due to Z-Wave latency (some colour channels were modified after the others some seconds later). That's why the plugin use now directly the Z-Wave color class command.

The RGB/RGBW strips controlled by your arduinos, could use this deactivated portion of code.
I will add the management of warm and cold white channels in the panel.

Offline a-lurker

  • Hero Member
  • *****
  • Posts: 701
  • Karma: +36/-7
Re: PLUGIN: RGB Controller (UI5 & UI7) - V1.2
« Reply #6 on: June 19, 2015, 05:01:00 pm »
vostmont - the SBS pcbs look interesting. Good flexibility as shown in the connectivity diagrams:

http://domotique-info.fr/wp-content/uploads/2014/03/domotique-info-4sbs-io-rgbw-.png

On my RGBW needs  - I don't need speed or animations for the task they are being used for, so simple dimmers will work OK. Will look forward to the addition of warm/cool white!

Offline vosmont

  • Hero Member
  • *****
  • Posts: 667
  • Karma: +57/-8
Re: PLUGIN: RGB Controller (UI5 & UI7) - V1.2
« Reply #7 on: June 20, 2015, 04:50:08 am »
The new version of the SBS should be autonomous (no need of a Fibaro RGBW controller).

Offline vosmont

  • Hero Member
  • *****
  • Posts: 667
  • Karma: +57/-8
Re: PLUGIN: RGB Controller (UI5 & UI7) - V1.2
« Reply #8 on: July 06, 2015, 09:58:03 am »
Version 1.3 is about to arrive :
- Add compatibility with Aeotec RGBW Bulb
- Add dimmer devices management
- Compliant with ALTUI
- Add color transition animation for all RGB devices.

This version will be on apps.mios in in few days. If you wan't to test it, you can download it here :
https://github.com/vosmont/Vera-Plugin-RGBController

Offline vosmont

  • Hero Member
  • *****
  • Posts: 667
  • Karma: +57/-8
Re: PLUGIN: RGB Controller (UI5 & UI7) - V1.32
« Reply #9 on: July 09, 2015, 07:02:04 am »
Version 1.32 is available :
- Fix multiple CSS injection
- Watchs status
- CSS fix
- registerEventHandler on UI5
- shows communication errors
- fix mouse event on colorpicker under Firefox

Offline amg0

  • Sr. Hero Member
  • ******
  • Posts: 2379
  • Karma: +145/-7
Re: PLUGIN: RGB Controller (UI5 & UI7) - V1.32
« Reply #10 on: July 09, 2015, 08:01:07 am »
Version 1.32 is available :
- Fix multiple CSS injection
- Watchs status
- CSS fix
- registerEventHandler on UI5
- shows communication errors
- fix mouse event on colorpicker under Firefox

a small fix for ALTUI is needed ( missing constant ), you will need ALTUI version >= 339. will publish it soon.

Offline tedp

  • Full Member
  • ***
  • Posts: 236
  • Karma: +2/-2
Re: PLUGIN: RGB Controller (UI5 & UI7) - V1.32
« Reply #11 on: July 10, 2015, 01:34:22 pm »
I'm looking at doing a RGB(W) LED strip installation using the Fibaro FGRGB-101 as a controller. If I am reading right, I should be able to use a color wheel with nothing else except the Vera and this plug-in. Is that right? (I shouldn't need something like a SmartThings Hub or the Fibaro Home Center 2 or HC Lite controllers in addition).

Thanks!

Offline vosmont

  • Hero Member
  • *****
  • Posts: 667
  • Karma: +57/-8
Re: PLUGIN: RGB Controller (UI5 & UI7) - V1.32
« Reply #12 on: July 10, 2015, 02:10:48 pm »
That's right : the plugin allows you to change the RGBW color via a color wheel and via ImperiHome.
You just have to pair your Fibaro FGRGB-101 with your Vera (UI5 or UI7)

Offline timson

  • Newbie
  • *
  • Posts: 8
  • Karma: +0/-0
Re: PLUGIN: RGB Controller (UI5 & UI7) - V1.32
« Reply #13 on: July 17, 2015, 04:58:28 am »
Good job!
Is it possible to use this plugin on the iOS app? I mean to chose the color or animation.
Thanks!

Offline vosmont

  • Hero Member
  • *****
  • Posts: 667
  • Karma: +57/-8
Re: PLUGIN: RGB Controller (UI5 & UI7) - V1.32
« Reply #14 on: July 20, 2015, 03:14:59 am »
I'm not sure that the IOS application is fully compatible with custom plugin tabs.
You should use ALTUI (webapp) or Imperihome (an IOS version is in development)