Announcement

Collapse
No announcement yet.

WLED and mcsMQTT

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    WLED and mcsMQTT

    I want to start off with the fact that I am a beginner with MQTT. I have been playing around with a nodemcu board connected to some LEDs running the WLED software (https://github.com/Aircoookie/WLED). I am using the mcsMQTT plugin as the broker and have my WLED nodemcu connecting to it successfully.

    After making changes I was able to discover the following items would update as I use the power button in the WLED software to turn them off or on as well as changing the color. However I have been unable to send an update to WLED using the associated homeseer device and change the color (c), brightness (g), etc...

    Anyone have this working with WLED? I'm sure I'm doing something wrong.
    Click image for larger version

Name:	wledinhs.png
Views:	464
Size:	39.1 KB
ID:	1353122

    #2
    Take a look at https://github.com/Aircoookie/WLED/wiki/MQTT for the command topics you should use with WLED

    In you case, for example, device 37 looks to be a RGB control. This is wled/cbbdb3/col publish commmand. Click on the 37 button to bring up the Edit tab and select RGB as the Control/Status UI type

    Looks like device 35 is the brightness. This will be a Number type and the publish topic is wled/cbbdb3

    On/Off control is also through the same topic as brightness so that makes it awkward. You could setup a On/Off button for the control and send to wled/cbbdb3. It could be tied to device 36. This is more complex, so first get the color and brightness working.

    Comment


      #3
      Made the changes you requested and after changing the publish topic and control/status UI type and was able to control the brightness and color. The only issue I ran into now is the color status of the homeseer device shows -1 instead of the color code.

      Comment


        #4
        Do you have the Control/Status UI on the Edit page setup to be a Number Type?
        Does WLED return values in the range 0 to 255 for the brightness?

        If you want button control for on and off then it will take some manual setup in HS. For device 36 on Edit page make the Control/Status UI to be Button. In the VSP section add two lines that make Off=1 and On=2. For the Payload template use $$LABEL: For Publish topic use wled/cbbdb3

        On HS Device Management Status/Graphics tab for device 36 change the type from Both for the On and Off to Control. Change the Both for the other item to be Status.

        You will now have two buttons on the HS browser for On and Off that will control the WLED. The On/Off status will not be reflected in device 36. I would expect Device 35 to change between 0 and 255 as the Off/On button is used.

        Comment


          #5
          The brightness is working as expected. The color (device 37) is showing -1 instead of the hex value. But it is changing the color successfully.
          Click image for larger version

Name:	HS_1.png
Views:	329
Size:	9.6 KB
ID:	1353143

          Comment


            #6
            I believe you need to remove the # prefix in the RGB. Use mcsMQTT Edit tab, regular expression. The manual has some examples. I believe what you need is
            match text box is #. Replace text box is blank.

            Comment


              #7
              Removing the # appeared to work. I now get accurate feedback its just in decimal format instead of hex, but at least everything is working.

              Comment


                #8
                I did not try this, but I think your dimmer device can be edited in HS Device Management, Status/Graphics tab. Change the range so that the On and Off dim levels reported are outside the range. Then add two single value butttons for On and Off. This way the device should show three controls in HS and the status will reflect whatever is reported by the WLED.

                Comment


                  #9
                  Originally posted by Michael McSharry View Post
                  I believe you need to remove the # prefix in the RGB. Use mcsMQTT Edit tab, regular expression. The manual has some examples. I believe what you need is
                  match text box is #. Replace text box is blank.
                  I am also running WLED and tried removing the # prefix with your instructions but it is not working. Can you tell me if I did this right?

                  Click image for larger version

Name:	Screen Shot 2020-06-06 at 5.48.00 PM.png
Views:	293
Size:	704.2 KB
ID:	1391825

                  Comment


                    #10
                    If your objective is to remove the # from received payloads then this setup is correct.

                    What is not working for you? For context what is working would also be helpful.

                    Comment


                      #11
                      Sorry. I was just saying that I have the same issue as the OP where my colors are changing but the status is not reflected in HS. The same is happening for the effects as well. I also deleted and reinstalled the PI to see if that would help but still getting the same results. I did notice there seem to be some topics that are created with "unknown". Would this be related?


                      Click image for larger version

Name:	Screen Shot 2020-06-07 at 6.56.35 AM.png
Views:	290
Size:	323.8 KB
ID:	1391909

                      Click image for larger version

Name:	Screen Shot 2020-06-07 at 7.11.23 AM.png
Views:	262
Size:	760.4 KB
ID:	1391910

                      Click image for larger version

Name:	Screen Shot 2020-06-07 at 7.11.36 AM.png
Views:	275
Size:	747.3 KB
ID:	1391908


                      Attached Files

                      Comment


                        #12
                        I retested WLED support and discovered that I broke the color control when Segment support was added in 5.2.8.0. To control segments the format is decimal r,b,g and to control the entire strip the format is #RRGGBB. To fix control of the entire strip, click on the Association tab Ref button for the c:RRGGBB Topic and change the control/status type from RGBW to RGB.

                        There is no need to mess with the # prefix in the payload template.

                        If Segments have been created then the plugin needs to be updated to 5.2.9.3 to get proper color control of both strip and segments. http://mcsSprinklers.com/mcsMQTT_5_2_9_3.zip contains HSPI_MCSMQTT.exe that goes into the HS folder. mcsMQTT_2020.dll goes into the \bin\mcsMQTT folder.

                        If the wled/xxxxxx topic has not yet been discovered by mcsMQTT then with 5.2.9.3 the proper color control will be setup so no need to use the Edit tab to change the control/status type. In my testing I obsoleted the wled topics from the General tab, Inbound Management section, obsolete row textbox with wled/#. This removed all the wled topics and HS devices and then when the WLED device is powered the discovery will occur and the HS devices properly created. It is likely easier for most to just use the Edit tab to change the control/status property of an already discovered color topic.

                        Comment


                          #13
                          Thanks Michael. I went ahead and upgraded to the new version and everything is working now!

                          Comment

                          Working...
                          X