Posts: 176
Threads: 42
Joined: Jul 2015
Reputation:
2
Hi
I have put up an binary switch from Schneider to controll group adress that Dali talk with.
I have to possible ways of controlling the Dali adress, with binary on-off , where the on value may be put in (0-254) in dali interface
and with 1 byte integrer. Then I can put preset values in the swicth that it will send to the Dali Interface.
Is it possible for you to add the "standard" dimming data type to the Dali interface? 4 bit (3 bit control, and break)
This way it can be possible to seemless dim up and down . Or is there another way to do this?
I am using the Dali to control white LED lamps at the moment and later on i will intergrate RGB and RGBW lamps to it.
Passivpluss
Posts: 176
Threads: 42
Joined: Jul 2015
Reputation:
2
Another feature would be to add how long time the dimming should take. Now when i use the value dim it goes for the percentage instantly. A 1-3 seconds grading should look better
Posts: 51
Threads: 14
Joined: Jul 2015
Reputation:
1
+1 for including dali dimming through separate object, so we won't need to script this.
thank you
Posts: 428
Threads: 100
Joined: Jun 2015
Reputation:
45
thanks for suggestion!
currently we will add it into our to-do list and will look at it some time in the future
For now, please do this functionality via scripts.
Posts: 445
Threads: 93
Joined: Jun 2015
Reputation:
6
(04.08.2015, 10:10)edgars Wrote: thanks for suggestion!
currently we will add it into our to-do list and will look at it some time in the future
For now, please do this functionality via scripts.
Can you please give an example how to do this?
Posts: 176
Threads: 42
Joined: Jul 2015
Reputation:
2
And automatic feedback status would be great to add
Posts: 82
Threads: 29
Joined: Jul 2015
Reputation:
2
is there a way of doing this for DMX too? does someone have a good DMX example for a script doing dimming?
Posts: 7720
Threads: 42
Joined: Jun 2015
Reputation:
446
Right now we don't have enough resources to implement this.
Here's a function for start/stop dimming:
Code: function bindimmer(up, down, out, event)
local main, rev, step, val, new, delay
step = 10 -- in %
delay = 0.5 -- in seconds
-- ignore "stop" command
val = tonumber(event.datahex, 16)
if val == 0 then
return
end
-- up, normal mode
if event.dst == up then
main, rev = up, down
-- down, reverse step
elseif event.dst == down then
main, rev = down, up
step = -step
-- invalid object
else
return
end
-- current output object value
val = grp.getvalue(out) or 0
while true do
-- main object in "stop" state
if not grp.getvalue(main) then
return
end
-- reverse object in "start" state
if grp.getvalue(rev) then
return
end
-- get new value
new = math.min(100, val + step)
new = math.max(0, new)
-- no change, stop
if new == val then
return
end
-- write new value
val = new
grp.write(out, new, dt.scale)
-- wait for next run
os.sleep(delay)
end
end
Usage:
1. Add bindimmer function to Common functions
2. Create 3 objects:
1/1/1 - binary (dim up)
1/1/2 - binary (dim down)
1/1/3 - 1-byte scale (output)
3. Create an event script for each binary object:
Code: bindimmer('1/1/1', '1/1/2', '1/1/3', event)
4. You can tune step and delay variables in bindimmer function to adjust dimming speed
Posts: 445
Threads: 93
Joined: Jun 2015
Reputation:
6
Thanks for the example, but a standard wall switch has two groupaddresses:
- turn on/off (1bit)
- dimming (4 bit, 3bit controlled - 03.007 dim/blinds step)
How to implement this for dali?
Posts: 445
Threads: 93
Joined: Jun 2015
Reputation:
6
16.10.2015, 14:24
(This post was last modified: 16.10.2015, 14:25 by gjniewenhuijse.)
(18.09.2015, 13:30)gjniewenhuijse Wrote: Thanks for the example, but a standard wall switch has two groupaddresses:
- turn on/off (1bit)
- dimming (4 bit, 3bit controlled - 03.007 dim/blinds step)
How to implement this for dali?
Is there already a solution for a default knx dimmer button:
up short: on
down short: off
up long: dim + started
down long: dim - started
Its important to control the standard 4 bit, 3bit controlled object for smooth dimming when using dali.
Posts: 1759
Threads: 6
Joined: Jul 2015
Reputation:
115
17.10.2015, 23:48
(This post was last modified: 17.10.2015, 23:53 by Erwin van der Zwart.)
Hi Gert Jan,
There is no long/short detection by default, the only way to do that is with custom SVG buttons
that hold JavaScript to detect long/short
But why do it so hard if you can easely use byte value object with a slider?
BR,
Erwin
Posts: 176
Threads: 42
Joined: Jul 2015
Reputation:
2
This is to get dimming from a psycical switch. But if you use one rocker for up and one for down then this will work from the web application the easiest way is from slider.
Posts: 1759
Threads: 6
Joined: Jul 2015
Reputation:
115
Hi PassivPluss,
My remark was on the long/short press from visu.
If you have a physical switch you can use our pushbutton interface MTN670802
There is a long/short press detection parameter with value stepper to send byte value.
You can set stepsize, direction and behavior when reaching min/max. This should work for you. Also all
KNX pushbuttons (plus) have this feature.
BR,
Erwin
Posts: 7720
Threads: 42
Joined: Jun 2015
Reputation:
446
Posts: 445
Threads: 93
Joined: Jun 2015
Reputation:
6
(19.10.2015, 06:25)admin Wrote: Have you tried this script?
http://forum.logicmachine.net/showthread.php?tid=13
thanks, that works for me.
I added a resident script for dimming:
Code: lastDali = 1
for i = 0, lastDali do
dimObjects = grp.tag('DALI_DIM_'..i)
for key, object in pairs(dimObjects) do
dimmer = object.data
step = bit.band(dimmer, 0x07)
if step ~= 0 then
lvObjects = grp.tag('DALI_LV_'..i)
for key, lvobject in pairs(lvObjects) do
up = bit.band(dimmer, 0x08) ~= 0
value = lvobject.data
if up then
newvalue = value + 5
else
newvalue = value - 5
end
-- clamp between 0 and 100
newvalue = math.min(newvalue, 100)
newvalue = math.max(newvalue, 0)
if newvalue ~= value then
lvobject:write(newvalue)
end
end
end
end
end
os.sleep(0.1)
And i added a script for setting the status
Code: require('user.dali')
lastDali = 1
for i = 0, lastDali do
res = dalicmd('internal', 'queryactual', { addrtype = 'short', address = i })
if res then
curr = math.floor(res:byte() / 2.54)
-- set target level status
targetObjects = grp.tag('DALI_SLV_'..i)
for key, object in pairs(targetObjects) do
prev = object.data
if curr ~= prev then
targetObjects:response(curr)
end
end
-- set target on/off status
targetObjects = grp.tag('DALI_STAT_'..i)
for key, object in pairs(targetObjects) do
prev = object.data
if (curr>0) ~= prev then
targetObjects:response( curr > 0 )
end
end
end
end
os.sleep(0.1)
Next todo is a scene handler for DALI, see other thread
|