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. PiDome
  4. Send color data to sensors
  • Getting Started
  • Controller
  • Build
  • Hardware
  • Download/API
  • Forum
  • Store

Send color data to sensors

Scheduled Pinned Locked Moved PiDome
controllercolor
22 Posts 8 Posters 13.0k Views 6 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.
  • JohnJ Offline
    JohnJ Offline
    John
    Plugin Developer
    wrote on last edited by
    #1

    Hi Guys,

    This is one to think of and it would be nice to have input from the users.

    A this moment there is no V_* available (as far as i have understood it) to hold a color string/code. I have seen code passing by sending three vars (VAR_1 to VAR_3) with percentages.

    I'm getting questions if it is able to use the color picker to send colors to nodes. So here is the question:
    I can send one of the following three vars to nodes (without the ()-characters of course):
    RGB as hex (000000 to FFFFFF),
    RGB as int (0-255,0-255,0-255),
    or HSL as floats (0-360, 0-100,0-100).

    It would not matter which V_TYPE you would be using, but the data containing it does. Because i would like to support it, what would be the optimal data format you guys prefer?

    My Domotica project: http://www.pidome.org

    1 Reply Last reply
    0
    • tbowmoT Offline
      tbowmoT Offline
      tbowmo
      Admin
      wrote on last edited by
      #2

      Maybe a candidate for a new data / variable type?

      JohnJ 1 Reply Last reply
      0
      • tbowmoT tbowmo

        Maybe a candidate for a new data / variable type?

        JohnJ Offline
        JohnJ Offline
        John
        Plugin Developer
        wrote on last edited by John
        #3

        @tbowmo
        That would be handy for creators, PiDome does not care about the V_* types, only the datatype it contains ;) which is defined in the server's device editor.

        My Domotica project: http://www.pidome.org

        BulldogLowellB 1 Reply Last reply
        0
        • JohnJ John

          @tbowmo
          That would be handy for creators, PiDome does not care about the V_* types, only the datatype it contains ;) which is defined in the server's device editor.

          BulldogLowellB Offline
          BulldogLowellB Offline
          BulldogLowell
          Contest Winner
          wrote on last edited by
          #4

          @John

          nice idea

          an (unsigned) long would allow us to bit shift the three values easily and allow an extra byte for something else (e.g led ID, state, etc). We could add a function to decode in the library.

          I worked on (a while back) a concept of "broadcasting" a number that each node could use to show a 'system status' with one RGB led (i.e. alarm armed/unarmed, doors locked, unlocked). I like the idea of having a "transmit to all listening" function.

          JohnJ 1 Reply Last reply
          0
          • BulldogLowellB BulldogLowell

            @John

            nice idea

            an (unsigned) long would allow us to bit shift the three values easily and allow an extra byte for something else (e.g led ID, state, etc). We could add a function to decode in the library.

            I worked on (a while back) a concept of "broadcasting" a number that each node could use to show a 'system status' with one RGB led (i.e. alarm armed/unarmed, doors locked, unlocked). I like the idea of having a "transmit to all listening" function.

            JohnJ Offline
            JohnJ Offline
            John
            Plugin Developer
            wrote on last edited by John
            #5

            @BulldogLowell
            That would of course also be possible, By using this there would then be some information needed for users for the bit shifting code on the MySensor node side. Because when implemented it would become a global message for MySensors nodes.

            P.S. wouldn't an int be enough?

            [EDIT]Scrap my P.S.[/EDIT]

            My Domotica project: http://www.pidome.org

            BulldogLowellB 1 Reply Last reply
            0
            • JohnJ John

              @BulldogLowell
              That would of course also be possible, By using this there would then be some information needed for users for the bit shifting code on the MySensor node side. Because when implemented it would become a global message for MySensors nodes.

              P.S. wouldn't an int be enough?

              [EDIT]Scrap my P.S.[/EDIT]

              BulldogLowellB Offline
              BulldogLowellB Offline
              BulldogLowell
              Contest Winner
              wrote on last edited by
              #6

              @John

              an int array, you mean?

              can you fit your RGB 3bytes into arduino's 16bit int?

              JohnJ 1 Reply Last reply
              0
              • BulldogLowellB BulldogLowell

                @John

                an int array, you mean?

                can you fit your RGB 3bytes into arduino's 16bit int?

                JohnJ Offline
                JohnJ Offline
                John
                Plugin Developer
                wrote on last edited by
                #7

                @BulldogLowell
                Was thinking 32bit, sorry....

                My Domotica project: http://www.pidome.org

                1 Reply Last reply
                0
                • BulldogLowellB Offline
                  BulldogLowellB Offline
                  BulldogLowell
                  Contest Winner
                  wrote on last edited by
                  #8

                  yup, you gotta think small!

                  JohnJ 1 Reply Last reply
                  0
                  • BulldogLowellB BulldogLowell

                    yup, you gotta think small!

                    JohnJ Offline
                    JohnJ Offline
                    John
                    Plugin Developer
                    wrote on last edited by John
                    #9

                    @BulldogLowell
                    Yup, i'm spoiled.....

                    I will take this option in consideration. It does depends on what users would prefer the most.

                    My Domotica project: http://www.pidome.org

                    1 Reply Last reply
                    0
                    • hekH Online
                      hekH Online
                      hek
                      Admin
                      wrote on last edited by
                      #10

                      In the next version RGB values it will be transmitted as a 3 byte binary value over the air.
                      On the serial line it will probably be split into decimal json like: {red:<0-255>;green:<0-255>;blue:<0-255>}.

                      If you want to add this to 1.4.1 i would suggest sending data as RGB hex string (to make survive over serial interface).

                      1 Reply Last reply
                      0
                      • JohnJ Offline
                        JohnJ Offline
                        John
                        Plugin Developer
                        wrote on last edited by John
                        #11

                        Then to make sure there is as less data as possible over the air then this would mean to send data as: "000000" to "ffffff" (so no "#" char)

                        This also has my personal preference, but want to know how the community would like it to handle it on the node side.

                        My Domotica project: http://www.pidome.org

                        1 Reply Last reply
                        0
                        • hekH Online
                          hekH Online
                          hek
                          Admin
                          wrote on last edited by hek
                          #12

                          Using something like:

                          string hexstring = "FF3Fa0";
                          int number = (int) strtol( &hexstring, NULL, 16);
                          int r = number >> 16;
                          int g = number >> 8 & 0xFF;
                          int b = number & 0xFF;
                          
                          JohnJ 1 Reply Last reply
                          0
                          • hekH hek

                            Using something like:

                            string hexstring = "FF3Fa0";
                            int number = (int) strtol( &hexstring, NULL, 16);
                            int r = number >> 16;
                            int g = number >> 8 & 0xFF;
                            int b = number & 0xFF;
                            
                            JohnJ Offline
                            JohnJ Offline
                            John
                            Plugin Developer
                            wrote on last edited by
                            #13

                            @hek
                            Understood, i meant how they want to receive the data. @BulldogLowell would like to receive a long instead of an hex string (if i understood it correctly).

                            That's the part i'm interested in.

                            My Domotica project: http://www.pidome.org

                            BulldogLowellB 1 Reply Last reply
                            0
                            • JohnJ John

                              @hek
                              Understood, i meant how they want to receive the data. @BulldogLowell would like to receive a long instead of an hex string (if i understood it correctly).

                              That's the part i'm interested in.

                              BulldogLowellB Offline
                              BulldogLowellB Offline
                              BulldogLowell
                              Contest Winner
                              wrote on last edited by
                              #14

                              @John

                              The 3byte message works here.

                              Like I mentioned, a little function to put a bow in it.

                              1 Reply Last reply
                              0
                              • A Offline
                                A Offline
                                arendst
                                wrote on last edited by arendst
                                #15

                                I agree on the 6 character hex text value. Who will implement this when in 1.4.2?
                                I have build a RGB neopixel led strip actuator and I would like to control the colours with V_RGB.
                                Thanks in advance. 😉

                                JohnJ 1 Reply Last reply
                                0
                                • A arendst

                                  I agree on the 6 character hex text value. Who will implement this when in 1.4.2?
                                  I have build a RGB neopixel led strip actuator and I would like to control the colours with V_RGB.
                                  Thanks in advance. 😉

                                  JohnJ Offline
                                  JohnJ Offline
                                  John
                                  Plugin Developer
                                  wrote on last edited by John
                                  #16

                                  @arendst
                                  Together with an user this is implemented in the current PiDome version available on the build server. He has posted a little tutorial on how to do this. So if you are a PiDome user: http://forum.pidome.org/viewtopic.php?id=58

                                  It is only available in the serial version for testing purposes.

                                  If all goes well, it will be extended to the MQTT version.

                                  [EDIT]It sends hex values which can be extracted as posted above[/EDIT]

                                  My Domotica project: http://www.pidome.org

                                  1 Reply Last reply
                                  0
                                  • A Offline
                                    A Offline
                                    arendst
                                    wrote on last edited by
                                    #17

                                    @John
                                    Thanks for the response. I use Domoticz as controller which just started to support MySensors. It works great for V_Light and V_Dimmer but lacks RGB color support as the MySensors library lacks color support too.

                                    @hek
                                    Why not update the MySensors library with S_Color and V_RGB. That way Domoticz and other controllers can support color natively.

                                    hekH 1 Reply Last reply
                                    0
                                    • A arendst

                                      @John
                                      Thanks for the response. I use Domoticz as controller which just started to support MySensors. It works great for V_Light and V_Dimmer but lacks RGB color support as the MySensors library lacks color support too.

                                      @hek
                                      Why not update the MySensors library with S_Color and V_RGB. That way Domoticz and other controllers can support color natively.

                                      hekH Online
                                      hekH Online
                                      hek
                                      Admin
                                      wrote on last edited by
                                      #18

                                      @arendst said:

                                      Why not update the MySensors library with S_Color and V_RGB. That way Domoticz and other controllers can support color natively.

                                      Wanted to add this in the next major release. But if this drags out (time-wise) I might add it to the next minor as well.

                                      1 Reply Last reply
                                      0
                                      • D Offline
                                        D Offline
                                        davy39
                                        wrote on last edited by
                                        #19

                                        Hi guys,
                                        Any news about that ?
                                        Is it now possible to use domoticz's rgb module to control an rgb led strip through an arduino mysensor node ?
                                        Thanks for your help.

                                        1 Reply Last reply
                                        0
                                        • D Offline
                                          D Offline
                                          davy39
                                          wrote on last edited by
                                          #20

                                          up !
                                          Could anyone help me to configure domoticz & mysensors in order to control analog RGB led strip ?

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


                                          14

                                          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