Hey,
I am quite new to openhab so excuse my basic issues.
Here is what I try to achieve:
I own a Fibaro Dimmer 2 which controls bathroom lights. I want to use the Switch (s1 and s2) to also control other items.
I managed to get an uptade in openhab when the switch is triggerede by activating Scenes.
rule "test scene"
when
Item zwave_device_zwave_usb_node4_scene_number received update 16
then
logInfo("File", "Bad Licht geschaltet")
end
My log shows that the switch was triggered. Additionaly I would like to know if it was triggered ON or OFF. My approach is to take the dimmer state which is updated. Naturally it increases from 0 to a value between 1 and 100 when turned on and vice versa.
zwave_device_zwave_usb_node4_switch_dimmer changed from 18 to 0
So how can I define in a rule that if the value for item
if you want to determine if it decreases or increases you have to work with persistence I guess, an easy way would be something like this tough:
rule "whatever"
when
zwave_device_zwave_usb_node4_switch_dimmer changed
then
if (zwave_device_zwave_usb_node4_switch_dimmer.state == "0")
{
}
else
{
}
end
put whatever you want to achieve into the curly brackets, you could do another else if statement as well.
If you just want to âmirrorâ the state to another dimmer, this should do the trick:
rule "whatever"
when
zwave_device_zwave_usb_node4_switch_dimmer changed
then
<itemToControl>.sendCommand(zwave_device_zwave_usb_node4_switch_dimmer.state)
end
Thanks to @Nicolas, your idea helped me out. It was just slightly wrong syntax. Coding it like this worked like a charm:
rule "test scene"
when
Item zwave_device_zwave_usb_node4_scene_number received update 16 //or whatever numbers your device is creating
then
if (zwave_device_zwave_usb_node4_switch_dimmer.state==0)
{
logInfo("File", "Bad Licht AN geschaltet")
}
else
{ logInfo("File", "Bad Licht AUS geschaltet")
}
end
At least now I get the correct entries in my logfile.
The general goal I would like to achieve is the following:
I want the Dimmer to act depending on when it is pressed.
If I use the momentary switch at night it shall turn on at Dimmer=20%
If I use it in the morning it shall turn on at Dimmer=20% and slowly increase to 100%.
If used during the day it shall just turn on at 100%.
To me that seems super complex but I am persistent and positive to eventually achieve this.
Help is of course appreciated.
Hi @sihui - youâre right I mixed that up.
However
rule "test Scene"
when
Item zwave_device_zwave_usb_node4_switch_dimmer changed to ON
then
logInfo("File", "Bad Licht AN geschaltet")
end
does not work. There is no output. Also the log file only states:
2018-01-21 19:37:53.142 [vent.ItemStateChangedEvent] - zwave_serial_zstick_zwave_usb_serial_sof changed from 6213 to 6214
2018-01-21 19:37:53.206 [vent.ItemStateChangedEvent] - zwave_serial_zstick_zwave_usb_serial_sof changed from 6214 to 6215
2018-01-21 19:37:53.224 [vent.ItemStateChangedEvent] - zwave_device_zwave_usb_node4_switch_dimmer changed from 40 to 0
2018-01-21 19:37:53.243 [vent.ItemStateChangedEvent] - zwave_serial_zstick_zwave_usb_serial_sof changed from 6215 to 6216
2018-01-21 19:37:53.533 [vent.ItemStateChangedEvent] - zwave_serial_zstick_zwave_usb_serial_sof changed from 6216 to 6217
2018-01-21 19:37:54.078 [vent.ItemStateChangedEvent] - zwave_serial_zstick_zwave_usb_serial_sof changed from 6217 to 6218
2018-01-21 19:37:54.092 [vent.ItemStateChangedEvent] - zwave_device_zwave_usb_node4_sensor_power changed from 176.1 to 84.6
2018-01-21 19:37:54.751 [vent.ItemStateChangedEvent] - zwave_serial_zstick_zwave_usb_serial_sof changed from 6218 to 6219
2018-01-21 19:37:54.814 [vent.ItemStateChangedEvent] - zwave_serial_zstick_zwave_usb_serial_sof changed from 6219 to 6220
So the only comparable change I find is *dimmer change to 0 instead of change to OFF
Hey, I have several FGD212 dimmers with firmware 3.5 but the âScene numberâ channel is not showing up in the paper UI. Iâve tried adding it manually (using the scene_number property) but that does not seem to work. Configuration 28 (Scene activation functionality) is enabled. Any ideas?
Make sure your FGD212 is properly included (shows up in things on PaperUI and Habmin).
in HABmin and not in PaperUI (Error500) activate scenes in Configuration (28). Make sure to do this in Habmin.
In Associations link 1 to openhab. Delete all other Associations.
in your itemsfile you should add the Following item:
Number myzwavedevice_scene "Scene Number" (group) {channel="yourzwavedevice:scene_number"}
//myzwavedevice_scene will be the name of your item. The name of your channel will be found in your PaperUI in your FGD212 Thing
For Fibaro dimmers, relays etc you have to open Things and Items in HABmin in order to access all channels and to set properly. PaperUI display limited options only; itâs not usefull if you have Fibaro products.