Zwave + Dimmer

  • Platform information:
    • Hardware: Raspberry Pi 2
    • OS: docker
    • openHAB version: 2.5.10
  • Issue of the topic: Question how to (if possible) set dimmer value without turning on

Hi,
long time lurker (as some other community would say), i have something that is bothering me a bit lately.
I have a Z-Wave network at home (with it own problems, zombie nodes that wont disappear, but that’s not the topic here) where one of my switches broke a few days ago, so i had to replace it.
old hardware: qubino flush dimmer
new hardware: aeotec nano dimmer
Integration worked fine, no problem here.
I got a rule that switches the dimmer intensity to a lower setting based on the time of day:
val target_low_percentage = 30
val target_high_percentage = 99

rule "SetDimmerBadObenLow"
when
  Time cron "0 30 21 ? * *"
then
  var lightIsOff = false
  if (FF_Bathroom_Light.state instanceof DecimalType) {
    lightIsOff = FF_Bathroom_Light.state <= 10
  } else {
    lightIsOff = FF_Bathroom_Light.state == OFF
  }
  FF_Bathroom_Light.sendCommand(target_low_percentage)

  if (lightIsOff)
  {
    FF_Bathroom_Light.sendCommand(OFF)
    logInfo("RULES", "Setze Badezimmerlampe auf Nachtmodus, schalte wieder aus.")
  }
  else
  {
    logInfo("RULES", "Setze Badezimmerlampe auf Nachtmodus, lasse an.")
  }
end

(and another rule that is basically the same, but with a “high” level in the morning)
Basically - it remembers the old ON/OFF setting, switches to the new dimming state and then turns the light to the old setting again.
That worked fine with the old dimmer, but somehow it does not work now with the aeotec one.

That said - i agree that this is somehow REALLY REALLY ugly, but i do not have the slightest idea how to make it work in any other way.
what i want to accomplish:
When in the night one goes to the bathroom and switches on the light for aiming i do not want to get blinded by a bright light. At the same time i want to keep the switches switching the dimmer without routing the signal through the openhab instance (because: keep it simple).

Does anyone of you have any idea how to accomplish this?

And on a sidenote, or even a possible solution: how can i send configuration-commands to a z-wave thing from within a rule ? That information would help another, unrelated topic that i have, too.

Thanks a lot!

Perhaps the Aeotec one does not have that feature.

what feature are you talking about?
Setting the dimmer value ?
well - it has that feature, of course. Not much point in a dimmer if it would not have a dimmer feature…

if you are referring to the “setting the dimmer value without turning it on” - feature - neither did the qubino have, that’s the reason why i wrote the script in such a complicated way, turning it on to a certain value and immediately off again.

but you reminded me of a missing piece of information:

  • previously: it turned to 30% and immediately off - so fast that it did not even flicker
  • now: it turns to 30% and NOT OFF.

I misread. You are using the rule to remember the setting. I missed that important point.

openHAB only controls Items, not Things. You can control Items within a rul whether ot not they are linked to a Thing channel.

That’s not entirely true, because i can set configuration values via Paper-UI or Habmin.
So the idea that i somehow can perhaps set such rules from within a configuration values is not too far off.

but that’s not the point here, as that is another topic.
I asked for ideas how i could implement something to achieve my goal:
30% dimming from 2100-0600 and 90% dimming during the day.

Correct… you can use executeCommandLine to access the REST API, or use scripted automation to modify Things directly.

For changing lights based on time of day and/or lux…

For ghost nodes, shutdown OH and use PC Controller from SiLabs (more info in forum).

But you cannot control channel states directly. You can set configuration parameters permitted by the firmware.

thanks, i’ll check that.

about changing the lights:

i think i need to clarify again, sorry for that:
the problem is, that those lights get switched by a traditional switch, which triggers the input of the z-wave relay and thus turning on or off the lights. without ANY z-wave or openHAB work.

so - under the hood i want to send “next time you are turned on, use 30%” to the Z-Wave node. And not “turn on 30% and turn off imediately, just so you remember the last state”.

but i guess it is just not possible to do that…

of course, for example: image
that is exactly what i am talking about.

That is not possible with the zwave binding. SmartThings had this functionality, but it may only have been for zigbee. Do you receive updates when the device is manually turned on or off? If so, trigger a rule when that Item changes and set the light to the light level appropriate for the time of day. It won’t be seemless, but close.

Which relay? Some have a default setting for ON, which could make this a bit smoother.

thanks to the direction you pointed me to i found this - thanks.

yawn at 3AM click FLASH “I’m blind! I’m blind!” dimm to 30% “And now it’s even more dark!” :wink:

Relay is this aeotec nano dimmer - but i think i found a solution for my problem.
There is a setting “maximum brightness level” which i could use.
I have to figure out how it behaves if it switches back to 90%, but the REST-API should be something to start with.