Thxn for the answer!.. I’m using Openhab3 and indeed it was the condition, it seems the IKEA lights dont expose ON/OFF but 0,0,0 or anything else (depending on color etc). So setting the condition to == 0,0,0 => ON and != 0,0,0 => OFF worked
but then, I got in trouble when I tried to make the long press option work… as it would always initialize a PRESSED before sending a LONG_PRESSED - in short, if the device was on and I wanted to make a dim on long-press, it would go off first… making the dim unusable…
so I’m now playing with Blockly that kinda works now…
the goal is to have:
CH1 (PRESSED) == on/off
CH1 (LONG_PRESSED) == DIM UP or DIM DOWN
CH2 (PRESSED) == preset color
CH2 (LONG_PRESSED) == rotate colors
But how to find out which commands I can send to an item? is there a query I can make on what it supports? (like on/off - x,y,x - dimup/dimdown - etc?)
Got it sort of to work, but the system is still doing some crazy stuff… the log:
21:45:23.906 [INFO ] [org.openhab.core.model.script.TEST ] - Test fired! LONG_PRESSED
21:45:23.917 [INFO ] [org.openhab.core.model.script.IKEA ] - IKEA_Color=124,69,59
21:45:23.928 [INFO ] [org.openhab.core.model.script.IKEA ] - IKEA_Color_HUE=134
21:45:23.935 [INFO ] [org.openhab.core.model.script.IKEA ] - IKEA_Color_SATURATION=69
21:45:23.942 [INFO ] [org.openhab.core.model.script.IKEA ] - IKEA_Color_BRIGHNTESS=59
21:45:23.951 [INFO ] [org.openhab.core.model.script.IKEA ] - IKEA_Color_BRIGHNTESS DIM DOWN
21:45:23.962 [INFO ] [org.openhab.core.model.script.IKEA ] - IKEA_Color_BRIGHNTESS=49
21:45:23.972 [INFO ] [openhab.event.ItemCommandEvent ] - Item 'IKEA_Color' received command 134,69,49
21:45:23.980 [INFO ] [openhab.event.ItemStatePredictedEvent] - Item 'IKEA_Color' predicted to become 134,69,49
21:45:23.989 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'IKEA_Color' changed from 124,69,59 to 134,69,49
21:45:24.027 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'IKEA_Color' changed from 134,69,49 to 133,69,59
21:45:24.630 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'IKEA_Color' changed from 133,69,59 to 133,69,49
21:45:24.973 [INFO ] [org.openhab.core.model.script.IKEA ] - IKEA_Color_BRIGHNTESS DIM DOWN NEXT
21:45:24.985 [ERROR] [.internal.handler.ScriptActionHandler] - Script execution of rule with UID 'myrules-2' failed: An error occurred during the script execution: Could not invoke method: org.openhab.core.model.script.lib.NumberExtensions.operator_greaterThan(org.openhab.core.types.Type,java.lang.Number) on instance: null in myrules
21:45:27.838 [INFO ] [openhab.event.ChannelTriggeredEvent ] - velbus:vmbgpod-2:7f964e441a:02:input#CH1 triggered RELEASED
As you can see, the DIM down actually is invoked and the light dims, but as soon as it reaches below 30 it goes back to the other loop (and essentially goes to the other statement) as it now tries to brighten it up again - and fluctuates between the 30 mark
ideas?
var ButtonLong=false
var ButtonDown=false
rule “Test short press”
when
Channel ‘velbus:vmbgpod-2:7f964e441a:02:input#CH1’ triggered PRESSED
then
ButtonLong=false
var IKEA_state = IKEA_Color.state()
logInfo(“IKEA”,"IKEA detected on with luminosity " + IKEA_state.toString)
end
rule “Test long press”
when
Channel ‘velbus:vmbgpod-2:7f964e441a:02:input#CH1’ triggered LONG_PRESSED
then
logInfo(“TEST”, “Test fired! LONG_PRESSED”)
ButtonLong=true
ButtonDown=true
if (IKEA_Color.state.toString != “0,0,0”) {
var HSBType hsbValue = IKEA_Color.state as HSBType
logInfo(“IKEA”, “IKEA_Color=” + hsbValue)
var DecimalType hue = new DecimalType(hsbValue.hue.intValue % 360 + 10) // 0-360; 0=red, 120=green, 240=blue, 360=red(again)
var PercentType sat = new PercentType(hsbValue.saturation.intValue) // 0-100
var PercentType bright = new PercentType(hsbValue.brightness.intValue) // 0-100
logInfo(“IKEA”, “IKEA_Color_HUE=” + hue)
logInfo(“IKEA”, “IKEA_Color_SATURATION=” + sat)
logInfo(“IKEA”, “IKEA_Color_BRIGHNTESS=” + bright)
if (bright <30) {
logInfo(“IKEA”, “IKEA_Color_BRIGHNTESS DIM UP”)
while(bright < 100 && ButtonDown == true) {
bright = bright + 10
logInfo(“IKEA”, “IKEA_Color_BRIGHNTESS=” + bright)
var newStatus = hue+“,”+sat+“,”+bright
IKEA_Color.sendCommand(newStatus)
Thread::sleep(1000)
}
}
if (bright >30 ) {
logInfo(“IKEA”, “IKEA_Color_BRIGHNTESS DIM DOWN”)
while(bright < 100 && bright > 10 && ButtonDown == true) {
bright = bright - 10
logInfo(“IKEA”, “IKEA_Color_BRIGHNTESS=” + bright)
var newStatus = hue+“,”+sat+“,”+bright
IKEA_Color.sendCommand(newStatus)
Thread::sleep(1000) // one minute
logInfo(“IKEA”, “IKEA_Color_BRIGHNTESS DIM DOWN NEXT”)
}
}
}
end
rule “Test release”
when
Channel ‘velbus:vmbgpod-2:7f964e441a:02:input#CH1’ triggered RELEASED
then
ButtonDown = false
if (ButtonLong==false){
logInfo(“IKEA”, “Test fired! PRESSED”)
if (IKEA_Color.state.toString == “0,0,0”) {
IKEA_Color.sendCommand(“ON”)
}
else{
IKEA_Color.sendCommand(“OFF”)
}
}
ButtonLong=false
end
I’m still on the “bleeding edge” version from a few years ago, which works absolutely perfect for me!
Now I added a VMB1RYS, but that doesn’t seem to be supported in the version I have running.
I also have a VP01, and someone (I think it was @MDAR) suggested I could use a 8PBU fot that, which actually worked. So I’m kind of asking the same thing, is there an item I can use in stead of the 1RYS, which will work, without having to update my velbus binding version?
I have a velbus installation and OpenHab with the velbus binding.
Is there a possibility to add support for the VMBDALI in the velbus binding for OpenHab?
That would be up to the volunteer developers for the Velbus binding for OpenHAB
At this stage, the best you can do is put a request on their GutHub page for it.
Put Velbus in the title in square brackets to help them find it.
IE [Velbus] feature request - VMBDALI
Or start a thread in the openHAB community forum
However, the DALI module isn’t very common and I very much doubt the developer/s have one to hand to work with.
But, as always, I have a demo rig that they can remotely connect to that does have a VMBDALI module onboard.
As a tip, please be very precise with what you are asking to be supported.
I would imagine that if it were treated like a multi channel dimmer, that could be incorporated quicker than if you asked for all the bells and whistles.
(And anyone else with coding skills that wants to join in)
Hello everyone
With the changes on the horizon with #openHAB and Velbus modules, which will also impact #HomeAssistant, I’m wondering if we could form a group to look after the development of the binding / driver ?
Each one of you have amazing skills and I’m very aware of the demand on your private time and your privacy.
If we all joined up, could we do something more amazing and take the pressure off you individually?