This will fade in the Dimmer dim_DR_TE_Terrasse_Links within 6 seconds using steps of 12%.
Item:
String universaldimmer "Trigges a rule to fade in/out a light"
The rule
import org.eclipse.smarthome.model.script.ScriptServiceUtil
var Timer fade_Timer = null
// will dimm the item and report back the new brightness
var dimm = [ GenericItem myitem, String mytype, String mydirection, Number mystep |
var int mybrightness = 0
//get brightness
if (mytype == "Color") {
mybrightness = (myitem.state as HSBType).getBrightness().intValue
} else if (mytype == "Dimmer") {
mybrightness= (myitem.state as DecimalType).intValue
}
//calculate new brightness
if ( mydirection == "IN") {
mybrightness = mybrightness + mystep.intValue
// do not dimm over 100
if ( mybrightness > 100 ) {
mybrightness = 100
}
} else {
mybrightness = mybrightness - mystep.intValue
// do not dimm under 0
if ( mybrightness < 0 ) mybrightness = 0
}
logInfo("Universaldimmer", "I will dimm "+ mydirection + " " + myitem.label + " (" + mytype + ") to " + mybrightness)
// set new brightness
myitem.sendCommand(mybrightness)
// return new brightness
mybrightness
]
rule "Universaldimmer"
when
Item universaldimmer received command //expect e.g. Color,IN,120000,12,col_E1_ES_Hue_Go_Farbe
then
val buffer = receivedCommand.toString.split(",")
val mytype = receivedCommand.toString.split(',').get(0) // Color or Dimmer
val mydirection = receivedCommand.toString.split(',').get(1) // IN or OUT
val int myfadetime = Integer::parseInt(buffer.get(2)) // time for fading
val int mystep = Integer::parseInt(buffer.get(3)) // step for fading
val int mytime = Math::round(myfadetime * mystep / 100) // calculate timer
val myitem_name = receivedCommand.toString.split(',').get(4) // Item to handle
val myitem = ScriptServiceUtil.getItemRegistry.getItem(myitem_name)
//If a timer is still on kill it
fade_Timer?.cancel
// fade and return new brightness
var int mybrightness = dimm.apply(myitem, mytype, mydirection, mystep)
fade_Timer = createTimer(now.plusMillis(mytime)) [|
//Check if finishes
if (((mybrightness < 100 ) && (mydirection == "IN")) || ((mybrightness > 0) && (mydirection == "OUT"))) {
// if not finished dim again
mybrightness = dimm.apply(myitem, mytype, mydirection, mystep)
// rescheduling
fade_Timer.reschedule(now.plusMillis(mytime))
}
]
end
I donât want to edit the above as someone might need it as it is. I now have a new version, where you can decide the target-value instead just âINâ or âOUTâ. You can still use 0 instead of âOUTâ and 100 instead of âINâ.
This will fade in the Dimmer dim_DR_TE_Terrasse_Links to 80% using steps of 12% in about 6 seconds.
Item:
String universaldimmer "Trigges a rule to fade in/out a light"
Rule:
import org.eclipse.smarthome.model.script.ScriptServiceUtil
var Timer fade_Timer = null
// will dimm the item and report back the new brightness
var dimm = [ GenericItem myitem, String mytype, Number mytarget, Number mystep |
var int mybrightness = 0
//get brightness
if (mytype == "Color") {
mybrightness = (myitem.state as HSBType).getBrightness().intValue
} else if (mytype == "Dimmer") {
mybrightness= (myitem.state as DecimalType).intValue
}
//calculate new brightness
if ( mytarget.intValue > mybrightness ) {
mybrightness = mybrightness + mystep.intValue
// do not dimm over mytarget
if ( mybrightness > mytarget.intValue ) mybrightness = mytarget.intValue
} else {
mybrightness = mybrightness - mystep.intValue
// do not dimm under mytarget
if ( mybrightness < mytarget.intValue ) mybrightness = mytarget.intValue
}
logInfo("Universaldimmer", "I will dimm " + myitem.label + " (" + mytype + ") to " + mybrightness)
// set new brightness
myitem.sendCommand(mybrightness)
// return new brightness
mybrightness
]
rule "Universaldimmer"
when
Item universaldimmer received command //expect e.g. Color,100,120000,12,col_E1_ES_Hue_Go_Farbe
then
val buffer = receivedCommand.toString.split(",")
val mytype = receivedCommand.toString.split(',').get(0) // Color or Dimmer
var int mytarget = Integer::parseInt(buffer.get(1)) // where to go to
val int myfadetime = Integer::parseInt(buffer.get(2)) // time for fading
val int mystep = Integer::parseInt(buffer.get(3)) // step for fading
val myitem_name = receivedCommand.toString.split(',').get(4) // Item to handle
val myitem = ScriptServiceUtil.getItemRegistry.getItem(myitem_name)
var int mytime = 0
// avoid that the target cannot be reaced
if ( mytarget > 100 ) mytarget = 100
else if ( mytarget < 0 ) mytarget = 0
//If a timer is still on kill it
fade_Timer?.cancel
// fade
var int mybrightness = dimm.apply(myitem, mytype, mytarget, mystep)
// calculate timesteps
if ( mybrightness > mytarget ) {
mytime = Math::round(myfadetime * mystep / ((mybrightness + mystep ) - mytarget))
} else {
mytime = Math::round(myfadetime * mystep / (mytarget - (mybrightness + mystep)))
}
// create the timer
fade_Timer = createTimer(now.plusMillis(mytime)) [|
//Check if finishes
if (mybrightness != mytarget ) {
// if not finished dim again
mybrightness = dimm.apply(myitem, mytype, mytarget, mystep)
// rescheduling
fade_Timer.reschedule(now.plusMillis(mytime))
}
]
end
This is incredibly helpful for a new user - just getting started with all of this.
I do have a question about usage, though: it doesnât appear that calls to this rule can overlap - that is, if I have one bulb fading in over a long period of time (20 minutes), and I try to use this function to fade in a different bulb, starting 10 minutes into that process, the function stops fading the first bulb and just fades in the second.
Is there a straightforward way to cause the rule to run as a âsecond instantiationâ and not cut off the first, or would I need to duplicate the universal dimmer rule for each bulb I want to simultaneously dim?
If you look into the rule âUniversaldimmerâ you will see that the author decided to kill any still running timer. That is the reason for this behaviour.
I just modified the rule to allow simultaneously dim for different items:
import org.eclipse.smarthome.model.script.ScriptServiceUtil
val java.util.Map<String, Timer> timerPool = newHashMap
// will dimm the item and report back the new brightness
var dimm = [GenericItem item, String type, Number targetValue, Number stepSize |
var int itemBrightness = 0
// get brightness
if (type == "Color") {
itemBrightness = (item.state as HSBType).getBrightness().intValue
} else if (type == "Dimmer") {
itemBrightness = (item.state as DecimalType).intValue
}
// calculate new brightness
if (targetValue.intValue > itemBrightness) {
itemBrightness = itemBrightness + stepSize.intValue
// do not dimm above targetValue
if (itemBrightness > targetValue.intValue) {
itemBrightness = targetValue.intValue
}
} else {
itemBrightness = itemBrightness - stepSize.intValue
// do not dimm below targetValue
if (itemBrightness < targetValue.intValue) {
itemBrightness = targetValue.intValue
}
}
logInfo("home.universaldimmer", "Dimm " + item.name + " (" + type + ") to " + itemBrightness)
// set new brightness
item.sendCommand(itemBrightness)
// return new brightness
itemBrightness
]
rule "Universaldimmer"
when
// syntax: <type>,<target value>,<fade time>,<step size>,<item name>
//
// type: Color or Dimmer
// target value: e.g. 100 for ON or 0 for OFF
// fade time: amount of time (in milli seconds) to reach the target value
// step size: amount of steps to reach the target value
// item name: item to fade
//
// sample: Color,100,10000,12,col_E1_ES_Hue_Go_Farbe
Item universaldimmer received command
then
val buffer = receivedCommand.toString.split(",")
val type = buffer.get(0) // Color or Dimmer
var int targetValue = Integer::parseInt(buffer.get(1)) // where to go to
val int fadeTime = Integer::parseInt(buffer.get(2)) // time for fading
val int stepSize = Integer::parseInt(buffer.get(3)) // step for fading
val itemName = buffer.get(4) // Item to handle
val item = ScriptServiceUtil.getItemRegistry.getItem(itemName)
var int rescheduleTime = 0
logInfo("home.universaldimmer", "Item to dimm: " + itemName)
// avoid that the target cannot be reaced
if (targetValue > 100) {
targetValue = 100
} else if (targetValue < 0) {
targetValue = 0
}
// If a timer is still on kill it
timerPool.get(itemName)?.cancel
// fade
var int brightness = dimm.apply(item, type, targetValue, stepSize)
if (brightness > targetValue) {
rescheduleTime = Math::round(fadeTime * stepSize / ((brightness + stepSize ) - targetValue))
} else {
rescheduleTime = Math::round(fadeTime * stepSize / (targetValue - (brightness + stepSize)))
}
// create the timer
timerPool.put(itemName, createTimer(now.plusMillis(rescheduleTime)) [|
// Check if finishes
if (brightness != targetValue) {
// if not finished dim again
brightness = dimm.apply(item, type, targetValue, stepSize)
// rescheduling
timerPool.get(itemName).reschedule(now.plusMillis(rescheduleTime))
} else {
timerPool.remove(itemName)
}
])
end
I hope someone is still reading thisâŠ
Iâm using a Number item, the MQTT thing wonât let me use a Dimmer item.
I tried using the above rule but it is not working now, this is the rule:
import org.eclipse.smarthome.model.script.ScriptServiceUtil
val java.util.Map<String, Timer> timerPool = newHashMap
// will dimm the item and report back the new brightness
var dimm = [GenericItem item, String type, Number targetValue, Number stepSize |
var int itemBrightness = 0
// get brightness
if (type == "Color") {
itemBrightness = (item.state as HSBType).getBrightness().intValue
} else if (type == "Dimmer") {
itemBrightness = (item.state as DecimalType).intValue
}else if (type == "Number") {
itemBrightness = (item.state as DecimalType).intValue
}
// calculate new brightness
if (targetValue.intValue > itemBrightness) {
itemBrightness = itemBrightness + stepSize.intValue
// do not dimm above targetValue
if (itemBrightness > targetValue.intValue) {
itemBrightness = targetValue.intValue
}
} else {
itemBrightness = itemBrightness - stepSize.intValue
// do not dimm below targetValue
if (itemBrightness < targetValue.intValue) {
itemBrightness = targetValue.intValue
}
}
logInfo("home.universaldimmer", "Dimm " + item.name + " (" + type + ") to " + itemBrightness)
// set new brightness
item.sendCommand(itemBrightness)
// return new brightness
itemBrightness
]
rule "Universaldimmer"
when
// syntax: <type>,<target value>,<fade time>,<step size>,<item name>
//
// type: Color or Dimmer
// target value: e.g. 100 for ON or 0 for OFF
// fade time: amount of time (in milli seconds) to reach the target value
// step size: amount of steps to reach the target value
// item name: item to fade
//
// sample: Color,100,10000,12,col_E1_ES_Hue_Go_Farbe
Item Tafellamp_dimmer received command
then
val buffer = receivedCommand.toString.split(",")
val type = buffer.get(Number) // Color or Dimmer
var int targetValue = Integer::parseInt(buffer.get(100)) // where to go to
val int fadeTime = Integer::parseInt(buffer.get(4000)) // time for fading
val int stepSize = Integer::parseInt(buffer.get(3)) // step for fading
val itemName = buffer.get(Tafellamp_dimmer) // Item to handle
val item = ScriptServiceUtil.getItemRegistry.getItem(itemName)
var int rescheduleTime = 0
logInfo("home.universaldimmer", "Item to dimm: " + itemName)
// avoid that the target cannot be reaced
if (targetValue > 100) {
targetValue = 100
} else if (targetValue < 0) {
targetValue = 0
}
// If a timer is still on kill it
timerPool.get(itemName)?.cancel
// fade
var int brightness = dimm.apply(item, type, targetValue, stepSize)
if (brightness > targetValue) {
rescheduleTime = Math::round(fadeTime * stepSize / ((brightness + stepSize ) - targetValue))
} else {
rescheduleTime = Math::round(fadeTime * stepSize / (targetValue - (brightness + stepSize)))
}
// create the timer
timerPool.put(itemName, createTimer(now.plusMillis(rescheduleTime)) [|
// Check if finishes
if (brightness != targetValue) {
// if not finished dim again
brightness = dimm.apply(item, type, targetValue, stepSize)
// rescheduling
timerPool.get(itemName).reschedule(now.plusMillis(rescheduleTime))
} else {
timerPool.remove(itemName)
}
])
end
And this is the error it gives me when it fires: 2020-08-28 21:20:55.788 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule 'Universaldimmer': An error occurred during the script execution: Could not invoke method: org.eclipse.xtext.xbase.lib.ArrayExtensions.get(T[],int) on instance: null
Thanks for the quick reply.
Well, what Iâm trying to do is to let my Number item (which Iâm using as a dimmer) to fit in this rule/script but this isnât the solution so far
The easiest way would be to make an Dimmer type item for the light but the PaperUI (what Iâm using to create my things and items) wonât let me select an Dimmer type on the MQTT channel of the shelly what is behind the light.
If I just fill in Dimmer when it a a Number type item it also gives an error: 2020-08-28 22:42:46.861 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule âUniversaldimmerâ: The name âDimmerâ cannot be resolved to an item or type; line 58, column 26, length 6
I still have no idea what you expect val type = buffer.get(Number)
to do for you,
buffer you have just defined as an array of string fragments, the parts of a string that were separated by commas. val buffer = receivedCommand.toString.split(",")
Okay, so this buffer array will have elements 0, 1, 2 etc., however many comma-separated sections your original single string has.
You can get, say, the second one of those elements with val type = buffer.get(2)
It has no element called Number.
Number is not a variable you have defined (and I think you cannot actually define a variable called Number because number is likely a reserved keyword).
What are you trying to get here? Why do you think it needs to be somehow different from earlier examples?
Have you tried using the working rule from earlier, and just pretending your real Number Item is a Dimmer? A Number can do 0-100 just the same as Dimmer.
Thanks for the explanation, I never used a complex rule like this before so this is all quite new to me and I spent a lot of hours reading and trying to onderstand it, but apparently I didnât understand it very well.
I assumed that you needed to fill out the numbers with your own values, I also tried using the rule with only changing the Item in the rule but this gives me also an error when it runs, it only says â1â and nothing else.
I tried a lot of stuff, so I also changed the 1 from: var int targetValue = Integer::parseInt(buffer.get(1))
to a 10 and run it again and this gives me error 10.
I used the example of tbnobody because because I liked the fact that it could dim multiple items at the same time, but it is not clear to me right now where to fill out my values like steps for fading, time for fading etc.
In that rule, universaldimmer is a String type Item that you will need to create.
To make stuff happen, you send that Item a command string. This general idea is described in post #1
The rule as it stands only knows about âColorâ and âDimmerâ type items. But you want to use a Number type. A dimmer is just a glorified Number, I think if you use the rule as it is and lie to to the rule that is a Dimmer type, you wonât go far wrong. Try it.
I also spent some time yesterday evening to create a thing through the manual way with a mqtt.things file, this is working, so I can use a Dimmer type item now.
So I just made the universal dimmer Item as a String item.
This is the other rule that commands the universal dimmer item:
rule "Test fade"
when
Item Light_DimmerTafellamp received command
then
universaldimmer.sendCommand("Dimmer,IN,6000,12,Light_DimmerTafellamp")
end
(I hope this is the right way).
This what happening when I change the dimmer:
2020-08-29 11:20:13.497 [INFO ] [arthome.model.script.Universaldimmer] - I will dimm IN Dimmer (Dimmer) to 88
==> /var/log/openhab2/events.log <==
2020-08-29 11:20:13.513 [ome.event.ItemCommandEvent] - Item 'Light_DimmerTafellamp' received command 88
2020-08-29 11:20:13.516 [nt.ItemStatePredictedEvent] - Light_DimmerTafellamp predicted to become 88
2020-08-29 11:20:13.526 [vent.ItemStateChangedEvent] - Light_DimmerTafellamp changed from 86 to 88
2020-08-29 11:20:13.568 [vent.ItemStateChangedEvent] - Tafellamp_dimmer changed from 86 to 88
==> /var/log/openhab2/openhab.log <==
2020-08-29 11:20:13.580 [INFO ] [arthome.model.script.Universaldimmer] - I will dimm IN Dimmer (Dimmer) to 90
==> /var/log/openhab2/events.log <==
2020-08-29 11:20:13.593 [ome.event.ItemCommandEvent] - Item 'Light_DimmerTafellamp' received command 90
2020-08-29 11:20:13.597 [nt.ItemStatePredictedEvent] - Light_DimmerTafellamp predicted to become 90
2020-08-29 11:20:13.609 [vent.ItemStateChangedEvent] - Light_DimmerTafellamp changed from 88 to 90
2020-08-29 11:20:13.656 [vent.ItemStateChangedEvent] - Tafellamp_dimmer changed from 88 to 90
==> /var/log/openhab2/openhab.log <==
2020-08-29 11:20:13.661 [INFO ] [arthome.model.script.Universaldimmer] - I will dimm IN Dimmer (Dimmer) to 92
==> /var/log/openhab2/events.log <==
2020-08-29 11:20:13.675 [ome.event.ItemCommandEvent] - Item 'Light_DimmerTafellamp' received command 92
2020-08-29 11:20:13.677 [nt.ItemStatePredictedEvent] - Light_DimmerTafellamp predicted to become 92
2020-08-29 11:20:13.688 [vent.ItemStateChangedEvent] - Light_DimmerTafellamp changed from 90 to 92
==> /var/log/openhab2/openhab.log <==
2020-08-29 11:20:13.739 [INFO ] [arthome.model.script.Universaldimmer] - I will dimm IN Dimmer (Dimmer) to 94
==> /var/log/openhab2/events.log <==
2020-08-29 11:20:13.762 [ome.event.ItemCommandEvent] - Item 'Light_DimmerTafellamp' received command 94
2020-08-29 11:20:13.764 [nt.ItemStatePredictedEvent] - Light_DimmerTafellamp predicted to become 94
2020-08-29 11:20:13.783 [vent.ItemStateChangedEvent] - Light_DimmerTafellamp changed from 92 to 94
2020-08-29 11:20:13.785 [vent.ItemStateChangedEvent] - Light_DimmerTafellamp changed from 94 to 92
2020-08-29 11:20:13.787 [vent.ItemStateChangedEvent] - Tafellamp_dimmer changed from 90 to 92
==> /var/log/openhab2/openhab.log <==
2020-08-29 11:20:13.814 [INFO ] [arthome.model.script.Universaldimmer] - I will dimm IN Dimmer (Dimmer) to 94
==> /var/log/openhab2/events.log <==
2020-08-29 11:20:13.825 [ome.event.ItemCommandEvent] - Item 'Light_DimmerTafellamp' received command 94
2020-08-29 11:20:13.830 [nt.ItemStatePredictedEvent] - Light_DimmerTafellamp predicted to become 94
2020-08-29 11:20:13.841 [vent.ItemStateChangedEvent] - Light_DimmerTafellamp changed from 92 to 94
2020-08-29 11:20:13.843 [vent.ItemStateChangedEvent] - Tafellamp_dimmer changed from 92 to 94
==> /var/log/openhab2/openhab.log <==
2020-08-29 11:20:13.897 [INFO ] [arthome.model.script.Universaldimmer] - I will dimm IN Dimmer (Dimmer) to 96
==> /var/log/openhab2/events.log <==
2020-08-29 11:20:13.911 [ome.event.ItemCommandEvent] - Item 'Light_DimmerTafellamp' received command 96
2020-08-29 11:20:13.914 [nt.ItemStatePredictedEvent] - Light_DimmerTafellamp predicted to become 96
2020-08-29 11:20:13.925 [vent.ItemStateChangedEvent] - Light_DimmerTafellamp changed from 94 to 96
2020-08-29 11:20:13.968 [vent.ItemStateChangedEvent] - Tafellamp_dimmer changed from 94 to 96
==> /var/log/openhab2/openhab.log <==
2020-08-29 11:20:13.977 [INFO ] [arthome.model.script.Universaldimmer] - I will dimm IN Dimmer (Dimmer) to 98
==> /var/log/openhab2/events.log <==
2020-08-29 11:20:13.991 [ome.event.ItemCommandEvent] - Item 'Light_DimmerTafellamp' received command 98
2020-08-29 11:20:13.993 [nt.ItemStatePredictedEvent] - Light_DimmerTafellamp predicted to become 98
2020-08-29 11:20:14.009 [vent.ItemStateChangedEvent] - Light_DimmerTafellamp changed from 96 to 98
2020-08-29 11:20:14.050 [vent.ItemStateChangedEvent] - Tafellamp_dimmer changed from 96 to 98
==> /var/log/openhab2/openhab.log <==
2020-08-29 11:20:14.056 [INFO ] [arthome.model.script.Universaldimmer] - I will dimm IN Dimmer (Dimmer) to 100
No matter what value I give, it keeps putting it back to 100, when I change the command from IN to OUT, it just putting it back to 0.
Seems like he isnât reading the current value and just go to the minimum or maximum.
Take a look at your âTest fadeâ rule trigger.
When that Item receives a command, it kicks off an auto-fade process via universaldimmer.
Part of that process is of course issuing commands to your Item.
Which kicks off a new auto-fade process. Which issues commandsâŠ
I also thought that this rule created the problem, but I made a dummy/test dimmer and used that as trigger since it is not linked to the actual light, I assumed the behavior would be different, but the same thing happened. This is the rule I fired:
rule "Test fade"
when
Item testD received command
then
universaldimmer.sendCommand("Dimmer,100,10000,3,Light_DimmerTafellamp")
end
You can see it happen right here:
2020-08-29 16:47:06.314 [ome.event.ItemCommandEvent] - Item 'testD' received command 25
2020-08-29 16:47:06.414 [ome.event.ItemCommandEvent] - Item 'universaldimmer' received command Dimmer,100,4000,4,Light_DimmerTafellamp
2020-08-29 16:47:06.931 [ome.event.ItemCommandEvent] - Item 'testD' received command 39
2020-08-29 16:47:06.939 [vent.ItemStateChangedEvent] - testD changed from 25 to 39
2020-08-29 16:47:07.292 [vent.ItemStateChangedEvent] - LocalRaspberry_Sensors_CPUTemperature changed from 40.2 to 41.3
2020-08-29 16:47:09.333 [vent.ItemStateChangedEvent] - LocalRaspberry_Sensors_CPUTemperature changed from 41.3 to 42.4
2020-08-29 16:47:10.343 [vent.ItemStateChangedEvent] - LocalRaspberry_Sensors_CPUTemperature changed from 42.4 to 41.9
2020-08-29 16:47:11.353 [vent.ItemStateChangedEvent] - LocalRaspberry_Sensors_CPUTemperature changed from 41.9 to 42.4
2020-08-29 16:47:14.383 [vent.ItemStateChangedEvent] - LocalRaspberry_Sensors_CPUTemperature changed from 42.4 to 41.9
2020-08-29 16:47:16.403 [vent.ItemStateChangedEvent] - LocalRaspberry_Sensors_CPUTemperature changed from 41.9 to 42.4
2020-08-29 16:47:18.424 [vent.ItemStateChangedEvent] - LocalRaspberry_Sensors_CPUTemperature changed from 42.4 to 42.9
2020-08-29 16:47:19.437 [vent.ItemStateChangedEvent] - LocalRaspberry_Sensors_CPUTemperature changed from 42.9 to 42.4
2020-08-29 16:47:20.443 [vent.ItemStateChangedEvent] - LocalRaspberry_Sensors_CPUTemperature changed from 42.4 to 43.5
2020-08-29 16:47:21.341 [ome.event.ItemCommandEvent] - Item 'universaldimmer' received command Dimmer,100,4000,4,Light_DimmerTafellamp
==> /var/log/openhab2/openhab.log <==
2020-08-29 16:47:21.347 [INFO ] [me.model.script.home.universaldimmer] - Item to dimm: Light_DimmerTafellamp
2020-08-29 16:47:21.351 [INFO ] [me.model.script.home.universaldimmer] - Item to dimm: Light_DimmerTafellamp
2020-08-29 16:47:21.369 [INFO ] [me.model.script.home.universaldimmer] - Dimm Light_DimmerTafellamp (Dimmer) to 10
2020-08-29 16:47:21.369 [INFO ] [me.model.script.home.universaldimmer] - Dimm Light_DimmerTafellamp (Dimmer) to 10
==> /var/log/openhab2/events.log <==
2020-08-29 16:47:21.389 [ome.event.ItemCommandEvent] - Item 'Light_DimmerTafellamp' received command 10
2020-08-29 16:47:21.407 [ome.event.ItemCommandEvent] - Item 'Light_DimmerTafellamp' received command 10
2020-08-29 16:47:21.410 [nt.ItemStatePredictedEvent] - Light_DimmerTafellamp predicted to become 10
2020-08-29 16:47:21.422 [nt.ItemStatePredictedEvent] - Light_DimmerTafellamp predicted to become 10
2020-08-29 16:47:21.435 [vent.ItemStateChangedEvent] - Light_DimmerTafellamp changed from 6 to 10
2020-08-29 16:47:21.479 [vent.ItemStateChangedEvent] - Tafellamp_dimmer changed from 6 to 10
==> /var/log/openhab2/openhab.log <==
2020-08-29 16:47:21.579 [INFO ] [me.model.script.home.universaldimmer] - Dimm Light_DimmerTafellamp (Dimmer) to 14
2020-08-29 16:47:21.584 [INFO ] [me.model.script.home.universaldimmer] - Dimm Light_DimmerTafellamp (Dimmer) to 14
==> /var/log/openhab2/events.log <==
2020-08-29 16:47:21.608 [ome.event.ItemCommandEvent] - Item 'Light_DimmerTafellamp' received command 14
2020-08-29 16:47:21.611 [nt.ItemStatePredictedEvent] - Light_DimmerTafellamp predicted to become 14
2020-08-29 16:47:21.635 [ome.event.ItemCommandEvent] - Item 'Light_DimmerTafellamp' received command 14
2020-08-29 16:47:21.640 [vent.ItemStateChangedEvent] - Light_DimmerTafellamp changed from 10 to 14
2020-08-29 16:47:21.643 [nt.ItemStatePredictedEvent] - Light_DimmerTafellamp predicted to become 14
2020-08-29 16:47:21.702 [vent.ItemStateChangedEvent] - Tafellamp_dimmer changed from 10 to 14
==> /var/log/openhab2/openhab.log <==
2020-08-29 16:47:21.785 [INFO ] [me.model.script.home.universaldimmer] - Dimm Light_DimmerTafellamp (Dimmer) to 18
The testD item only gets his command one time so that rule only run once, but the other rule with the universal dimmer item keeps running till it reaches 100 and then stops, the above logging is only a little part.
Youâve shown us testD getting two commands in less than a second. This seems to have a knock-on effect doubling all the commands to the actual dimmer. I havenât worked out if that will give the âfail to stopâ symptom.