Zwave Force initial brightness won't accept 100 as command

Hi,

I’ve been noticing something interesting when trying to set the value of the config_decimal_param19 channel.
When I would like to set it to 100, it jumps back to the previous value.

For example, I have the Item BathroomCeilingLight_ForceInitialBrightness as Number item, linked to zwave:device:f43721d6b3:node4:config_decimal_param19 (Number) without any profiles. Now let’s try to set some values:

→ 35, works fine

openhab> openhab:send BathroomCeilingLight_ForceInitialBrightness 35
Command has been sent successfully.

[INFO ] [openhab.event.ItemCommandEvent      ] - Item 'BathroomCeilingLight_ForceInitialBrightness' received command 35
[INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'BathroomCeilingLight_ForceInitialBrightness' predicted to become 35
[INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'BathroomCeilingLight_ForceInitialBrightness' changed from 0 to 35

→ 100, jumps back to 35

openhab> openhab:send BathroomCeilingLight_ForceInitialBrightness 100
Command has been sent successfully.

[INFO ] [openhab.event.ItemCommandEvent      ] - Item 'BathroomCeilingLight_ForceInitialBrightness' received command 100
[INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'BathroomCeilingLight_ForceInitialBrightness' predicted to become 100
[INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'BathroomCeilingLight_ForceInitialBrightness' changed from 35 to 100
[INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'BathroomCeilingLight_ForceInitialBrightness' changed from 100 to 35

→ 0, works fine

openhab> openhab:send BathroomCeilingLight_ForceInitialBrightness 0
Command has been sent successfully.

[INFO ] [openhab.event.ItemCommandEvent      ] - Item 'BathroomCeilingLight_ForceInitialBrightness' received command 0
[INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'BathroomCeilingLight_ForceInitialBrightness' predicted to become 0
[INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'BathroomCeilingLight_ForceInitialBrightness' changed from 35 to 0

Anything above 100 has the same behavior as 100 itself, and jumps to the last known value.

So far I confirmed this using the console, as well as some rules (which copy the value of a separate dimmer item into this item upon sunset).

Does anyone know what is going on here?

What is the device (ie. Device DB numbers or model #)

In some cases the binding has a 99 max for dimmable lights. See if that holds

The device is a Fibaro FGD212 (dbReference 787)

I’ve verified that the normal dimmer channel, controlling the light does not present this behavior. I can also set the parameter in the thing config to 100 without any issues.

openhab> openhab:send BathroomCeilingLight_Dimmer 10
Command has been sent successfully.

[INFO ] [openhab.event.ItemCommandEvent      ] - Item 'BathroomCeilingLight_Dimmer' received command 10
[INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'BathroomCeilingLight_Dimmer' predicted to become 10
[INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'BathroomCeilingLight_Dimmer' changed from 0 to 10
openhab> openhab:send BathroomCeilingLight_Dimmer 100
Command has been sent successfully.

[INFO ] [openhab.event.ItemCommandEvent      ] - Item 'BathroomCeilingLight_Dimmer' received command 100
[INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'BathroomCeilingLight_Dimmer' predicted to become 100
[INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'BathroomCeilingLight_Dimmer' changed from 10 to 100

Reading the manual on page 25 for that it seems that parameter 19 accepts values from 0 (function disabled) to 99 as a brightness percentage so 99 should work just the same as “100”

FGD-212-US-T-v1.1.pdf (fibaro.com)

1 Like

Hhmm, Seems you’re right.

I was tricked by the fact the binding’s GUI does accept 100 as a valid value for parameter19.

On to the follow-up question; Is there a way to limit the various dimmers that are used to control the parameter, to 99 as maximum? :slight_smile:

What comes to mind is a rule that fires on change that checks for 100 or ON and sets it to 99 instead. I don’t know if there’s a more elegant way though metadata or anything like that but someone else may know better

Not a zwave binding expert, but I remember seeing this javadoc in the multiswitch class regarding zwave dimmers. As it read it, if you set as 99 it translates to 100 internally. That is why I asked if you tried 99.

Thanks for the replies!

As my rule is written in JRuby, I was able to add a clamp(1, 99) to my set command. Making sure the state of parameter19 never ends up at 100, or 0 for that matter.

Complete rule I used, for completeness
require 'openhab'

rule 'Initial Brightness' do
  description 'Sets initial brightness levels depending on the Time of Day'

  changed vTimeOfDay

  run do |event|
    dimmers = items
      .equipments(Semantics::Lightbulb)
      .members
      .select { |item| item.name.end_with? '_ForceInitialBrightness' }

    logger.info("Found #{dimmers.count} dimmers with Initial Brighness settings")

    dimmers.each do |dimmer|
      setting = dimmer.name.sub("_ForceInitialBrightness", "_Brightness_#{event.state}")

      if items.include? setting
        logger.info("Updating #{dimmer.name} to #{event.state} time value")

        dimmer.command(items[setting].state.clamp(1, 99))
      end
    end
  end
end
1 Like

For info, this is done to resolve the difference between openhab, which provides a range of 0 to 100 for a dimmer, and ZWave which only supports 0 to 99. Prior to me implementing this, we had a lot of confused users who couldnt understand why their dimmers were only going up to 99% - the answer is because that’s how ZWave is implemented.

2 Likes