Hello,
I have an issue that I can’t figure out. Probably its something simple.
I wan’t to dim up en down some tradfi bulbs using a zwave.me wall controller.
For the dimming part I use this rule ( Its only the part for dimming, as the rule is a bit bigger with all the button functions. The Wallcontroller sends 1.2 when long pressed, en 1.1 when released.
rule "Schakelaar begane grond"
when
Item ZWaveNode4ZME_KFOBSSecure4ButtonKeyChainController_SceneNumber received update
then
var boolean Switch12 = false
var boolean Switch52 = false
var int brightness = 0
var int brightnessTarget = 0
if (ZWaveNode4ZME_KFOBSSecure4ButtonKeyChainController_SceneNumber.state == 1.2) {
Switch12 = true
brightness = (Brightness_Hal_BG_1.state as DecimalType).intValue
brightnessTarget = brightness + 5
if (brightnessTarget > 99)
brightnessTarget = 100
sendCommand(Brightness_Hal_BG_1 , brightnessTarget)
Thread::sleep(400)
}
if (ZWaveNode4ZME_KFOBSSecure4ButtonKeyChainController_SceneNumber.state == 1.1) {
Switch12 = false }
end
The light goes on, but the rule doesn’t sleep proper as can been seen in the log below.
2018-05-30 21:35:20.359 [vent.ItemStateChangedEvent] - ZWaveNode4ZME_KFOBSSecure4ButtonKeyChainController_SceneNumber changed from 1.1 to 1.2
2018-05-30 21:35:21.282 [ome.event.ItemCommandEvent] - Item 'Brightness_Hal_BG_1' received command 17
2018-05-30 21:35:21.299 [ome.event.ItemCommandEvent] - Item 'Brightness_Hal_BG_1' received command 17
2018-05-30 21:35:21.302 [ome.event.ItemCommandEvent] - Item 'Brightness_Hal_BG_1' received command 17
2018-05-30 21:35:21.307 [ome.event.ItemCommandEvent] - Item 'Brightness_Hal_BG_1' received command 17
2018-05-30 21:35:21.321 [ome.event.ItemCommandEvent] - Item 'Brightness_Hal_BG_1' received command 17
2018-05-30 21:35:21.326 [vent.ItemStateChangedEvent] - Brightness_Hal_BG_1 changed from 12 to 17
2018-05-30 21:35:21.743 [ome.event.ItemCommandEvent] - Item 'Brightness_Hal_BG_1' received command 22
2018-05-30 21:35:21.763 [vent.ItemStateChangedEvent] - Brightness_Hal_BG_1 changed from 17 to 22
2018-05-30 21:35:21.785 [ome.event.ItemCommandEvent] - Item 'Brightness_Hal_BG_1' received command 27
2018-05-30 21:35:21.792 [vent.ItemStateChangedEvent] - Brightness_Hal_BG_1 changed from 22 to 27
2018-05-30 21:35:21.809 [ome.event.ItemCommandEvent] - Item 'Brightness_Hal_BG_1' received command 32
2018-05-30 21:35:21.823 [ome.event.ItemCommandEvent] - Item 'Brightness_Hal_BG_1' received command 22
2018-05-30 21:35:21.830 [ome.event.ItemCommandEvent] - Item 'Brightness_Hal_BG_1' received command 32
2018-05-30 21:35:21.834 [vent.ItemStateChangedEvent] - Brightness_Hal_BG_1 changed from 27 to 32
2018-05-30 21:35:21.848 [vent.ItemStateChangedEvent] - Brightness_Hal_BG_1 changed from 32 to 22
2018-05-30 21:35:21.853 [vent.ItemStateChangedEvent] - Brightness_Hal_BG_1 changed from 22 to 32
2018-05-30 21:35:21.896 [vent.ItemStateChangedEvent] - Brightness_Hal_BG_1 changed from 32 to 17
2018-05-30 21:35:22.171 [ome.event.ItemCommandEvent] - Item 'Brightness_Hal_BG_1' received command 22
2018-05-30 21:35:22.178 [vent.ItemStateChangedEvent] - Brightness_Hal_BG_1 changed from 17 to 22
2018-05-30 21:35:22.228 [ome.event.ItemCommandEvent] - Item 'Brightness_Hal_BG_1' received command 27
2018-05-30 21:35:22.232 [ome.event.ItemCommandEvent] - Item 'Brightness_Hal_BG_1' received command 27
2018-05-30 21:35:22.261 [ome.event.ItemCommandEvent] - Item 'Brightness_Hal_BG_1' received command 27
2018-05-30 21:35:22.265 [vent.ItemStateChangedEvent] - Brightness_Hal_BG_1 changed from 22 to 27
2018-05-30 21:35:22.274 [ome.event.ItemCommandEvent] - Item 'Brightness_Hal_BG_1' received command 27
2018-05-30 21:35:22.308 [vent.ItemStateChangedEvent] - ZWaveNode4ZME_KFOBSSecure4ButtonKeyChainController_SceneNumber changed from 1.2 to 1.1
2018-05-30 21:35:22.512 [vent.ItemStateChangedEvent] - Brightness_Hal_BG_1 changed from 27 to 17
2018-05-30 21:35:24.308 [vent.ItemStateChangedEvent] - Brightness_Hal_BG_1 changed from 17 to 23
2018-05-30 21:35:24.916 [vent.ItemStateChangedEvent] - Brightness_Hal_BG_1 changed from 23 to 28
2018-05-30 21:35:25.508 [vent.ItemStateChangedEvent] - Brightness_Hal_BG_1 changed from 28 to 32
2018-05-30 21:35:25.853 [vent.ItemStateChangedEvent] - Brightness_Hal_BG_1 changed from 32 to 28
2018-05-30 21:35:26.120 [vent.ItemStateChangedEvent] - Brightness_Hal_BG_1 changed from 28 to 23
2018-05-30 21:35:26.721 [vent.ItemStateChangedEvent] - Brightness_Hal_BG_1 changed from 23 to 32
2018-05-30 21:35:26.861 [vent.ItemStateChangedEvent] - Brightness_Hal_BG_1 changed from 32 to 23
2018-05-30 21:35:27.923 [vent.ItemStateChangedEvent] - Brightness_Hal_BG_1 changed from 23 to 28
I hope someone can help. I have read a lot of examples. ( this is a build of examples ) But can;t find what I’m doing wrong.
Expected the rule would run once when 1.2 triggers, and wait 400ms and run again.
The Boolean is to stop the loop.
Best Regards,
Olaf