I want to use an wemos d1 mini as a master and an arduino as slave to make a clock.
The clock use an RGB strip led (ws2812b). I only need to send information to the arduino with a serial liason. (because I already a code with bluetooth)
Because of that i have to program myself the wemos and not use a firmware.
With many tutorial i finally speak with my board and i can send an on/Off signal with the RGB switch:


One of help found give me a lua script which i have done some changes to send the right URL to my board.
Code: Select all
commandArray = {}
DomDevice = 'P1'; -- Votre peripherique à controler
IP = '192.168.0.32'; -- L'adresse IP de l'ESP8266
PIN = "20"; -- Le pin GPIO du servo
if devicechanged['P1'] then
if(devicechanged[DomDevice]=='Off') then
print ("OFF dim = "..DomDevice);
CalcValue = 0x00;
else if(devicechanged[DomDevice]=='On') then
print ("ON dim = "..DomDevice);
CalcValue = 0xFFFFF;
else
print("Other");
DomValue = otherdevices_svalues[DomDevice];
CalcValue=DomValue;
--commandArray['Variable:dimmer'] = tostring(DomValue);
print ("dim Level = "..CalcValue);
end
end
runcommand = "http://" .. IP .. "/gpio?id=" ..PIN.. "&etat="..CalcValue .. "&token=123abCde"; -- Commande de Led
print(runcommand);
commandArray['OpenURL']=runcommand;
print("PWM value= "..CalcValue);
end
return commandArray
But something that i can't find on the internet is that i can't get the RGB value of the color wheel.
I see on the log one i make a changes on the color wheel this:
So what i undestand is that2020-03-16 13:14:30.534 Status: setcolbrightnessvalue: ID: 1, bri: 50, color: '{m: 3, RGB: 9dff96, CWWW: 0000, CT: 0}'
2020-03-16 13:14:30.569 Status: LUA: Other
2020-03-16 13:14:30.569 Status: LUA: dim Level = 50
2020-03-16 13:14:30.569 Status: LUA: http://192.168.0.32/gpio?id=20&etat=50&token=123abCde
2020-03-16 13:14:30.570 Status: LUA: PWM value= 50
2020-03-16 13:14:30.570 Status: EventSystem: Fetching URL http://192.168.0.32/gpio?id=20&etat=50&token=123abCde after 0.2 seconds...
2020-03-16 13:14:30.570 Status: EventSystem: Script event triggered: RGBSwitch
2020-03-16 13:14:33.968 Error: Error opening url: http://192.168.0.32/gpio?id=20&etat=50&token=123abCde
2020-03-16 13:15:00.377 Error: EventSystem: in RGBSwitch: [string "-- Merci @MikeF : https://www.domoticz.com/fo..."]:11: attempt to index global 'devicechanged' (a nil value)
Code: Select all
DomValue = otherdevices_svalues[DomDevice
To resume
How can i get the RGB value of the RGB switch?
And my two more questions which are less important is :
what does mean the two last Error ?
The first one, i suppose that it can't open the link, but it triggered anyway the board, so it's a "non-error"
And the second one (which i get aproximatly every minutes) i suppose it's because i try to check on the device change list, but because i haven't any devices i got an error. So again a "non-error"
Thanks in advance for any help you can provide.