RGBWW Plugin development questions

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
User avatar
dev0
Normal user
Posts: 18
Joined: 08 Sep 2016, 14:13

RGBWW Plugin development questions

#1 Post by dev0 » 10 Dec 2016, 08:39

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)
Last edited by dev0 on 12 Dec 2016, 08:41, edited 1 time in total.

User avatar
dev0
Normal user
Posts: 18
Joined: 08 Sep 2016, 14:13

Re: RGBWW Plugin development questions

#2 Post by dev0 » 11 Dec 2016, 10:58

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.

User avatar
dev0
Normal user
Posts: 18
Joined: 08 Sep 2016, 14:13

Re: RGBWW Plugin development questions

#3 Post by dev0 » 17 Dec 2016, 08:46

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) ?

rwest
New user
Posts: 4
Joined: 06 Dec 2016, 15:23

Re: RGBWW Plugin development questions

#4 Post by rwest » 20 Dec 2016, 23:22

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

User avatar
dev0
Normal user
Posts: 18
Joined: 08 Sep 2016, 14:13

Re: RGBWW Plugin development questions

#5 Post by dev0 » 21 Dec 2016, 06:40

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.

User avatar
dev0
Normal user
Posts: 18
Joined: 08 Sep 2016, 14:13

Re: RGBWW Plugin development questions

#6 Post by dev0 » 30 Dec 2016, 08:19

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.

Dylantje
Normal user
Posts: 255
Joined: 11 Oct 2015, 16:51

Re: RGBWW Plugin development questions

#7 Post by Dylantje » 03 Jan 2017, 19:04

sorry for my dombo question.
Only can i or can i not control a rgbw strip, with easpeasy?

User avatar
dev0
Normal user
Posts: 18
Joined: 08 Sep 2016, 14:13

Re: RGBWW Plugin development questions

#8 Post by dev0 » 04 Jan 2017, 06:24

Yes, you can control RGB, RGBW and RGBWW lights with my plugin.

Dylantje
Normal user
Posts: 255
Joined: 11 Oct 2015, 16:51

Re: RGBWW Plugin development questions

#9 Post by Dylantje » 04 Jan 2017, 09:16

Please tell me how.

User avatar
dev0
Normal user
Posts: 18
Joined: 08 Sep 2016, 14:13

Re: RGBWW Plugin development questions

#10 Post by dev0 » 04 Jan 2017, 09:20

Command description can be found on github, too: https://github.com/ddtlabs/ESPEasy-Plugin-Lights

User avatar
ManS-H
Normal user
Posts: 279
Joined: 27 Dec 2015, 11:26
Location: the Netherlands

Re: RGBWW Plugin development questions

#11 Post by ManS-H » 04 Jan 2017, 11:32

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.

User avatar
dev0
Normal user
Posts: 18
Joined: 08 Sep 2016, 14:13

Re: RGBWW Plugin development questions

#12 Post by dev0 » 04 Jan 2017, 11:55

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.

Dylantje
Normal user
Posts: 255
Joined: 11 Oct 2015, 16:51

Re: RGBWW Plugin development questions

#13 Post by Dylantje » 04 Jan 2017, 12:13

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?

User avatar
ManS-H
Normal user
Posts: 279
Joined: 27 Dec 2015, 11:26
Location: the Netherlands

Re: RGBWW Plugin development questions

#14 Post by ManS-H » 04 Jan 2017, 13:10

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?

User avatar
dev0
Normal user
Posts: 18
Joined: 08 Sep 2016, 14:13

Re: RGBWW Plugin development questions

#15 Post by dev0 » 04 Jan 2017, 17:23

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.

User avatar
ManS-H
Normal user
Posts: 279
Joined: 27 Dec 2015, 11:26
Location: the Netherlands

Re: RGBWW Plugin development questions

#16 Post by ManS-H » 04 Jan 2017, 21:26

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)"

User avatar
dev0
Normal user
Posts: 18
Joined: 08 Sep 2016, 14:13

Re: RGBWW Plugin development questions

#17 Post by dev0 » 05 Jan 2017, 04:50

512k/64k for the H801

User avatar
ManS-H
Normal user
Posts: 279
Joined: 27 Dec 2015, 11:26
Location: the Netherlands

Re: RGBWW Plugin development questions

#18 Post by ManS-H » 05 Jan 2017, 12:19

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.

User avatar
dev0
Normal user
Posts: 18
Joined: 08 Sep 2016, 14:13

Re: RGBWW Plugin development questions

#19 Post by dev0 » 05 Jan 2017, 12:29

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).

User avatar
ManS-H
Normal user
Posts: 279
Joined: 27 Dec 2015, 11:26
Location: the Netherlands

Re: RGBWW Plugin development questions

#20 Post by ManS-H » 05 Jan 2017, 17:53

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.

sledge
Normal user
Posts: 17
Joined: 20 Jan 2017, 20:42

Re: RGBWW Plugin development questions

#21 Post by sledge » 20 Jan 2017, 21:36

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:

User avatar
dev0
Normal user
Posts: 18
Joined: 08 Sep 2016, 14:13

Re: RGBWW Plugin development questions

#22 Post by dev0 » 21 Jan 2017, 06:02

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.

User avatar
ManS-H
Normal user
Posts: 279
Joined: 27 Dec 2015, 11:26
Location: the Netherlands

Re: RGBWW Plugin development questions

#23 Post by ManS-H » 22 Jan 2017, 13:35

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.

User avatar
dev0
Normal user
Posts: 18
Joined: 08 Sep 2016, 14:13

Re: RGBWW Plugin development questions

#24 Post by dev0 » 22 Jan 2017, 13:48

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.

Waldmensch
Normal user
Posts: 11
Joined: 28 Nov 2016, 17:12

Re: RGBWW Plugin development questions

#25 Post by Waldmensch » 22 Jan 2017, 14:05

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)

sledge
Normal user
Posts: 17
Joined: 20 Jan 2017, 20:42

Re: RGBWW Plugin development questions

#26 Post by sledge » 22 Jan 2017, 20:29

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

linker3000
Normal user
Posts: 12
Joined: 08 May 2017, 09:51

Re: RGBWW Plugin development questions

#27 Post by linker3000 » 27 May 2017, 19:40

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

User avatar
dev0
Normal user
Posts: 18
Joined: 08 Sep 2016, 14:13

Re: RGBWW Plugin development questions

#28 Post by dev0 » 28 May 2017, 08:33

MQTT should be possible, as with all other plugins.

Dylantje
Normal user
Posts: 255
Joined: 11 Oct 2015, 16:51

Re: RGBWW Plugin development questions

#29 Post by Dylantje » 14 Oct 2018, 21:32

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?

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 40 guests