Usage examples
Opened this issue · 6 comments
Hi @wildstray , great work on reverse engineering the meian protocol.
I have as well an Meian alarm panel and would like to test your meian-client.
At the moment I am using homeassistant which has an ialarm (meian) integration which is limited to arm and disarm.
Can you provide some examples of the usage of your client?
I'm interested too, I'd love if eventually it could be used to implement a better Home Assistant integration. The current integration is developed by parsing the HTML from the panel web interface and lacks a lot of funtionalities.
I'm not sure why but for some reason the first message received from my alarm (on connection) has an invalid XML with 2 root element (both Err and Root):
File "/opt/meian-client/meian.py", line 639, in _receive return xmltodict.parse(self._xor(data[16:-4]).decode(), xml_attribs=False, dict_constructor=dict, postprocessor=self._xmlread) File "/home/mce/.local/lib/python3.7/site-packages/xmltodict.py", line 327, in parse parser.Parse(xml_input, True) xml.parsers.expat.ExpatError: junk after document element: line 1, column 17
This is the decrypted message:
<Err>ERR|00</Err><Root><Pair><Client><Err></Err></Client></Pair></Root>
As a temporary fix I edited line 639 and replaced the "ERR|00" part and now the client runs fine:
from
self._xor(data[16:-4]).decode()
to
self._xor(data[16:-4]).decode().replace("<Err>ERR|00</Err>", "")
my alarm is branded as iAlarm (antifurto365)
Very interesting about this projec !.How can i use in my alarm? can you write a document for use it ?
can you get sensor enrolled with the ialarm states with this python script?
Hi, I want to reply you all, unluckly I have only one alarm bought in 2018. I didn't updated anymore this project cause I haven't newer alarms for more reverse engineering and I have no more free time...
About the usage of this library: look at the ending, the test code I leaved in place main()
You have to instantiate a MeianClient() object with username, password and host and port (this can be the local alarm or the cloud server). This is a synchronous client.
And you can have also a push (asynchronous, read only) client MeianPushClient() that call a function if an alarm is received.
Sensors can be enrolled with SetSensor() and the sensor code.