Dsiplaying dimmer percentage in Domoticz



  • 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?



  • 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.



  • Thanks for the pointer @fifipil909 - I've now got it working successfully ๐Ÿ˜„



  • 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?



  • 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





  • 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%! ๐Ÿ˜ž



  • 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!



  • 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.



  • 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.


Log in to reply
 

Suggested Topics

  • 5
  • 2
  • 5
  • 4
  • 1
  • 5

56
Online

11.4k
Users

11.1k
Topics

112.7k
Posts