Help needed with basic Z-Wave dimmer setup

TLDR: My Z-Wave dimmer is ‘stepping’ when controlled via openHAB and using the dimmer will block the on/off function from working.(config files below)

I’ve recently been evaluating options to migrate my 15 year old X-10 / Comfort home control system and have settled on openHAB for it’s flexibility and configurability.

I’ve started with a very simple Z-Wave setup to learn the ropes and have run in to a problem which I’m hoping someone might be in a position to help with…

Here’s my setup;

  • OpenHAB 1.8.3 / z-wave binding 1.8 / habMin 1.5 (running in Windows 8 VM on unRAID)
  • Aeon Z-Stick
  • TKB Dual Paddle Wall Dimmer (this one)
  • FOXX Smart Plug (this one)

I have the dimmer switch wired in and connected to the main ceiling light in the room. The smart plug has a lamp plugged in. I have successfully included the wall switch and smart plug to the z-wave network and have associated the smart plug to group 2 on the wall switch so that paddle one controls and dims the main light and paddle 2 will switch the smart plug (lamp) on and off. I also have the binding configured in openHab and, having configured my items and sitemap, can control the on/off operation of both lights from the openHab UI. So far so good.

My problem arises when I attempt to add a dimmer/slider to my setup…

Adding a slider to the sitemap to control the dimmer would result in the following behaviour;

  • UI displayed up and down arrows instead of a slider (chrome on OSX)
  • On/Off function would work OK
  • In off state, slider/buttons would have no effect
  • In On state, short click on slider/buttons would have no effect
  • In On state, long click on slider down button would dim the light smoothly to zero (regardless of length of press)
  • In On state, long click on the slider up button would brighten the light to 5%

Researching this, it became apparent that I needed a rule to manage the dimming (surprised!). My items, sitemap and rules are below. This is where I’m stuck. Here’s what happens;

  • The On/Off function will work initially
  • Once on, if I interact with the slider/buttons, the On/Off function will no longer work (I’ve got to switch the light off at the physical paddle)
  • Dimming up and down works and reports the correct %, however…
  • Between each 5% dim, the light goes off resulting in a very disconcerting flashing effect rather than the expected smooth dim.

My main questions are;

  • Should I be setting up this device to have both on/off switch and dimmer slider. Is tis the correct approach?
  • How can I get the dimming function to be smoother without flashing?
  • What’s causing the dimming function to cause the on/off switch to stop working?
  • Why is the slider control showing up as buttons?
  • Can I add more than one rule to a .rules file or do I need a separate file for each one?

Hare are my config files;

ITEMS

Group	gGF	(All)	
Group	GF_Living	"Living room"	<video>	(gGF)

Switch	Light_GF_Living_Lamps	"Lamps [%b]"	<light>	(gf_Living)	{ zwave="3" }
Switch	Light_GF_Living_Main	"Main Light [%b]"	<light>	(gf_Living)	{ zwave="2" }
Dimmer	Light_GF_Living_Main_Dimmer	"Main Light [%.1f %%]"	<light>	{ zwave="2" }

SITEMAP

sitemap ourhouse label="Main Menu"
{
	Frame item=GF_Living label="Living Room"  {
		Switch item=Light_GF_Living_Lamps label="Lamps [%b]"
		Switch item=Light_GF_Living_Main
            Slider item=Light_GF_Living_Main_Dimmer
	}
}

RULES

rule "DimmedLight"
    when
        Item Light_GF_Living_Main_Dimmer received command INCREASE or
        Item Light_GF_Living_Main_Dimmer received command DECREASE
    then
        logInfo("DimmedLight.rules","triggered")
        var Number percent = 0

        if (Light_GF_Living_Main_Dimmer.state != Uninitialized)
        {
        percent = Light_GF_Living_Main_Dimmer.state
        }

        if(receivedCommand==INCREASE) percent = percent + 5
        if(receivedCommand==DECREASE) percent = percent - 5

        if(percent<0)   percent = 0
        if(percent>100) percent = 100

        sendCommand(Light_GF_Living_Main_Dimmer, percent);
end

openHAB 1.8 or openHAB 2?

Does it work better if you specify the command class?

zwave="2:command=switch_multilevel"

Have you tried experimenting with the sendFrequency and switchSupport elements for the Dimmer tag on your sitemap?

I don’t have much experience with Dimmers so I probably won’t be a whole lot of help with with a lot of these questions. But I do know that some people have been successful using the built in dimmer capability of the switch to get a smooth transition between states. I also know that other devices, GE in particular, do not support that.

I see nothing wrong with your rule as written. But there could be some weirdness if your sendFrequency is too high. I certainly see nothing to explain the behavior you are seeing.

If switchControl is set on the Slider element a short press on the up or down arrows will send the ON or OFF command to the switch respectively.

There has been a lot of talk about weird behaviors with sliders. You might check the forum and/or github for info about Sliders to see what those problems were, have they been fixed, etc.

You can add as many rules as you want. I recommend having one rule for each type of functionality (e.g. lights.rules, presense.rules, hvac.rules, etc.). Global vars and vals only have scope within that one file so keeping the rules organized like this makes it more likely that rules that need to use the same global var/val are in the same file. It also ensures that rules that are likely to be part of the same processing flows are colocated.

Hi Rich

Thanks for taking the time to read and reply.

I’ll try those suggestions this evening. I had the command class specified early in my trials but took it out to see if it made a different. (It didn’t).I also came across ‘switchControl’ in further research today so I’ll implement that and remove the toggle switch.

I’m on openHAB 1.8.x as noted early in my post.

Big learning curve here…

Peter