lucacalcaterra / risco-mqtt-bridge

Risco Alarm panel to MQTT Server Bridge
MIT License
25 stars 9 forks source link

New project with lan direct communication! #42

Closed lucacalcaterra closed 1 year ago

lucacalcaterra commented 3 years ago

https://github.com/TJForc/risco-lan-bridge

I'll test it asap. thanks to @TJForc

pergolafabio commented 3 years ago

Is this new project based on local API? Or did he hack the encryption?

Also, i don't think I can use/test it yet, i have an older TCP module, that doesn't allow local connections anymore when cloud is enabled... On port 1000 Newer TCP modules do allow it

TJForc commented 3 years ago

Indeed, on the old modules this seems to cause problems because they are single-socket.

If you have access in programming mode, it is possible to modify the parameters to test:

On a lightsys the default installer code is 1111 but it is very likely that it is no longer valid. You can test code 2222 which is the "sub-installer" code, a code that is rarely modified by technicians, and which gives access to all programming (except for modifying the installer code). For an agility it is 0132 for the installer and 0232 for the sub-installer.

And no, it is not a local API, I proceeded by reverse engineering by decompiling the software "Configuration software" to understand how to decrypt the IP frames (and it is even very possible that the encryption is strictly the same for the communication in RS-232 because I did not find other routine of decryption in the code of Risco, all the communication channels of the software return on the same code). This last point could be interesting because the communication cable for Agility and Lightsys is a simple GND / RX / TX cable (USB Serial Port for prosys); this could allow a second communication channel but would impose a proximity of less than 15m between the central and the system hosting my code.

-- Sent with Tutanota, the secure & ad-free mailbox.

Jul 22, 2021, 21:44 by @.***:

Is this new project based on local API? Or did he hack the encryption?

Also, i don't think I can use/test it yet, i have an older TCP module, that doesn't allow local connections anymore when cloud is enabled... On port 1000 Newer TCP modules do allow it

— You are receiving this because you were mentioned. Reply to this email directly, > view it on GitHub https://github.com/lucacalcaterra/risco-mqtt-bridge/issues/42#issuecomment-885255164> , or > unsubscribe https://github.com/notifications/unsubscribe-auth/AUVLG2OEQKKYTSJPUXOHQZTTZCGKLANCNFSM5AWXVHIQ> .

pergolafabio commented 3 years ago

aha , interesting! i know there is a local api though, just difficult to get, you need to sign an NDA anyway, i was planning to upgrade to TCP module to a newer one, to allow multiple sockets anyway, on the next intervention ... need to replace the battery anyway i do onw my wn system, i have an installer account, so i am not connected to another party, so i have all codes and i also use the CS, so that shouldnt be a problem

anyway, thx for sharing this project with us @TJForc ... much appreciated would be cool to have a python version, so easier to implement to Home Assistant do you use that too? any plans to miggrate to a python ?

TJForc commented 3 years ago

I think the local API uses the encryption used in this project. I take it for sure that it is more or less the code used in another software which also helped me to understand the encryption and that for which I also used the reverse engineering methods but of which I will keep the name hidden here (especially since I found their implementation disastrous, based on goto and other horrors)

For those who want more information on the methods used (software and other information), contact me by MP but I will not respond to everyone, only those that I consider trustworthy and actively participating in the development of risco products .

For python, I am not very good and for the moment I do not use home assistant, so I have not looked into this language - I do not know whether it is suitable either because not all languages ​​allow you to '' correctly perform the left / right shifts necessary for decryption (Visaul Basic and derivative, we must forget, the encryption/decryption table is wrong - C # and js, no problem). But if some want to make their contribution, that will be welcome.

Regarding the RS-232 link, it would be interesting to think about a project on raspberry-pi or arduino to interface between the control unit and provide an mqtt or other server (http, like the project risco-service (https://github.com/szlaskidaniel/risco-service) ) on the network

For now, I am waiting for feedback and I am improving what can be or what has come back to me.

-- Sent with Tutanota, the secure & ad-free mailbox.

Jul 24, 2021, 09:34 by @.***:

aha , interesting! i know there is a local api though, just difficult to get, you need to sign an NDA anyway, i was planning to upgrade to TCP module to a newer one, to allow multiple sockets anyway, on the next intervention ... need to replace the battery anyway i do onw my wn system, i have an installer account, so i am not connected to another party, so i have all codes and i also use the CS, so that shouldnt be a problem

anyway, thx for sharing this project with us > @TJForc https://github.com/TJForc> ... much appreciated would be cool to have a python version, so easier to implement to Home Assistant do you use that too? any plans to miggrate to a python ?

— You are receiving this because you were mentioned. Reply to this email directly, > view it on GitHub https://github.com/lucacalcaterra/risco-mqtt-bridge/issues/42#issuecomment-886027239> , or > unsubscribe https://github.com/notifications/unsubscribe-auth/AUVLG2O7IHZDS5MPTSFSPJTTZKCJXANCNFSM5AWXVHIQ> .

pergolafabio commented 3 years ago

thnx for this info!

vanackej commented 3 years ago

Hi @lucacalcaterra

I'm a Lightsys owner, and I'm not very happy with the forced paied cloud access move by Risco I was about to try to implement a risco-lan-bridge <=> MQTT library when I saw this issue. Did you start any work on this ? I can help / test early developments if needed, just let me know !

vanackej commented 2 years ago

@lucacalcaterra hi, me again. Now that I've been able to communicate with my panel using @TJForc library, I'm available to make a version of this library that would use local communication instead of the cloud API. Did you start working on it ? Should I fork the project or are you interested in a pull request to integrate in this library ?

pergolafabio commented 2 years ago

A python version would be awesome :-)

lucacalcaterra commented 2 years ago

@vanackej interesting idea.. now i ve not so much type you can fork and submit a pr when have something...

vanackej commented 2 years ago

@lucacalcaterra Actually, I started from https://github.com/mancioshell/risco-mqtt-home-assistant, that is very much like your codebase but a little simpler.

You can have a look at the code here

I tested it locally, and it's fully integrated with my HA setup : zones and detectors are autodiscovered, status are correctly propagated and I also added availability management, in order to detect communication issues. Will do additional tests in the next days

I'm waiting for @TJForc to accept and release the PR I made on the lan communication library to be able to release it. I must also have a look at how to facilitate library configuration, as we currently have to instanciate the panel class manually. Once this issue is fixed, maybe we could have simpler panel configuration