HE107 switch?

23 replies [Last post]
garrydwilms
Offline
United Kingdom
Joined: 31 Mar 2011

Hi, has anyone managed to get these working. I knew dimming might be an issue but thought that simple on off would work, apparently they are compatable with remotes other than HE200 so I assume the HE advanced protocol. Examples on wiki not working, any ideas?

AttachmentSize
image.jpg33.19 KB
AndrewJ
Offline
United Kingdom
Joined: 22 Nov 2012
I was thinking about getting

I was thinking about getting some of these for the BIG lights swmbo insists on using despite all my table lamps i have rigged up to the HAH / Joggler from the comfort of the sofa

Heres a few codes from the RF Helper for RS3 on/off  or RS17 dimmer sockets (http://www.dbzoo.com/public/rf-helper.html)

I have listed A1-A3 - my RS3 go from A1 - D4 prehaps try these combinations first

A1 ON    01010177046504650177060127101900001500
A1 OFF    01010177046504650177060127101900001400
A2 ON    01010177046504650177060127101900401500
A2 OFF    01010177046504650177060127101900401400
A3 ON    01010177046504650177060127101900101500
A3 OFF    01010177046504650177060127101900101400

garrydwilms
Offline
United Kingdom
Joined: 31 Mar 2011
Sorted

Thanks Andrew but these didn't work, however good old persistence did.

I used the arduino code linked in the wiki to reverse out the stream and had to tweak the timings back 10% as per Brett's previous comments regarding URF. All good now. 

Codes for interest are

on= 010200FA09C400FA00FA00FA044C00FA00000C012710421999999A5999A5A5A599A659A59A65A580

off=010200FA09C400FA00FA00FA044C00FA00000C012710421999999A5999A5A5A599A659A599A5A580

(worth adding to wiki?)

 

now for dimming ?!

 

Garry

garrydwilms
Offline
United Kingdom
Joined: 31 Mar 2011
Easier than I thought

Well, programmable dimming sorted. Very cool!

Basically you change the part of the stream relating to on and off (on is 2,1 and off is 1,2. you change this to 1,1) and add four extra bits relating to level 0-10. I'll need to write this up better tomorrow and also maybe write a lua script to present this as a level endpoint. 

Stay tuned, I'm well pleased with the nights progress!

 

garry

AndrewJ
Offline
United Kingdom
Joined: 22 Nov 2012
Hi Garry, No problem - glad

Hi Garry,

 

No problem - glad you got it working, I would like to see Dimming on the RF sockets, sure would be a nice addition to the HAH using the xAPFlash sliders on the joggler for example

Could this not be done with a Lua script to interpret the slide actions and send out repeated "on" a number of times

Andrew

derek
Offline
Glasgow, United Kingdom
Joined: 26 Oct 2009
Solid progress

Good job Garry. I don't know if you already have write access to the DbZoo Wiki but if you were able to share a writeup on this it would be much appreciated.

Cheers,
Derek.

garrydwilms
Offline
United Kingdom
Joined: 31 Mar 2011
Write Up!

Derek,

I cannot edit the Wiki but would be happy to if you give me access, alternatively I have included the write up here for info anyhow.

Note: This has been tested on HE307dimming wall sockets that use the advanced protocol only.

I have tweaked the pulse definition back ~10% to the following:

Encoding

HI

LO

0

250

2500

1

250

250

2

250

1100

3

250

0

 

 

 

Which gives a pulse definition of: 0200FA09C400FA00FA00FA044C00FA0000

For simple ON/OFF control, the protocol itself is built up as follows:

A “0” Bit is sent as 250Hi 250Lo then 250Hi 1100Lo (i.e. two frames, 1 then 2 from above)

A “1” Bit is sent as 250Hi 1100Lo then 250Hi 250Lo (i.e. two frames, 2 then 1 from above)

The stream is made up of:

A latch signal to start – 250hi 2500lo = frame 0 from above

Then 26 group code bits – i.e 272946 or in binary 00000001000010101000110010

Which gives: 1,2,1,2,1,2,1,2,1,2,1,2,1,2,2,1,1,2,1,2,1,2,1,2,2,1,1,2,2,1,1,2,2,1,1,2,1,2,1,2,2,1,2,1,1,2,1,2,2,1,1,2 as frames, using  0 = 1,2 and 1 = 2,1 as shown above.

There is next a group ID bit, I set this to 0. i.e. 1,2 as frames (not sure what this is for!).

Then comes the on/off code bit. On = 1 which is 2,1 as frames, Off = 0 which is 1,2 as frames.

Next  follows a four bit address code, I used 1010 or 2,1,1,2,2,1,1,2 as frames.(I assume you can change this for different devices)

Finally we send the latch signal again, frame 0

Add together and you get 33 bits or 66 frames in total.

If you use the RF helper to pack this up as follows:

Stream =              1999999A5999A5A5A599A659A59A65A580

PulseDef = 0200FA09C400FA00FA00FA044C00FA0000

Burst count  = 12

Interburst delay = 10000

Frames = 66

You should get: 010200FA09C400FA00FA00FA044C00FA00000C012710421999999A5999A5A5A599A659A59A65A580

 

For dimming, the protocol is altered as follows:

Change the on/off bit from either 2,1(on) or 1,2(off) to 1,1(the dim setting)

After the four ID bits but before the end latch signal add four further bits as follows:

Convert dim setting (0-10) to binary then to frames;

i.e level 7 = 0111, which is 1,2,2,1,2,1,2,1 as frames or

level 5 = 0101, which is 1,2,2,1,1,2,2,1 as frames.

Add this together and you now get  37 bits or 74 frames in total.

Via the RF helper, the 50% dim stream is:              1999999A5999A5A5A599A659A59965A59A5A40

To test this I added a new RF device with the on / off codes set to 50% and 70% dimming. This is not terribly useful and therefore my next job is to write a lua script to setup an endpoint and use the Level value to send the appropriate dim code. I will post when completed.

 

Enjoy!.

 

Garry

 

Ps Brett, this URF code structure is pure genius!.

brett
Offline
Providence, United States
Joined: 9 Jan 2010
Garry,I know I designed URF,

Garry,

I know I designed URF, and I'm glad you find it flexible, but reading your post I was impressed myself !  V..E..R..Y  N.I.C.E.

Brett

garrydwilms
Offline
United Kingdom
Joined: 31 Mar 2011
As promised

As promised. Lua script to generate an endpoint for dimming HE units using advanced protocol.

I'm sure there are better ways but this seems to work.

Garry

 

-- lighting control applet
module(...,package.seeall)
require("xap")
require("xap.bsc")
require("string")
info={
   version="1.0", description="Dimmable lighting control"
}
local dimprefix = "010200FA09C400FA00FA00FA044C00FA00000C0127104A1999999A5999A5A5A599A659A59965A5"
local offstream = "010200FA09C400FA00FA00FA044C00FA00000C012710421999999A5999A5A5A599A659A599A5A580"
local onstream = "010200FA09C400FA00FA00FA044C00FA00000C012710421999999A5999A5A5A599A659A59A65A580"
local dimsuffix = {
"999A40",
"99A580",
"99A640",
"9A5980",
"9A5A40",
"9A6580",
"9A6640",
"A59980",
"A59A40",
"A5A580",
}
function levelcontrol(endpoint)
dimsetting = math.floor((endpoint.text/10)+0.5) -- set display text to be between 0-10
if dimsetting == 0 then -- if state is off send off stream
sendcmd(offstream)
elseif dimsetting == 10 then -- if level is 100% send on string
sendcmd(onstream)
else
dimstream = dimprefix..dimsuffix[tonumber(dimsetting)]
sendcmd(dimstream)
end
end
function sendcmd(data)
msg = string.format([[xap-header
{
v=12
hop=1
uid=FF00EE00
class=rf.xmit
source=dbzoo.fake.source
target=dbzoo.livebox.Controller
}
rf
{
data=%s
}]], data)
xap.sendShort(msg)
end
function init()
bsc.Endpoint{source="dbzoo.livebox.Plugboard:LoungeLights", direction=bsc.OUTPUT, type=bsc.LEVEL, cmdCB=levelcontrol}
end

 

AndrewJ
Offline
United Kingdom
Joined: 22 Nov 2012
Gary, this looks great, im

Gary,

 

this looks great, im going to give this a go tonight :)

 

thanks

 

Andrew

garrydwilms
Offline
United Kingdom
Joined: 31 Mar 2011
Excellent, good lucki love

Excellent, good luck

i love mine, use it daily as the "big light" control via level sliders. 

Cool for impressing guests!

 

G.

AndrewJ
Offline
United Kingdom
Joined: 22 Nov 2012
Thanks Gary,Big Light made me

Thanks Gary,

Big Light made me laugh, reminds me of a Peter Kay sketch

when you say slider, i take it you mean via xAPFlash on the Joggler or Bretts xAP framework?

Andrew

garrydwilms
Offline
United Kingdom
Joined: 31 Mar 2011
Well I use sliders via the

Well I use sliders via the MOTE app on ios, but yeah slider on joggler would work also.

not used the sliders on joggler for a while but did get them to work for my thermostat setting so can't see why they wouldn't work for this application also.

Garry

mark_baldwin
Offline
Blackburn, United Kingdom
Joined: 19 May 2012
A big thanks for that

A big thanks for that explanantion Garry. Got my lights working fine now

AndrewJ
Offline
United Kingdom
Joined: 22 Nov 2012
Thanks for the excellent

Thanks for the excellent write up Garry

Did you happen to test additional addresses with your devices?

I am using the following 4 addresses with my devices (HE108C)

First two addresses work which are 10 as in your demo above, and 8 in decimal

1010 = 2,1,1,2,2,1,1,2
1000 = 2,1,1,2,1,2,1,2

  

Second pair, 6 and 4 are not recongnised by either of my devices

  
0110 = 1,2,2,1,2,1,1,2
0100 = 1,2,2,1,1,2,1,2

I will try some additional address this evening
thanks
Andrew
  
garrydwilms
Offline
United Kingdom
Joined: 31 Mar 2011
Not tried

Hi Andrew,

 

i only have the one switch so far so have not tried any others. Interesting you got 10 and 8 to work but not 6 and 4. Let me know how you get on with the others. 

 

Garry

ps nice to see others using this. Makes the effort worthwhile! :)

AndrewJ
Offline
United Kingdom
Joined: 22 Nov 2012
Hi Garry, Indeed it is :) and

Hi Garry,

 

Indeed it is :) and Dimming would be the icing on the cake for me

 

Do i use your endpoint purely by specifying <source>dbzoo.livebox.Plugboard:LoungeLights."percentage"</source>

with this uid=FF00EE00 ? XFX is reporting a different uid=FF00D801

Also as my HE107 sockets are the learning variety, do i need to initially pair them with the on and off codes listed above?

 

Cheers

 

Andrew

garrydwilms
Offline
United Kingdom
Joined: 31 Mar 2011
A couple of points:endpoint

A couple of points:

endpoint of my script is dbzoo.livebox.Plugboard:LoungeLights

this is controlled by sending level commands (0-100) to the endpoint. For the joggler try using a slider. Not as simple as you suggested, have read through the wiki for level control.

the UID in the script is purely one used to send the actual RF commands to the controller, you can ignore this. The UID of the endpoint will be determined by plugboard and based upon the load order of your scripts. Xfx viewer will show you this.

you will need to program the switch using on/off commands (or level 100, level 0 commands)

 

also just to note that the script I posted isn't really BSC compliant as there are rules about sending on/off commands with level controls which I haven't implemented. It works and I posted as a starting point.

Cheers Garry.

AndrewJ
Offline
United Kingdom
Joined: 22 Nov 2012
Thanks Garry,Thats exactly

Thanks Garry,

Thats exactly what im trying at the moment, a Joggler xAPflash slider - the WIKI level control or lcontrol: seems to refer to a different control and not a slider:

lcontrol: (Level control) Almost identical to control except that it also includes a level=100% key/pair in the message. This ensures that a level based endpoint, for example a dimmed light, always comes back on at 100% brightness.

however it does also state a slider can be used

slider: Allows a SWF slider control to be embedded onto your page, to either control or display BSC level= items

Cant seem to find how to specify a level with a slider however

Andrew

garrydwilms
Offline
United Kingdom
Joined: 31 Mar 2011
Been ages gee since I touched
Been ages since I touched xap flash but try something like this. Just modify the ??? To suit
<button name="slider">
<bsctext>
<fontsize>20</fontsize>
</bsctext>
<gridX>?</gridX>
<gridY>?</gridY>
<posY>?</posY>
<xAP>
<schema>xAPBSC</schema>
<uid>???</uid>
<source>dbzoo.livebox.Plugboard:LoungeLights</source>
</xAP>
<mode>slider</mode>
<hide>text</hide>
<slider>
<min>0</min>
<max>100</max>
    <type>embedded</type>
<design>sleek</design>
<rotation>vertical</rotation>
<latency>500</latency>
</slider>
</button>
ps I think sliders send level commands as default
AndrewJ
Offline
United Kingdom
Joined: 22 Nov 2012
Hi Garry, Yep thats looks

Hi Garry,

 

Yep thats looks more or less the same as i have, i would agree prehaps the slider sends level commands as its would make sense for the volume and screen brightness slider commands built into xAPflash

im not seeing any BSC data on XFX viewer when i move the sliders so i expect somethings not working... I may make the move to Corona for the dimming sliders and ditch the Jogglers

 

Thanks

 

Andrew

mark_baldwin
Offline
Blackburn, United Kingdom
Joined: 19 May 2012
Dim levels

It turns out, there are 15 dim levels for the HE units. I guess this makes sense as there are 4 bits assigned to the level. I also found that sending an 'ON' command for the full on level caused the lamps to go into 'auto dim'.

So a couple of mods were required but many thanks for the original code.

I've also found that the address has an effect on the dim suffix, an even address always has one set of dim suffixes and an odd address has a second set.

I'll upload the new code and both sets of suffixes and some more addresses in the next day or so, as away from HAH at the mo....

garrydwilms
Offline
United Kingdom
Joined: 31 Mar 2011
Thanks for this Mark, good

Thanks for this Mark, good work.

it was difficult to decode as I had no remote and was working off internet arduino snippets. Good to know we have 15levels and I did notice sending an on code whilst already on sent it into auto dim but didn't have a solution.

I'm very interested in your mods.

 

cheers

Garry

mark_baldwin
Offline
Blackburn, United Kingdom
Joined: 19 May 2012
Mods as promised

Hi Garry

Mods are in the slider post in the corona forum

Cheers for the good work

Mark

Hardware Info