Skip to content
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Controllers
  3. Homeseer
  4. RGBW Example
  • Getting Started
  • Controller
  • Build
  • Hardware
  • Download/API
  • Forum
  • Store

RGBW Example

Scheduled Pinned Locked Moved Homeseer
14 Posts 6 Posters 9.8k Views 4 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    LastSamurai
    Hardware Contributor
    wrote on last edited by
    #5

    Thanks for that example. Looks like domoticz also supports it. I will have to try that soon.

    1 Reply Last reply
    0
    • V Offline
      V Offline
      vil1driver
      wrote on last edited by vil1driver
      #6

      I hope you will like it, dimoticz not fully support S_RGB_LIGHT yet but this sketch use three dimmers and one on/off for start/stop rgb color cycle. Work just perfect. :-) thanks hek to share it.

      1 Reply Last reply
      0
      • L Offline
        L Offline
        LastSamurai
        Hardware Contributor
        wrote on last edited by
        #7

        Which sketch do you mean? The one hek posted? The one in the post you linked is only displaying the values it gets...

        1 Reply Last reply
        0
        • V Offline
          V Offline
          vil1driver
          wrote on last edited by vil1driver
          #8

          I was mean mine :D RGB-3D.ino.

          howto, sry for french thread but screenshots are useful..

          you can try gizmocuz test sketch like I done, but as you can read (link posted) it's not usable yet

          ps: why posting in homeseer controler section, if you use domoticz ?

          1 Reply Last reply
          0
          • L Offline
            L Offline
            LastSamurai
            Hardware Contributor
            wrote on last edited by
            #9

            Guess I will have to see how good my french still is^^

            Good question actually... I don't know why this is in the homeseer section. I defenitly intended it to bin the the domoticz section. Could someone move this?

            Anyways, I got it to work with domoticz only partially. It shows up as an RGBW switch but you can only select RGB colors (where do you get the white part from?) and it seems like only on and off commands reach the sensor. No new color values.
            I will keep trying though.

            1 Reply Last reply
            0
            • L Offline
              L Offline
              LastSamurai
              Hardware Contributor
              wrote on last edited by LastSamurai
              #10

              V_RGBW seems to be working. I will post my code once one more problem is solved:
              I do get a new hex string from the server on the arduino side... how do I break that up into 4x 0..255 values to control the pwm pins? I found some hints to use bit shifting, but I am unsure how to use that. Any ideas?

              Example:

              void incomingMessage(const MyMessage &message) {
              
              // h = hex value
              // message = e.g. (h) #112233AB
              redval = ?; // h11 => 17
              greenval = ?; // h22 => 34
              blueval = ?; // h33 = 51
              whiteval = ?; //AB = 171
              
              analogWrite(RED_PIN, redval);     
              analogWrite(GREEN_PIN, greenval);
              analogWrite(BLUE_PIN, blueval);
              analogWrite(WHITE_PIN, whiteval);
              
              }
              
              1 Reply Last reply
              0
              • K Offline
                K Offline
                kaziya
                wrote on last edited by
                #11

                i just built an rgb led light last weekend, so i would like to see get the code working as rgb vs 3 dimmers.

                i did a quick google i found this http://stackoverflow.com/questions/23576827/arduino-convert-a-sting-hex-ffffff-into-3-int which seems to be what your looking for with 3 values, i havent had a chance to test it or expand it to 4 values.

                @LastSamurai anychance you would be willing to share what you have so far?

                1 Reply Last reply
                0
                • L Offline
                  L Offline
                  LastSamurai
                  Hardware Contributor
                  wrote on last edited by
                  #12

                  I surely would, but I sadly haven't had the time to do more testing. Perhaps this weekend. I posted my own question on stackoverflow and it seems like I have found a solution (although not tested by me yet).
                  Domoticz with V_RGBW worked though when I first tried it. With that part of the code you should be able to get it up and running.

                  fetsF 1 Reply Last reply
                  0
                  • L LastSamurai

                    I surely would, but I sadly haven't had the time to do more testing. Perhaps this weekend. I posted my own question on stackoverflow and it seems like I have found a solution (although not tested by me yet).
                    Domoticz with V_RGBW worked though when I first tried it. With that part of the code you should be able to get it up and running.

                    fetsF Offline
                    fetsF Offline
                    fets
                    wrote on last edited by
                    #13

                    To convert a hex string to elementary colors, you have to do, something like that :

                    1- convert your string to unsigned 32 bit integer

                       unsigned long value = strtol( hexstring, NULL, 16);
                    

                    2- assuming your integer is coded : 0xrrggbbww

                       uint8_t redval = (value >> 24) & 0xFF ;
                       uint8_t greenval = (value >> 16) & 0xFF ;
                       uint8_t blueval = (value >> 8) & 0xFF ;
                       uint8_t whiteval = value & 0xFF ;
                    
                    1 Reply Last reply
                    0
                    • L Offline
                      L Offline
                      LastSamurai
                      Hardware Contributor
                      wrote on last edited by
                      #14

                      Thanks for the help. I got it to work. I posted a link to the code over here.

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      15

                      Online

                      11.7k

                      Users

                      11.2k

                      Topics

                      113.0k

                      Posts


                      Copyright 2019 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • OpenHardware.io
                      • Categories
                      • Recent
                      • Tags
                      • Popular