Go Down

Topic: Control Livolo switches / Livolo switch library (Read 150772 times) previous topic - next topic

Cleverhouse

Fussion of Livolo lib and Livolo recieve code here: https://goo.gl/nzwYCH

joevpt

#166
Aug 24, 2017, 03:35 pm Last Edit: Aug 24, 2017, 04:06 pm by joevpt
Hi,

How did you manage to set the light to on and off? I don't understand. Please advise. Thanks.
I'm working on this now,  but the simple way to get On and Off to work, is to use a scene.  When you put the Livolo switch into learn mode (hold the button for 5 seconds or so), and set the button to the desired state (On or Off), then if you send a scene code from a remote, then switch will go to that state.  You have four scenes available for each switch, so use one of them for ON (and another for OFF if you need to).

In my case, I use a different RemoteID for eah room.  The All Off code switches off the lamp for me in that room, and now Scene 1 turns on the lamp for me in that room. Using the other scenes is not essential for me as I want to be able to turn ON or turn OFF the lamp (not toggle it).

Thanks to the guys who bought the remotes for posting the scene codes.

[ By the way, the scene codes listed above are not valid for the four button remotes. The codes in the four button remotes are A=8, B=16, C=56 and D=42 (All OFF) ]

GoGs99

Hello, thanks for the code. it work perfect...
just little change code with about delay...
If get error, it will go for next  read.

Code: [Select]

#define SIGNAL_IN 0 // INTERRUPT 0 = DIGITAL PIN 2 - use the interrupt number in attachInterrupt

volatile byte impulse = 0; // kolejny puls
volatile int bufor[53];
volatile boolean header = false;
volatile unsigned long StartPeriod = 0; // set in the interrupt
volatile boolean stop_ints = false;


void setup()
{
 attachInterrupt(SIGNAL_IN, calcInput, CHANGE);

 Serial.begin(9600);
}

void loop()
{
 if (stop_ints) //data in buffer
 {
   unsigned long binary = 1;
   //byte i = 0;
   for (byte j = 0; j < 46; j++)
   {
     //Serial.print(binary);
     if ((bufor[j] > 220) &&
         (bufor[j] < 400))
     {
       binary <<= 1;
       //binary |= 1;
       //i++;
       bitSet(binary,0);
     }
     else if ((bufor[j] > 90) &&
              (bufor[j] < 220) && (bufor[j + 1] > 90) &&
              (bufor[j + 1] < 220)) {
       binary <<= 1;
       j++;
       
     }
     else if ((bufor[j] > 90) &&
              (bufor[j] < 220) && (bufor[j + 1] > 220) &&
              (bufor[j + 1] < 400)) {
       binary <<= 1;
       bitSet(binary,0);
       //i += 2;
       j++;
     }
     else break;
         }
         //Serial.println(bitRead(binary,4));
   if (bitRead(binary,23))
   {
     bitClear(binary,23);
     Serial.print("remoteID:");
     Serial.print((binary / 128) & 65535);
     Serial.print(" - ");
     Serial.print("key code:");
     Serial.println(binary & 127);
     delay (1000);
   }
   else {
     Serial.println("wrong code  ");
     Serial.println(binary, BIN);
     delay (100);
   }
   
   header = false;
   impulse = 0;
   stop_ints = false;

   // }
 }
}

// interrupt below...


void calcInput()
{
 // get the time using micros
 unsigned int duration = (int)(micros() - StartPeriod); // save pulse length to bufor
 StartPeriod = micros(); //begin next impulse
 //Serial.println(StartPeriod);
 if (stop_ints) return;
 if ((duration < 90) || (duration > 600)) goto reset; //impulse not right
 bufor[impulse++] = duration;
 if (duration < 415) return;
 if (!header)
 {
   header = true;
   impulse = 0;
   return;
 }
 else
 {
   if ((impulse < 23) || (impulse > 52)) goto reset; //too long or too short info
   stop_ints = true;
   return;
 }
reset:
 header = false;
 impulse = 0;
 return;
}

mmib

Hi,


any idea how to work with livolo dimmers? It seems this code working with switches only but dimmers has some different codes.

I have 4 button and 20 buttons transmitters for this dimmers/switches and it work. But arduino code works with switches only.

Maybe someone can point to link to decode RF signal from remote? (need decoder to get id and button key, not just lib to get pulses).

tyjtyj

This was the dimmer code given based on thread 23

1) "+": 92  ; "-": 116

2) "+": 126; "-": 36


I dont have dinner so i cant verified.

I wrote a javascript to generate livolo code to hex and base64

http://www.tyjtyj.com/livolo.php

brewster_

Hi and Happy new year!

Thanks for all who made titanic work with intagration of Livolo and Arduino. Library is very nice - special thanks to topic starter.

But there is one problem. There is not full description how  Arduino make to send commands only ON and only OFF. Joevpt try to do it but...

I wrote simple code for programming Livolo Switches. If you want  - "Code for dummies" (And now i'm dummie in Arduino coding too :) )

Code: [Select]

#include <livolo.h>

byte trport =12;              // port of 433-transmitter
Livolo livolo(trport);        // transmitter connected to pin trport
int onoff = 10;               // data from Serial
unsigned int ID = 6400;       // ID of Remote - type your own ID/ f.e. 6400; 19303; 10550; 8500; 7400
unsigned int IDB = 0;         // Number of remote's button #1: 0, #2: 96, #3: 120, #4: 24, #5: 80, #6: 48, #7: 108, #8: 12, #9: 72; #10: 40, #OFF: 106
unsigned int SCENE1 = 90;     // Number of scene (available 90, 114, 10, 18)

void setup() {
Serial.begin(9600);  // serial init
}

void loop() {

// Serial reading
//
if (Serial.available() > 0)
{
onoff = Serial.read()-48;
Serial.println(onoff);
}

if (onoff == 1)
{
  livolo.sendButton(ID, IDB);
  Serial.println("Button");
  delay (1000);
}

if (onoff == 2)
{
  livolo.sendButton(ID, SCENE1);
  Serial.println("Scene");
  delay (1000);
}

if (onoff == 0)
{
  
  livolo.sendButton(ID, 106);
  Serial.println("off");
  delay (1000);
}
}




There are steps for programming below:
1. wrote in header of code your ID, number off button and Scene.
2. compile and download in Arduino
3. open Serial monitor
4. press Livolo switch for 5 seconds (untill BEEP)
5. type 1 in Serial monitor and send - Livolo switch will BEEP
6. press Livolo switch for 5 seconds again (untill BEEP)
7. type 2 in Serial monitor and send - Livolo switch will BEEP
fin

Now You can test switch via sending same commands in Serial monitor.


Make it with all swithes in your location with individual Remote ID for each switch.

Now you can use 3 code for manage livolo switch from Arduino:

1. Standart on/off in single button with code you write in header

livolo.sendButton(RemoteID, Button)


2. Only ON via sending code of scene

livolo.sendButton(RemoteID, Scene)


3. Only OFF via sending code 106

livolo.sendButton(RemoteID, 106)

Watcher

#171
Feb 10, 2018, 07:43 pm Last Edit: Feb 11, 2018, 12:12 pm by Watcher
Does any one know if its possible to get feedback status indication from these devices via the RF link or otherwise?  That is, does the switch send back  info on its current position ON or OFF ?

sircb

Hello,

first i would like to thank you all for this community, i learned a lot from this forum.

second i would like to say something on this subject:

all the ids work but they work differently - Some of them are for 4 button remotes and some are for the touch remotes.

Get a random number from range 1 - 65500.

convert it to binary (you can use web/computer calculators)

count the "1"
if the number of  "1"  is an odd number  the code is for the touch remotes
if the number of  "1"  is an even number  the code is for  4 button remotes

4 button remote  codes:  A=8, B=16, C=56 and D=42

Obs:
- also found code 40 turns off
- on dimer switch  - when off dimming up (B=16) starts from first lvl  (does not matter last on level) 


touch remotes codes:   #1: 0, #2: 96, #3: 120, #4: 24, #5: 80, #6: 48, #7: 108, #8: 12, #9: 72; #10: 40, #OFF: 106
Scene 1 - 90
Scene 2 - 114
Scene 3 - 10
Scene 4 - 18

obs:
For rooms you need to change the remote id - every room has different remote id.



i also have a few questions:
1. is there an ON code for small remote (not Toggle) ?   
2. how can i dim (+) or (-) by sending codes?  ON code for touch remote (not Toggle)?
    now is use scenes..  sc1 - off  sc2- 33%  sc3-66%  sc4-100% but i have to sync 4 scenes etc... maybe there is a better way...











DmitryP

#173
Feb 17, 2018, 01:36 pm Last Edit: Feb 18, 2018, 01:32 pm by DmitryP
Hello and thank you all for great job!

1. is there an ON code for small remote (not Toggle) ?   
I have done brute force of all button values in range 0 and 128. The working ones were only 8=10=A, 16=18=B, 56=58=C and 42=40=D. The answer is no, however there is a working solution when using touch remote. You probably know that each dimmer can register multiple remotes, even both 4-button and touch together.

2. how can i dim (+) or (-) by sending codes?  ON code for touch remote (not Toggle)?
    now is use scenes..  sc1 - off  sc2- 33%  sc3-66%  sc4-100% but i have to sync 4 scenes etc... maybe there is a better way...
For the touch remotes I have found that values 68=70 toggle between 5 dimming modes, I think 20%, 40%, 60%, 80% and 100%. You can register additional 4-button remote to use dim +/-. ON function without toggle for touch remotes, as you wrote, can be mapped to some scene. But there is more.

Values 4=6 enter dimmer into scene programming mode. After dimmer makes 4 beeps you can change dimmer level and press any scene button to store dimmer state. One beep means that the scene is saved and two beeps mean that scene is deleted. Unfortunately, no other button values than 90=88, 114=112, 10=8 and 18=16 can be mapped to a scene. So we can define constantly (without toggle) OFF + 4 states, say for example OFF, 25%, 50%, 75% and 100%.

For a conclusion, we can combine two remotes as follows.

Remote ID 18287 (VL-RMT-02, 4 button):
8=10 - ON/OFF (toggle)
16=18 - DIM UP (6 modes)
56=58 - DIM DOWN  (6 modes)
42=40 - OFF

Remote ID 18288 (VL-RMT-03 or VL-RMT-04, touch):
0=2 - ON/OFF (toggle)
4=6 - SAVE/DELETE SCENE
68=70 - TOGGLE DIM (5 modes)
106=104 - OFF
90=88 - DIM 25%
114=112 - DIM 50%
10=8 - DIM 75%
18=16 - ON

Yes, there could be more scenes. But what if we combine multiple touch remotes? :)

UPDATE
Despite value 68 (for touch remotes) changes direction only when dimmer level reaches it's minimum or maximum, it is way more useful than we think. I have discovered that it can do much more dim steps than 5 as described above. By default LivoloRS library repeats each command 180 times and that makes 5 steps. I tried repeat count of 50 which also worked excellent on 5 meter distance with small antenna using LamPI-3.x/livolo and that made about 15 dimmer levels. It works the same way as we press touch button on the dimmer itself - the dimmer level changes while RF signal is sent.

Dmitry P

DmitryP

Does any one know if its possible to get feedback status indication from these devices via the RF link or otherwise?  That is, does the switch send back  info on its current position ON or OFF ?
I have checked if VL-C701DR sends any RF signals on 433 MHz band. The answer is no. Otherwise = connect wires to indicator LEDs.

Watcher

I have checked if VL-C701DR sends any RF signals on 433 MHz band. The answer is no. Otherwise = connect wires to indicator LEDs.
So if these devices are integrated in a building automation system, there is no way for the master device  (sender)to know if a command has been successful or not. Right?

DmitryP

So if these devices are integrated in a building automation system, there is no way for the master device  (sender)to know if a command has been successful or not. Right?
You can try to scan other frequencies with RTL-SDR for example. This super-cheap SDR can receive RF range from ~50 MHz to ~1700 MHz. Maybe you'll get lucky.

Dmitry P

Go Up