Page 1 of 1

RGBWW Plugin development questions

Posted: 10 Dec 2016, 08:39
by dev0
Hi,

I am developing a RGBWW plugin at the moment. Normally sensor values are send periodically to controller. I would like to trigger this function to update the controller in realtime if a value has changed. Is there way to do that?

Edit: solution found: sendData(event)

Re: RGBWW Plugin development questions

Posted: 11 Dec 2016, 10:58
by dev0
Next question :)

I found a strange behavior if I define more than 4 values names:
- if I define 5 values names than the fifth value will not be saved on device web page.
- if I defnie 6 or more values names and try to save on device web page than ESPEasy hangs immediately and reboots after a few seconds.
Code looks like this:

Code: Select all

#define PLUGIN_123
#define PLUGIN_ID_123         123
#define PLUGIN_NAME_123       "RGBWW"
#define PLUGIN_VALUENAME1_123 "rgb"
#define PLUGIN_VALUENAME2_123 "ct"
#define PLUGIN_VALUENAME3_123 "bri"
#define PLUGIN_VALUENAME4_123 "colormode"
#define PLUGIN_VALUENAME5_123 "state"
...
   case PLUGIN_DEVICE_ADD:
      {
        Device[++deviceCount].Number = PLUGIN_ID_123;
        Device[deviceCount].Type = DEVICE_TYPE_DUMMY;
        Device[deviceCount].VType = SENSOR_TYPE_QUAD;
        Device[deviceCount].ValueCount = 5;
        Device[deviceCount].SendDataOption = true;
...
    case PLUGIN_GET_DEVICEVALUENAMES:
      {
        strcpy_P(ExtraTaskSettings.TaskDeviceValueNames[0], PSTR(PLUGIN_VALUENAME1_123));
        strcpy_P(ExtraTaskSettings.TaskDeviceValueNames[1], PSTR(PLUGIN_VALUENAME2_123));
        strcpy_P(ExtraTaskSettings.TaskDeviceValueNames[2], PSTR(PLUGIN_VALUENAME3_123));
        strcpy_P(ExtraTaskSettings.TaskDeviceValueNames[3], PSTR(PLUGIN_VALUENAME4_123));
        strcpy_P(ExtraTaskSettings.TaskDeviceValueNames[4], PSTR(PLUGIN_VALUENAME5_123));
        break;
      }
Tested with R128, R147
Is it a bug or are only 4 values supported?

Edit: I think I need a new Device[deviceCount].VType SENSOR_TYPE_OCTA to submit 8 Values. Right?

Thanks in advance.

Re: RGBWW Plugin development questions

Posted: 17 Dec 2016, 08:46
by dev0
I would like to request to extend ESPEasy with two options:

1. an additional Device[x].VType with a value count of up to 8 => SENSOR_TYPE_OCTA
2. a way to send strings to the controller, not only floats.

Application use case:
1. a rgbww device with multiple color modes (rgb, ct, hsv) has to report more than 4 values to let the controller know the current state.
2. to send a rgb value to the controller in hex representation because this is the standard on all controllers I know. Otherwise all supported controller have to decode it and the such plugins would not work out of the box.

Is it possible to expand ESPEasy in this direction (after feature freeze for the next stable release) ?

Re: RGBWW Plugin development questions

Posted: 20 Dec 2016, 23:22
by rwest
hi dev0

i was thinking (and working a bit) on some similar option.
with a dummy item i could have an extra device for addition variable.
togeter with some rules you could store and use them.
http://www.letscontrolit.com/wiki/index ... mmy_Device

RGBWW is a challenge.

any ideas to create a RGB first and then expand to RGBW and RGBWW (H801)
Even an W only could be usefull when you want to dim and toggle a led with a button input?

i would love to help.
Currently i use an stable OpenHAB MQTT setup.

If it is ready, would you mind sharing? https://github.com/ESP8266nu/ESPEasyPluginPlayground

Re: RGBWW Plugin development questions

Posted: 21 Dec 2016, 06:40
by dev0
I also had the idea with an additional (dummy) device but my intention is to develop an esay solution that fits seamlessly with ESPEasy.

At the moment the plugin sends all set parameters via http response in JSON Format like other plugins do if http is used. But this is only a workaround. It will be better to have the possibility to send via ESPEasy's sendData(event) function. This is already working but with the limitation of 4 values (min. 5 required) and missing option to send 'rgb values' like '00FFAA'.
I have to do some fine tuning regarding fading timer. After that I will publish the version to my github account (ddtlabs), first.

It would be nice if an ESPEasy developer could say something about the requested extension.

Re: RGBWW Plugin development questions

Posted: 30 Dec 2016, 08:19
by dev0
rwest wrote: If it is ready, would you mind sharing?
A first public draft can be found here: https://github.com/ddtlabs/ESPEasy-Plugin-Lights
Due to limitations described above there is no feedback via controller plugin at the moment, just a custom JSON response to the http requests. The basic light functions should be given.

Re: RGBWW Plugin development questions

Posted: 03 Jan 2017, 19:04
by Dylantje
sorry for my dombo question.
Only can i or can i not control a rgbw strip, with easpeasy?

Re: RGBWW Plugin development questions

Posted: 04 Jan 2017, 06:24
by dev0
Yes, you can control RGB, RGBW and RGBWW lights with my plugin.

Re: RGBWW Plugin development questions

Posted: 04 Jan 2017, 09:16
by Dylantje
Please tell me how.

Re: RGBWW Plugin development questions

Posted: 04 Jan 2017, 09:20
by dev0
Command description can be found on github, too: https://github.com/ddtlabs/ESPEasy-Plugin-Lights

Re: RGBWW Plugin development questions

Posted: 04 Jan 2017, 11:32
by ManS-H
dev0 wrote:Command description can be found on github, too: https://github.com/ddtlabs/ESPEasy-Plugin-Lights
Interesting piece of work, but i have a question. What kind of hardware do you use? Is it a ready pcb from a firm or is it diy hardware.
Is possible to tell what kind of hardware you use for this plugin.

Thanks in advance.

Re: RGBWW Plugin development questions

Posted: 04 Jan 2017, 11:55
by dev0
I use different hardware: DIY with Wemos D1 and cheep Chinese H801 Controllers. Mostly only with warm white and cold white stripes to be able to adjust white color.

Re: RGBWW Plugin development questions

Posted: 04 Jan 2017, 12:13
by Dylantje
mm i do not understand how this is working..
Do i need to to flash the esp with espeasy?
And then use your plugin?
Or do i need your plugin with arduino ide and then flash?

Re: RGBWW Plugin development questions

Posted: 04 Jan 2017, 13:10
by ManS-H
dev0 wrote:I use different hardware: DIY with Wemos D1 and cheep Chinese H801 Controllers. Mostly only with warm white and cold white stripes to be able to adjust white color.
For my information, you compile the plugin with esp easy and flashed it in the H801, or do you use the Wemos D1 to send commands to the H801?

I compiled the plugin together with ESPEasy R120

Is shows this:
C:\Users\Herman\Desktop\Led dimmer plugin\ESPEasy\_P123_LIGHTS.ino: In function 'boolean Plugin_123(byte, EventStruct*, String&)':

_P123_LIGHTS:88: error: 'SENSOR_TYPE_QUAD' was not declared in this scope

Device[deviceCount].VType = SENSOR_TYPE_QUAD;

What to do?

Re: RGBWW Plugin development questions

Posted: 04 Jan 2017, 17:23
by dev0
You have to comple with ESPEasy R124 at least. See __ReleaseNotes.ino
ManS-H wrote: For my information, you compile the plugin with esp easy and flashed it in the H801, or do you use the Wemos D1 to send commands to the H801?
You can flash it on a H801 or any other ESP8266 device to which your leds are connected to.

Re: RGBWW Plugin development questions

Posted: 04 Jan 2017, 21:26
by ManS-H
dev0 wrote:You have to comple with ESPEasy R124 at least. See __ReleaseNotes.ino
ManS-H wrote: For my information, you compile the plugin with esp easy and flashed it in the H801, or do you use the Wemos D1 to send commands to the H801?
You can flash it on a H801 or any other ESP8266 device to which your leds are connected to.
dev0, ok i used the ESPEasy_R147_RC8 file, problem solved.

Only two questions:
Are those settings correct for flashing?
Setting for the H801: Flashsize "1M (64k SPIFFS)"
Setting for WeMos D1 mini: Flashsize "4M (1M SPIFFS)"

Re: RGBWW Plugin development questions

Posted: 05 Jan 2017, 04:50
by dev0
512k/64k for the H801

Re: RGBWW Plugin development questions

Posted: 05 Jan 2017, 12:19
by ManS-H
dev0 wrote:512k/64k for the H801
Compiling ESPEasy_R147_RC8 with this settings i see this:

Sketch uses 427,305 bytes (98%) of program storage space. Maximum is 434,160 bytes.
Global variables use 50,012 bytes (61%) of dynamic memory, leaving 31,908 bytes for local variables. Maximum is 81,920 bytes.

When i used it together with your file i see this:

Sketch uses 440,605 bytes (101%) of program storage space. Maximum is 434,160 bytes.
Global variables use 50,656 bytes (61%) of dynamic memory, leaving 31,264 bytes for local variables. Maximum is 81,920 bytes.
processing.app.debug.RunnerException: Sketch too big; see http://www.arduino.cc/en/Guide/Troubleshooting#size for tips on reducing it.
at cc.arduino.Compiler.size(Compiler.java:335)
at cc.arduino.Compiler.build(Compiler.java:159)
at processing.app.SketchController.build(SketchController.java:641)
at processing.app.Editor$BuildHandler.run(Editor.java:1782)
at java.lang.Thread.run(Thread.java:745)
Sketch too big; see http://www.arduino.cc/en/Guide/Troubleshooting#size for tips on reducing it.

What do i wrong? and what to do to solve this problem.
Hope you can help me.

Re: RGBWW Plugin development questions

Posted: 05 Jan 2017, 12:29
by dev0
ManS-H wrote:Sketch too big;
There is not enough space, you have to remove some unused plugins.
Please keep in mind that this is my support thread to request two new ESPEasy features/options and not a support thread for my plugin (that is still in development).

Re: RGBWW Plugin development questions

Posted: 05 Jan 2017, 17:53
by ManS-H
dev0 wrote:
ManS-H wrote:Sketch too big;
There is not enough space, you have to remove some unused plugins.
Please keep in mind that this is my support thread to request two new ESPEasy features/options and not a support thread for my plugin (that is still in development).
dev0, problem solved, i can create a binfile so the next step is upgrade the H801.

Re: RGBWW Plugin development questions

Posted: 20 Jan 2017, 21:36
by sledge
dev0, sorry to bother you but i would love to get your plugin working. I tried to compile 147_RC8 8, but with you plugin loaded i can´t get it to work.
In

ESPEasy.ino sketch i changed #define FLASH_EEPROM_SIZE from 4096 to 512

Arduino Settings:

Board: Generic ESP8266 Module
Flash Mode: DIO
Flash Frequency: 40MHZ
CPU Frequency: 80 MHZ
Flash Size: 512 (64K SPIFFS)
Debug port: Disabled
Debug Level: none
Reset Method: ck
Upload Speed: 115200
Port: COM5

Please give us a hint how to setup the board with your plugin. A precompiled image would also help.

Having said this i like to mention that i love your idea to develop a plugin for h801 mqtt rgb control and it would be a pleasure to me to give you a feedback how it works.

Sorry for hijacking your thread :roll:

Re: RGBWW Plugin development questions

Posted: 21 Jan 2017, 06:02
by dev0
sledge wrote: ESPEasy.ino sketch i changed #define FLASH_EEPROM_SIZE from 4096 to 512
This is not needed. You have to set Flash Size tp 512k/64k in Arduino IDE only. Copy the plugin, remove 2-3 unused Plugins, compile.
If there is a compiler error telling you that there is not enough space then remove another plugin. That's all.

Keep in mind that the plugin is not more then a proof of concept at the moment. A setup with only cw/ww stripes will work fine, but all other setups will not show an usable white for example. There is no color correction at all.

Re: RGBWW Plugin development questions

Posted: 22 Jan 2017, 13:35
by ManS-H
dev0 wrote:512k/64k for the H801
Hello Dev0, that is not correct. The H801 has the same flash chip as the ESP-01, Flash Chip ID: 1327328
So you can use 1M (64K SPIFFS) for the H801.

I did it with my H801 and it going perfect.

Re: RGBWW Plugin development questions

Posted: 22 Jan 2017, 13:48
by dev0
ManS-H wrote:
dev0 wrote:512k/64k for the H801
that is not correct.
I don't think you can know which flash chip is used on my hardware. May be there are other versions.

Re: RGBWW Plugin development questions

Posted: 22 Jan 2017, 14:05
by Waldmensch
sledge wrote:dev0, sorry to bother you but i would love to get your plugin working. I tried to compile 147_RC8 8, but with you plugin loaded i can´t get it to work:
You are not able to flash or you don't get it working? I can flash but the RGB commands show no effect on a simple RGB stripe (R,G,B, VCC)

Re: RGBWW Plugin development questions

Posted: 22 Jan 2017, 20:29
by sledge
Thx Dev0 it worked for me. Now we talk :)

To keep your thread clean i started a new one with a little documentation how to get your plugin running. viewtopic.php?f=2&t=2582

Re: RGBWW Plugin development questions

Posted: 27 May 2017, 19:40
by linker3000
Is it possible to send MQTT messages to control the RGB functionality? I so, may I have an example of how to set this up (topic and payload syntax).

Thanks

Re: RGBWW Plugin development questions

Posted: 28 May 2017, 08:33
by dev0
MQTT should be possible, as with all other plugins.

Re: RGBWW Plugin development questions

Posted: 14 Oct 2018, 21:32
by Dylantje
Is this plugin perhaps working??
Like to have a rgbw controller based on Espeasy..

Or are there @this time other espeasy rgbw controllers that are working with domoticz?