This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

EnOcean profiles supported in LM
#12
(26.11.2015, 07:13)admin Wrote: Try this with RAW 4-byte profile (first, not the split one), though I'm not sure about contents of byte 0, try setting it to 0x0A if it does not work.

Code:
-- dimming
b3 = 0x02
-- dimmer value [0..100]
b2 = event.getvalue()
-- ramp time in seconds
b1 = 1
-- data telegram, absolute value, store final
b0 = 0x0A

res = bit.bor(
 bit.lshift(b3, 24),
 bit.lshift(b2, 16),
 bit.lshift(b1, 8),
 b0
)

grp.write('1/1/1', res, dt.uint32)

Added this as event-based script to the object but I get this error:
event-Event for 1/1/3 26.11.2015 21:40:29
Line 11: attempt to index global '  bit' (a nil value)


Am I doing something wrong?

Writing it like this seem to make the error go away:
Code:
-- dimming
b3 = 0x02
-- dimmer value [0..100]
b2 = event.getvalue()
-- ramp time in seconds
b1 = 1
-- data telegram, absolute value, store final
b0 = 0x0A

a3 = bit.lshift(b3, 24)
a2 = bit.lshift(b2, 16)
a1 = bit.lshift(b1, 8)

res = bit.bor(a3,a2,a1,b0)

grp.write('1/1/5', res, dt.uint32)
Then it is just to make this work with the dimmer. Will get back with the result.
Thanks for the help so far!
Reply


Messages In This Thread
EnOcean profiles supported in LM - by edgars - 09.11.2015, 11:03
RE: EnOcean profiles supported in LM - by jorgenbl - 26.11.2015, 20:44

Forum Jump: