Zwave.me WallC-S Dimmer configuration

Moderator: leecollings

Post Reply
xinhood
Posts: 4
Joined: Tuesday 26 January 2016 20:19
Target OS: NAS (Synology & others)
Domoticz version:
Location: The Netherlands
Contact:

Zwave.me WallC-S Dimmer configuration

Post by xinhood »

Hi All,

I'm new to this forum and also new to ZWave and to Domoticz. I've just started of on my first domotica adventure and bought a philips hue starter kit, a Zwave-plus usb dongle and two wave.me wallc-s switches.

How far I got:
I've managed to install domoticz in a freenas jail. After A slight modification of the serial port finding code, (I'll mail a patch to a dev) I also got the Wave Plus USB stick functioning. After adding the wave.me switch, I attached node 1 to all groups, and configured the switch to send a scene activation command for all groups. I've set Button 1 an 3 in pair mode without double clicks.

Chalenges:
I would expect that this would function as an on/off switch, with press&hold, dimmer functionality. However I cannot get It working like this. It seems like all buttons work seperately, and only send an "On" command whatever I do. So when I add the switch as an actuator for a group, It will only switch on the group, If I also add button 3 to the group, that will also turn on the group, I can only switch off the group using the web interface.

Domoticz version: 2.4272

I got the on/off functionality for a specific light working by making to scenes one with lights on and one with lights off and adding button 1 and 3 as actuators for the respective scene. I can also get this behavior using blocky, but the solutions are off course ugly. Also, I cannot get the dimmer functionality that way.

Does anyone have any tips on how to get the dimmer functionality working with this switch?
dreuf
Posts: 6
Joined: Sunday 16 March 2014 22:17
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Zwave.me WallC-S Dimmer configuration

Post by dreuf »

In group one I have only the raspi (node 1), group 2 I have the device I want to control (f.eks node 2).
Then you put parameter 11 on "switch on/off and dim" . Then it will work as you want.
If you want to control more than one device with the same buttons just add them in group 2 for button 1/3 and group 4 for button 2/4


Sent from my iPad using Tapatalk
xinhood
Posts: 4
Joined: Tuesday 26 January 2016 20:19
Target OS: NAS (Synology & others)
Domoticz version:
Location: The Netherlands
Contact:

Re: Zwave.me WallC-S Dimmer configuration

Post by xinhood »

Thanks, I understand that this would work If I wanted to control a real Z-Wave dimmer. However, I have a Philips HUE device that doesn't do Z-Wave. So I need the dimmer to be in my domoticz installation to be able to control the lights.

I did some more testing;. After removing and adding the switch again, and pressing all four buttons once, 5 devices were added 1 Level device (battery?) and four switches. After doing a dimm command (press&hold) on a button, two extra devices were added per button. According to the manual. the switch actually sends ON, DIM-UP-START, DIM-UP-STOP, OFF, DIMM-DOWN-START, DIM-DOWN-STOP. Since I now got 1 level device an 12 buttons, I suspect that all commands are sent to de domoticz system, but they are not really interpreted.

Does the WALLC-S work differently then other switched/dimmers out there?
xinhood
Posts: 4
Joined: Tuesday 26 January 2016 20:19
Target OS: NAS (Synology & others)
Domoticz version:
Location: The Netherlands
Contact:

Re: Zwave.me WallC-S Dimmer configuration

Post by xinhood »

Because there is quite a bit of latency in receiving events, and controlling the Hue Lights, I don't think a press and hold dimmer can be implemented very well using this switch and a Hue set. Therefore I wrote some Lua to use the WallC-S as a stepwise dimmer.

Code: Select all

--Domoticz Lua script to operate a Hue virtual dimmer using one up/down switch of a WallC-S
--Set all groups to scene activation and set the button mode to in-pair without double clicks
--Learn and name the buttons using both a single click an a click and hold event.

--single press up/down are used to dimm up or down. 
--When the light is off, there is a different default level for the On and the Off button. I Use this in the bedroom, where I can switch the light on dimmed at the lowest level when my spouse is still sleeping, or at a normal level during the day.
--long press On means set level to 100%
--long press Off means turn of the lights

--Use these to define which domoticsz switches you have learned for your device
local switch_up = 'Schakelaar-1-1'
local switch_down = 'Schakelaar-1-3'
local switch_on = 'Schakelaar-1-1b'
local switch_off = 'Schakelaar-1-3b'

--This is the dimmer you want to controll
local dimmer = 'Slaapkamerlicht'

--This is the stepsize for dimming up/down. Since there is some latency (at least in my system) this should not be to low (I use 3)
local stepSize = 3

--Default levels for switching On or Off
local defaultUpLevel=60
local defaultDownLevel=7

--That's all, no need to set anything else.

commandArray = {}
local level = 0
local setLevel = 0

if ( devicechanged[switch_up] ) then
    if (otherdevices[dimmer] ~= 'Off' ) then
        level = tonumber(otherdevices_svalues[dimmer])
        level = level+stepSize
        if ( level > 15 ) then 
            level = 15
        end
        setLevel = (math.ceil(level*6.666666))
        commandArray[dimmer] = "Set Level "..setLevel
    else
        commandArray[dimmer] = "Set Level "..defaultUpLevel
    end
end

if (devicechanged[switch_down]) then
    if (otherdevices[dimmer] ~= 'Off' ) then
        level = tonumber(otherdevices_svalues[dimmer])
        --The device can be in a strange state where it is 'On' but reads no dimmer level. This is actually 100%.
        if (otherdevices[dimmer] == "On" and level == 0 ) then level = 15 end
        level = level-stepSize
        if ( level < 1 ) then 
           level = 1
        end
        setLevel = (math.ceil(level*6.666666))
        commandArray[dimmer] = "Set Level "..setLevel
    else
        commandArray[dimmer] = "Set Level "..defaultDownLevel
    end
end

if ((devicechanged[switch_on]) ) then

    commandArray[dimmer] = "Set Level 100"
end

if ((devicechanged[switch_off]) ) then

    commandArray[dimmer] = "Off"
end

return commandArray

I do get an error in the logs regularly:
"Error: EventSystem: [string "--Domoticz Lua script to operate a Hue virtua..."]:24: attempt to index global 'devicechanged' (a nil value)"

But in general this seems to work pretty well.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest