Announcement

Collapse
No announcement yet.

WLED/mcsMQTT - HSTouch integration

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

    #16
    I have various color model conversions. I think the one I am using matches the HS HSV and comes from the ,NET library with method GetBrightness. I will review again.

    In either case the problem of a change in master brightness on WLED UI is reported as only a brightness change without any change in the reported RGB color. Similarly a RGB color command does not affect the WLED master brightness. No matter what RGB value is sent the status feedback for /g (brightness) never changes. Since the LEDs do seem to track the RGB commanded shade of color there should be some deterministic way to achieve an acceptable integration.

    From a user’s perspective it is a good thing to have the controls independent so a user can increase brightness without changing hue/saturation or change from red to blue while still keeping the brightness the same. With this operational model it would make sense to use HSB/HSL for the LAN control rather than RGB. I suspect that users interested in integration requested RGB because that is what their automation systems used.

    Comment


      #17
      I read the WLED WiKi and now understand the brightness is scale factor and not part of the color space. This means use of standard color conversion should be possible

      Comment


        #18
        Once the confusion that brighness is a gain and not a color space component was cleared the integration went well.

        HS4: http://mcsSprinklers.com/MCSMQTTHS4_52120.zip

        For existing WLED setup the Edit tab will be used to change the Color feature from RGB to HSB. This will create three additional sliders. They will be appended to the end of the existing associated devices in the WLED Device. Manual change of the name will be necessary to make it more understandable.

        For new discovery of a WLED device the devices will be created as shown below. Use of the color picker or any of the three sliders will result in a new RGB being delivered to WLED. Any update by WLED of the color will result in the RGB, H, S and B/V features being updated.

        Click image for larger version

Name:	Capture.JPG
Views:	103
Size:	119.1 KB
ID:	1504490

        Comment


          #19
          Great news, thank you Michael.
          Did you have the opportunity to generate the HS3 version as I haven't migrated yet.
          Will test and report back Cheers,
          HS3, HSTouch Designer, ESP based devices and sensors, Tasmota, OpenMQTTGateway, RTL433, DIY ground plane antenna, BlueIris + LAN cams, USB-UIRT, ATON DLA amp, WACUP, Multiple Android tablets for control.
          Plug-Ins Enabled: Restart:,mcsMonitor:,EnvCan:,EasyTrigger:,CM15A:,BLUSBUIRT:, BLLAN:,BLBackup:,Pushover 3P:,mcsMQTT:

          Comment


            #20
            No I have not yet, but will do it this evening or tomorrow.

            Comment


              #21
              HS3 update at http://mcsSprinklers.com/mcsMQTT_5_21_2_3.zip

              This is an Updater package so you can use updater override process or just extract the mcsMQTT_2020.* files.

              Comment


                #22
                Thanks again Michael.

                one more thing still related to the HStouch integration:

                in order to display the selected color(s) in HStouch, I have a script to convert the color code to a small bitmap which can then be used as desired in the designer (background, slider, button, etc )

                Since the script is based on Tasmota's comma delimited/decimal RGB (RRR,GGG,BBB),

                Click image for larger version

Name:	Screenshot_20211104-001924_Chrome~2.jpg
Views:	34
Size:	22.1 KB
ID:	1506258

                Click image for larger version  Name:	Screenshot_20211104-002328_Chrome.jpg Views:	0 Size:	21.2 KB ID:	1506257

                could you add this format under the "string" field of WLED color devices? (Which is currently unused)
                or create a separate device for it if interferes with your coding logic.

                This would enable the usage of a single script for both Tasmota & WLED.

                Let me know if this makes sense.

                Thx
                HS3, HSTouch Designer, ESP based devices and sensors, Tasmota, OpenMQTTGateway, RTL433, DIY ground plane antenna, BlueIris + LAN cams, USB-UIRT, ATON DLA amp, WACUP, Multiple Android tablets for control.
                Plug-Ins Enabled: Restart:,mcsMonitor:,EnvCan:,EasyTrigger:,CM15A:,BLUSBUIRT:, BLLAN:,BLBackup:,Pushover 3P:,mcsMQTT:

                Comment


                  #23
                  Since you are using a script for this conversion it seems that the script could be smart enough to recognize Tasmota vs. WLED format and do the appropriate conversions. mcsMQTT already has various functions exposed. I could add color space conversions as well. As an example I could expose the following or this conversion could be included directly in your script. Does this server the need?

                  The problem with using the HS Sting property is that it takes precedence over the Value property when Device Status is shown.

                  Code:
                  Public Function RgbToRgb(ByVal sRGB As String) As String
                  'return JSON payload to command ESPHome light color given a RGB input hex value
                  Dim ir As Int32
                  Dim ig As Int32
                  Dim ib As Int32
                  Dim rgbLength As Integer = sRGB.Length
                  If rgbLength >= 6 Then
                  ir = Convert.ToInt32(sRGB.Substring(rgbLength - 6, 2), 16)
                  ig = Convert.ToInt32(sRGB.Substring(rgbLength - 4, 2), 16)
                  ib = Convert.ToInt32(sRGB.Substring(rgbLength - 2, 2), 16)
                  Else
                  ir = 0
                  ig = 0
                  ib = 0
                  End If
                  Return "{""r"":" & ir.ToString & ",""g"":" & ig.ToString & ",""b"":" & ib.ToString & "}"
                  End Function

                  Comment


                    #24
                    Originally posted by Michael McSharry View Post

                    The problem with using the HS Sting property is that it takes precedence over the Value property when Device Status is shown.
                    Right. Thought about it just after sending the suggestion...
                    ​​​​​​
                    color space conversions would be a nice addition but i'll try to play with the script over the weekend and see how I can get things working. Will report back.

                    A fall back plan would be to directly expose the WLED GUI in HSTouch but the embedded browser is so outdated that anything with a modern html code fails miserably.

                    HStouch really needs a facelift 😕 so that HS can differentiate itself and gain traction from power users vs Home Assistant...

                    Starting with a decent color picker integration + an upgrade to the embedded browser.

                    Thanks again Michael.
                    ​​​​​​​the community support is what keeps me commited to HS.

                    ​​​​​​

                    ​​​​​

                    ​​​​​​
                    HS3, HSTouch Designer, ESP based devices and sensors, Tasmota, OpenMQTTGateway, RTL433, DIY ground plane antenna, BlueIris + LAN cams, USB-UIRT, ATON DLA amp, WACUP, Multiple Android tablets for control.
                    Plug-Ins Enabled: Restart:,mcsMonitor:,EnvCan:,EasyTrigger:,CM15A:,BLUSBUIRT:, BLLAN:,BLBackup:,Pushover 3P:,mcsMQTT:

                    Comment


                      #25
                      Hi Michael, not sure if this is specific to the HS3 version :
                      HSV devices are automatically populated but the ranges/sliders do not get created.
                      They can be manually added and control seem to work however; let me know if you can reproduce. Thx.
                      HS3, HSTouch Designer, ESP based devices and sensors, Tasmota, OpenMQTTGateway, RTL433, DIY ground plane antenna, BlueIris + LAN cams, USB-UIRT, ATON DLA amp, WACUP, Multiple Android tablets for control.
                      Plug-Ins Enabled: Restart:,mcsMonitor:,EnvCan:,EasyTrigger:,CM15A:,BLUSBUIRT:, BLLAN:,BLBackup:,Pushover 3P:,mcsMQTT:

                      Comment


                        #26
                        Question: since "presets" are simply presented as 1-15, I assume the API doesn't pass the presets names right?
                        I guess a workaround could be to create "playlists" and have them run a single looping preset.

                        Edit: forget this one, can be done via VSPs.... thx
                        HS3, HSTouch Designer, ESP based devices and sensors, Tasmota, OpenMQTTGateway, RTL433, DIY ground plane antenna, BlueIris + LAN cams, USB-UIRT, ATON DLA amp, WACUP, Multiple Android tablets for control.
                        Plug-Ins Enabled: Restart:,mcsMonitor:,EnvCan:,EasyTrigger:,CM15A:,BLUSBUIRT:, BLLAN:,BLBackup:,Pushover 3P:,mcsMQTT:

                        Comment


                          #27
                          I have limited access to system for testing right now, but will look into the sliders as best I can soon.

                          Which process did you use to create the HSB devices. Was it rediscovery of the wled topic or was it change of the control/status UI to HSB?

                          Comment


                            #28
                            Thx, no hurry;
                            I deleted the whole topic and rediscovered.

                            HS3, HSTouch Designer, ESP based devices and sensors, Tasmota, OpenMQTTGateway, RTL433, DIY ground plane antenna, BlueIris + LAN cams, USB-UIRT, ATON DLA amp, WACUP, Multiple Android tablets for control.
                            Plug-Ins Enabled: Restart:,mcsMonitor:,EnvCan:,EasyTrigger:,CM15A:,BLUSBUIRT:, BLLAN:,BLBackup:,Pushover 3P:,mcsMQTT:

                            Comment


                              #29
                              I tried to reproduce the issue and was not able. Can you provide more info

                              Click image for larger version

Name:	Capture.JPG
Views:	31
Size:	68.6 KB
ID:	1507561

                              Comment


                                #30
                                I have 3 segments, it's probably related. Can you try with segments? Thx
                                HS3, HSTouch Designer, ESP based devices and sensors, Tasmota, OpenMQTTGateway, RTL433, DIY ground plane antenna, BlueIris + LAN cams, USB-UIRT, ATON DLA amp, WACUP, Multiple Android tablets for control.
                                Plug-Ins Enabled: Restart:,mcsMonitor:,EnvCan:,EasyTrigger:,CM15A:,BLUSBUIRT:, BLLAN:,BLBackup:,Pushover 3P:,mcsMQTT:

                                Comment

                                Working...
                                X