Just upgraded yesterday to OH3.1 from OH2.5, most things work again, had to fix some now.getMinuteOfDay() in my rules and the Frontal logging was posting at the old log files, but besides that, everything migrated flawless
Another issue I just ran into, is the universal dimmer rule, I used it before to dim several light up or down by rule or on the habpanel, so you won’t have a lose or big increase in light all of a sudden.
Now I updated the new universal dimmer script in the rule and installed Regex.
I updated my rule to trigger a change in value of a lamp into this:
rule "Ganglamp fading"
when
Item dummyGanglampDimmer received command
then
var Number varLight_DimmerGanglamp = Light_DimmerGanglamp.state as Number
universaldimmer.sendCommand("Light_DimmerGanglamp,"+varLight_DimmerGanglamp.toString+","+receivedCommand.toString+",20000,1")
end
rule "Ganglamp fading slow"
when
Item dummyGanglampDimmerSlow received command
then
var Number varLight_DimmerGanglamp = Light_DimmerGanglamp.state as Number
universaldimmer.sendCommand("Light_DimmerGanglamp,"+varLight_DimmerGanglamp.toString+","+receivedCommand.toString+",5000,2")
end
So when the motion gets detected in another rule, the light goes up from (for example) 0 to 50, after 2 minutes when there is no motion anymore, the light should be dimmed down to 0, but that won’t happen, this is the output of the logging:
2021-07-11 12:59:49.070 [INFO ] [openhab.event.ItemCommandEvent ] - Item 'dummyGanglampDimmerSlow' received command 0
2021-07-11 12:59:49.081 [INFO ] [openhab.event.ItemCommandEvent ] - Item 'universaldimmer' received command Light_DimmerGanglamp,50,0,5000,2
2021-07-11 12:59:49.090 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'universaldimmer' changed from Light_DimmerGanglamp,50,50,20000,1 to Light_DimmerGanglamp,50,0,5000,2
==> /var/log/openhab/openhab.log <==
2021-07-11 12:59:49.104 [INFO ] [ab.core.model.script.UniversalDimmer] - Transition Light_DimmerGanglamp PercentType from 50 => 50 over 0 ms
==> /var/log/openhab/events.log <==
2021-07-11 12:59:49.317 [INFO ] [openhab.event.ItemCommandEvent ] - Item 'Light_DimmerGanglamp' received command 50
==> /var/log/openhab/openhab.log <==
2021-07-11 12:59:49.317 [INFO ] [ab.core.model.script.UniversalDimmer] - Finished transitioning Light_DimmerGanglamp from 50 => 50
==> /var/log/openhab/events.log <==
2021-07-11 12:59:49.326 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'Light_DimmerGanglamp' predicted to become 50
For some reason, the item gets his original state again as command. This is the rule that commands the light to slowly dimm down.
var Timer occupancyTimer = null
val timeoutMinutes = 2
rule "Motion gang received ON"
when
Item Philips_motion2_Occupancy_Gang received update ON
then
if(occupancyTimer === null || occupancyTimer.hasTerminated()) {
occupancyTimer = createTimer(now.plusMinutes(2), [|
dummyGanglampDimmerSlow.sendCommand(0)
occupancyTimer = null
])
}
else {
occupancyTimer.reschedule(now.plusMinutes(timeoutMinutes ))
}
end
really confused what I’m doing wrong, who has any idea?