Skip to content
  • MySensors
  • 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. Domoticz
  4. Dsiplaying dimmer percentage in Domoticz

Dsiplaying dimmer percentage in Domoticz

Scheduled Pinned Locked Moved Domoticz
10 Posts 3 Posters 6.8k Views 3 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.
  • M Offline
    M Offline
    MikeF
    wrote on last edited by
    #1

    I'm using an RGBW LED controller with the MySensors RGB-3D sketch, and Domoticz as controller. I've set up the four LED channels as dimmers in Domoticz, and I can control the LEDs via the sliders and on / off switches.

    Using the sliders displays percentages OK in Domoticz, and turning off a channel leaves the slider at the last position (but displays 'Off'). However, turn back on and the slider goes to 100% (and the switch displays 'On'), although the sketch - correctly - restores the last dimmer value (e.g., 60%).

    Is there any way to get Domoticz to display the percentage (slider and value) when turning the switch back on?

    1 Reply Last reply
    0
    • fifipil909F Offline
      fifipil909F Offline
      fifipil909
      wrote on last edited by
      #2

      I've got same issue.
      After some debug, it appear that domoticz always set value to 100% when turning a Dimmer to on.
      So, just backup the % value on your sensor, and send it back to domoticz when you receive the V_Light message.

      you will see on this page, http://www.mysensors.org/build/dimmer line 223 that the % value is sent back to the controller.

      1 Reply Last reply
      0
      • M Offline
        M Offline
        MikeF
        wrote on last edited by
        #3

        Thanks for the pointer @fifipil909 - I've now got it working successfully :smile:

        1 Reply Last reply
        0
        • M Offline
          M Offline
          MikeF
          wrote on last edited by
          #4

          I'm seeing a strange effect with the same setup: if I drag the slider in Domoticz, it will display a percentage (e.g., 63%), but MySensors often displays a value (in Serial Monitor) a few points lower (e.g., 60%), and then Domoticz jumps down to that value. It also seems that the values are in intervals of 6 or 7% (e.g., 7% is the lowest I can get, and 100% goes down to 93%).

          Any clues?

          1 Reply Last reply
          0
          • fifipil909F Offline
            fifipil909F Offline
            fifipil909
            wrote on last edited by
            #5

            Hi yes, same things for me.
            It's look to be domoticz behaviours. the percentage from 0 - 100 is translated to 16 different step, that give you round value of 100/16 = 6.25
            This is why your "Wanted value" goes to something closer.

            This is written on this page : http://www.domoticz.com/wiki/Domoticz_API/JSON_URL's#Set_a_dimmable_light_to_a_certain_level

            1 Reply Last reply
            0
            • fifipil909F Offline
              fifipil909F Offline
              fifipil909
              wrote on last edited by
              #6

              if you want to see more details arround the sliders
              https://github.com/domoticz/domoticz/blob/49ddc50ee3099c00af1dac7c37dedc6f58a62a2a/www/app/LightsController.js#L2980

              1 Reply Last reply
              0
              • M Offline
                M Offline
                MikeF
                wrote on last edited by
                #7

                Thanks again, @fifipil909 ! I do now recall the JSON section in the wiki stating this. I've also discovered that V_DIMMER is deprecated in MySensors 1.5 in favour of V_PERCENTAGE, but same behaviour here.

                Shame you can't get 100%! :disappointed:

                1 Reply Last reply
                0
                • ? Offline
                  ? Offline
                  A Former User
                  wrote on last edited by A Former User
                  #8

                  Hey!
                  I've got a similar problem with a dim able LED-strip:
                  I'm not sure, but I think Domoticz sends wrong values because in the "DimmableLEDActuator" example of MySensors at int requestedLevel = atoi(message.data); I receive weird values all above 100.
                  For example when I choose 7% in Domoticz I receive 790 (or sometimes 710 or 740??) at the µC.
                  Can you please tell me how to fix this?

                  Thanks!

                  1 Reply Last reply
                  0
                  • M Offline
                    M Offline
                    MikeF
                    wrote on last edited by
                    #9

                    Are you sure that you included the lines below '// Clip incoming level to valid range of 0 to 100'? Values from Domoticz should be in the range 0 to 100 (%), whereas values sent to the pins (LEDs) in fadeToLevel() are converted to the range 0 to 255.

                    1 Reply Last reply
                    0
                    • ? Offline
                      ? Offline
                      A Former User
                      wrote on last edited by A Former User
                      #10

                      Yes, I have not modified the example from MySensors:

                      //  Retrieve the power or dim level from the incoming request message
                          int requestedLevel = atoi(message.data);
                      
                          // Adjust incoming level if this is a V_LIGHT variable update [0 == off, 1 == on]
                          requestedLevel *= ( message.type == V_LIGHT ? 100 : 1 );
                      
                          // Clip incoming level to valid range of 0 to 100
                          requestedLevel = requestedLevel > 100 ? 100 : requestedLevel;
                          requestedLevel = requestedLevel < 0   ? 0   : requestedLevel;
                      
                          Serial.print( "Changing level to " );
                          Serial.print( requestedLevel );
                          Serial.print( ", from " );
                          Serial.println( currentLevel );
                      
                          fadeToLevel( requestedLevel );
                      

                      Its strange, because the µC receives the same value for 7% and for example 78% in Domoticz...
                      So its clear that it can't distinguish between them.

                      1 Reply Last reply
                      0

                      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                      With your input, this post could be even better 💗

                      Register Login
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      14

                      Online

                      12.0k

                      Users

                      11.2k

                      Topics

                      113.4k

                      Posts


                      Copyright 2025 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
                      • MySensors
                      • OpenHardware.io
                      • Categories
                      • Recent
                      • Tags
                      • Popular