Hi Brett
Im trying to implement a slider for dimmer control using Garrys Dimmable endpoint lua -/content/he107-switch#comment-2936
I've created a slider listener event as below, can i specify the xapSource this way? - Im not seeing any BSC levels in XFX Viewer
Member for
16 years 10 monthsNow I'm almost set back up
Now I'm almost set back up again let me have a poke about with sliders with both Corona and on the Joggler and see how they work. I'll amend the wiki and post here with my findings.
Brett
Member for
13 years 11 monthsThanks Brett,I've also tried
Thanks Brett,
I've also tried bsc.sendLevel("dbzoo.livebox.Plugboard:LoungeLights", value)
Andrew
Member for
16 years 10 monthsI've added a corona demo of
I've added a corona demo of how to control a xAPBSC endpoint that is of the LEVEL type using a Slider.
http://livebox-hah.googlecode.com/svn/trunk/userapps/HAHCorona/
Don't forget to copy the hahlib folder into silderControl so the demo will run.
Brett
Member for
16 years 10 monthsAndrew I take it you got this
Andrew I take it you got this Corona slider demo to work for you? I never got any feedback on this code.
Member for
13 years 11 monthsBrett, Yes sorry for the late
Brett,
Yes sorry for the late reply, i am indeed, thanks to Mark Baldwin too we have some pretty nifty lua working well now (4 sliders controlling 4 dimmable sockets HE108C)
im sure Mark will be happy to share his mods here when all the bugs are ironed out
thanks for taking time to code the demo
thanks
Andrew
Member for
14 years 5 monthsDimming sliders
Yes Brett we got it going nicely as Andrew said. I'll post the code up in a day or so and add some working codes for the 15 dim levels.
Member for
14 years 5 monthsDimming sliders
Yes Brett we got it going nicely as Andrew said. I'll post the code up in a day or so and add some working codes for the 15 dim levels.
duplicate post due to slow connection and the 'form reuse detected' lol
Member for
14 years 5 monthsSlider mods with dim suffix list, corona mods etc
As promised here is the info Andrew and myself have come up with. Brett please feel to correct my work ;) Attached are 2 plugboard scripts, one for an even addressed HE and one for an odd addressed HE. All odd ones use the odd dim suffix list and all even use the even dim suffix list. There is also a text file listing my currently active controllers with addresses, on/off commands, dim prefix and 15 dim commands. Finally there is the corona code that will need to be placed inside the createScene (I have it before the UI helpers)
Member for
13 years 11 monthsThanks Mark, Big thanks to
Thanks Mark,
Big thanks to Garry for the original decoding write up which also helped me understand URF
Andrew
Member for
17 yearsMark,I would simplify the BSC
Member for
16 years 10 monthsLets have another crack at
Lets have another crack at that - if you have 3 states (ON,DIM,OFF) then you have the range 0/2
0/2, 1/2, 2/2 - being your 3 states. So the correct logic looks like this:
function levelController(opt)
return function(event)
-- Normalize the slider 0-100 value into the range 0->(states-1)
local idx = math.ceil(event.value / (100/#opt.states))-1
opt.listener(opt.states[idx+1])
if event.synthetic ~= true and event.phase == "ended" then
local lvl = string.format("%s/%s", idx, #opt.states-1)
bscSend{target=opt.xapTarget, level=lvl}
--print(string.format("bsc.sendLevel(%s, %s)", opt.xapTarget, lvl))
end
end
end
You're endpoint for the lounge lights uses the range 0-15 which is 16 states (4 bits) which is 0/15 as a level.
I already posted how to strip the x/y level reading into its part so you are good from there.
Brett
Member for
14 years 5 monthsnot really corrections ;)
The original code was lifted from Garry's (thanks Garry) I know the hacks weren't pretty but worked.
So this is a combination of simplifying the code and bringing in BSC compliance. Cheers Brett