Go Down

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

spch

Arduino code to read Livolo remote control buttons makes sense in case you have an RC you want to use and don't have hardware/skills to read codes manually (e.g. in Audacity or other audio editing software).

I thought it is quite simple, and I'm quite sure it is - just not for me.

In case there is no RC or one doesn't want to use it, reading Livolo codes, of course, is not necessary.

platenspeler

Yes, you're right if you have the remote. But if I had such a remote, I would probably pair the remote directly with the switch, and pair the Arduino as a separate second controller with one of your universal codes. I do this with my klikaanklikuit stuff.

Too bad that the transmission protocol of Livolo is so bad.

BTW: I received my Kopou switch yesterday, including a small remote key-chain fob. Kopou switches look quite similar to Livolo swicthes, but unfortunately their code is  quite different. But as their communication protocol is  better,  I hope I can integrate it's receiver code with the Action and klikaanklikuit code I already use.

But for those of you that would like to control Livolo and Kopou switches with the same remote: It is not going to work.
I will probably post the protocol one of these days,I first like to finetune the communication parameters (timing).

Maarten

platenspeler

Hi Spc,

I made receiver code for the Livolo and Kopou switches today. Of course the code is for Raspberry, but I expect that with only minor mods it can run on Arduino too (I can't check as I do not have Arduino)

The idea is simple: You need an interrupt handler function that runs as soon as the edge of the pin changes from hi to low or low-to-high. The interrupt handler fills a (circular) buffer. In the main routine you constantly read the buffer making sure you will keep one bit-string distance from the write position.

As the circular buffer method works much better than what I had, I will integrate it in my LamPI project. It needs some cleaning, but if you want I can publish the code...

Maarten

spch

Hi Maarten,

To "pair" both remote and Arduino to switch one has to figure out what remote's code is. As far as I know, switch can not be paired to several different remotes. That is why I tried to write Livolo receiver.

I've also found that there is way too much interference in my vicinity. And what is worse, noise pulses often are exactly the same length to fit into parts of Livolo's code. I managed to detect Livolo transmission by counting "key" (500 usec or so) pulses for specific amount of time (i.e. we know that Livolo command is about 800 usec, and it consists of about 100 repetitions of the same pattern, so in 80 usec we can expect ten 500 usec pulses).

It's a shame, but I got stuck in organizing buffer to hold pulses after Livolo transmission has been detected. So it would be very kind of you to publish your code.

ps. Thanks for feedback about Kopou switches.

Regards,
Sergey.

platenspeler

#64
Jan 08, 2014, 01:44 pm Last Edit: Jan 11, 2014, 11:57 pm by platenspeler Reason: 1
Spc,

I'm a newbie on GIT, but I think I managed to create a share to my repository (fingers crossed). You should be able to find the Livolo sniffer code at: https://github.com/platenspeler/LamPI and then in subdir receivers/sniffer. For raspberry: Sniffer contains support for klikaanklikuit, action/impuls, Livolo, Kopou and a few other remotes with 24-bit codes...

- unpack the branch in dir /home/pi/ (or use your own)
- cd /home/pi/receivers/sniffer
- make
- sudo ./sniffer -v -s -t
The flags are for: verbose + statistics (per remote) + test (gives all pulse timings too).

You will have to modify the interrupt handling/registration in the main program which is (slightly) different for Arduino. Probably the timing is almost equal for both devices so that should not be a problem.

Let me know if you encounter difficulties with GIT or so.

regards,

Maarten

platenspeler

#65
Jan 11, 2014, 12:08 am Last Edit: Jan 11, 2014, 06:32 pm by platenspeler Reason: 1
The github repository contains the commands to interface with the 433Mhz transmitter and receiver, but I also added a LamPI-daemon and a web interface in Javascript/jQuery to control your lighting in style. Below is a screendump of the main screen which controls the various devices in the rooms.

It's also possible to define more comples scenes (of multiple lam p commands), set timers and to manage handsets/remote controllers. I like to make most settings in the GUI, but for handsets unfortunately some settings need to be made in the configuration file directly.

The small Livolo keychain remotes are very useful to bind complex scene commands to one of the 4 buttons on the remote so that you can easily create a lighting scene in your living with just one keypress on the remote.



The user interface, MySQL database and the daemon can all run on a different computer on the network and will interface with the transmitter/receiver on Raspberry or Arduino over a socket interface (so these devices must be network enabled to work).

Maarten

icofjm

Hi Spch.
Hi I am a new user and I have recently approached for arduino, possessing Livolo plates I have read that it is possible for plugging it into another arduino, I wanted to know if he can get you some questions maybe in Italian in order to understand a little better, while waiting for your kind reply thank you and greet.

spch

Maarten,

Thank you so much for sharing!

Sincerely,
Sergey.

spch

Hi icofjm,

I'm not sure I got what you are interested in, but you are welcome to ask any questions. I'll do my best to answer them.

Sincerely,
Sergey.

icofjm


Thanks Spch. I wanted to know if I can control the livolo plates directly from arduino. It is difficult for one to first experience with arduino? I have already a rf transmitter just logged in as you described and install the code? Excuse my ignorance but are my first tests. Thank you for the time and rest while waiting for your kind reply.

Italiano

Grazie Spch.
Volevo sapere se posso comandare le placche livolo direttamente da arduino. È difficile per uno alla prima esperienza con arduino? Io ho già un trasmettitore rf basta collegato come da te spiegato e installare il codice? Scusa la mia ignoranza ma sono le mie prime prove. Ti ringrazio per il tempo dedicatomi e resto in attesa di una tua cortese risposta.

andriej

Hi everyone!

Thanks for the great library - I was able to learn 6 switches different codes.
The worst thing is that they have same code for 'on/off' and I don't have remote...

Is there any option to switch individual switches off with different code?
And what's the code to send for "ALL OFF" button using the library?
Maybe I'll just force every switch to off...

Regards

spch

icofjm,

It is really easy to control Livolo switches with Arduino. That is what Livolo library is for. Download it here:
https://docs.google.com/file/d/0B0DQ7La4EBHlU2ltTmlmeHhya3M

In case you download it as separate files, put them all into Livolo folder inside your Arduino\libraries folder.

Connect transmitter (this should be OOK/ASK 433 Mhz transmitter) DATA to pin 8, VCC to +5V and GND to GND. Don't forget to connect proper antenna (173 or, maybe, 164 mm) of single or multicore wire.

Then use test sketch blink.ino (it is in examples folder of Livolo library folder) for testing. Be sure to put your switch into learning mode shortly after uploading sketch. In case you've done it right, Livolo switch will turn on and off every 3 seconds.

You can find keycodes to emulate other buttons in readme.txe, that is also in Livolo library folder. And, of course, you can use any free digital pin to connect your transmitter.

icofjm

Thanks Spch.
In the coming days I will try following your valuable instructions and I'll let you know. For now, thanks for your patience and availability.

Nmraspi

Hi Platenspeller.

Hi I wanted to ask an information on the connection with raspberry. I livolo plates and I wanted to on and off directly from raspberry and I seem to have figured out that you have succeeded. I have a few questions. That type of form tx did you use and how did you connect? For the code I am referring to the link github? Excuse the banality of the questions but it is just that I approached this world and would like to learn, hope I'm not bothering you too much and confided in a courteous response. :)

icofjm

Hi Spch.
Thanks, there are successful and it works great!
A question, you can create a web interface for the control of various lights like Maarten that features with arduino?

Go Up