Setting light switch dim level with RF signal?

LightwaveRF Communi… > Forum > LightwaveRF Hackers > Setting light switc…

LightwaveRF Community: Welcome Forums LightwaveRF Hackers Setting light switch dim level with RF signal?

This topic contains 3 replies, has 2 voices, and was last updated by  btidey 6 days ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #25768
     winger15mk says:

    winger15mk
    Participant

    So I’ve got an arduino project set up which can send on and off commands to my dimmer light switch which works perfectly.

    My question is, is it possible to control the dim level with a single transmitted message?

    So a signal command would say set it to 50%?

    Thanks
    Gary

    #25769
     btidey says:

    btidey
    Participant

    Yes.

    See https://github.com/roberttidey/LightwaveRF/blob/master/LightwaveRF433.pdf which contains description of rf messages and the commands that can be used.

    If you look at the on commands you can see the parameter encodes the level. As this is in 31 steps then a level of 15 sets to 50%

    #25776
     winger15mk says:

    winger15mk
    Participant

    Hi btidey,

    Thanks for getting back to me! I have read that document a good number of times now and have to be honest im really struggling to compare what I have to it!

    I have the following two on and off signals which are working at the moment:

    byte lighton[] = {0xBB,0x6F,0xF6,0xEE,0xEB,0xEE,0xDD,0x7E,0xB7,0xF6};
    byte lightoff[] = {0xDE,0xF6,0xF6,0xF6,0xEB,0xEE,0xDD,0x7E,0xB7,0xF6};

    Now I am guessing that the second half is some kind of identifier so the receiving light switch knows the two signals are both from the same ‘source’:

    ’0xEB,0xEE,0xDD,0x7E,0xB7,0xF6′

    So the first half of both signals I am assuming contain the ‘on’ and ‘off’ elements.

    So how can I logically look at those codes to change them for dim values?

    Really appreciate the help, I am going to keep going over the document but am struggling at the moment so appreciate your help!

    Thanks
    Gary

    #25797
     btidey says:

    btidey
    Participant

    The signals you are using are the raw bytes. LightwaveRF messages use a nibble (4 bits) encoding scheme to ensure there are minimum number of transistions in the signal. So each nibble is actually transmitted as 8 bits.

    If you look in the document under message encoding you will find a table which shows how each nibble are encoded as a raw byte value

    So 0xBB,0x6F,0xF6,0xEE,0xEB,0xEE,0xDD,0x7E,0xB7,0xF6 actually represents the data

    0×9,0xF,0×0,0×1,0×3,0×1,0×5,0xB,0xA,0×0

    Now you should be able to make sense of the commands and parameters section

    You will see you are sending command 0×1 to device 0 in room 0 with parameter 9F. 315BA represents the transmitting device address and is always the same for a particular transmitter.

    If you look at the command table you can what value to give to the parameter to set a dim level directly.

    If using raw values you will need to convert to the nibble values and then translate to the raw value. The libraries I use allow sending messages in the nibble format which is easier and the translation to raw bytes is done by the library functions.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.