Interlogix Ultrasync

Hey panos2310,

Have a moment… Chris is doing a good job and if everything goes, we will be adding it as a integration.

2 Likes

Posting an upvote as I am also eagerly waiting this intergration! Thanks so much @l2g

I am curious if you think your work is going to help resolve this thread as well: NX584 Alarm & Hass.IO Add-on

Completely different kind of hardware and probably different method of integration this old method has been known for a while but not convenient to all of the rest of us that have the 595E this is why we have been waiting for such a long time for the solution.

Keep up the good work focus on 595 and let us know if we can assist in anyway

Hi guys,

As a status update; there isn’t much more we can do at this point; we’re in the hands of the awesome HA members to accept and merge the code. I’ll definitely address any concerns they bring forth when/if they arrive to help with the process. :slightly_smiling_face:

All unit tests were done this past Friday (Oct 30th) and code is still subject to a review by them at this time. They did one review already and I addressed their concerns (no more HA YAML config).

  • Core Merge Request (still pending second review + merge): here (same link as in my last post)
  • Interlogix/UltraSync Branding (Approved and awaiting Core Merge): here
  • Documentation for new Integration (still pending approval): here

This first implementation is pretty basic, but it works great for me; hopefully it will work for all of you too. At this time I’m only using these two automations (and they worked fantastic all weekend):

# Alarm Activation
- alias: Activate Nightly Alarm
  trigger:
    platform: time
    at: "23:00:00"
  action:
    service: ultrasync.stay

# Alarm Deactivation
- alias: Disarm Nightly Alarm
  trigger:
    platform: time
    at: "06:00:00"
  action:
    service: ultrasync.disarm

Here is a screenshot of it’s overnight status that hopefully all of you will have too soon:

If you want to know right away if this new integration will eventually work for you (whenever it hopefully does get merged): Just follow my comment in this thread from almost a year ago. Install my ultrasync Python library and create a small config file. If you can interface with your panel with that, you’ll be good to go in Home Assistant.

As a side note: I looked at other home assistant integrations and saw that you can get really extravagant and create an alarm panel and stuff. Maybe this can evolve to that next. :slightly_smiling_face:

2 Likes

Great job man!

I will have to wait till the merge. I’m running HA as an OS on my Pi.

I too will be eargerly awaiting the merge. Thanks for the effort you are putting into this.

Hi Chris,

I tried the instructions from above and got the follow unexpected error after adding in my details to the integrations page.

Logger: homeassistant.components.ultrasync.config_flow
Source: components/ultrasync/config_flow.py:38
Integration: Interlogix Ultrasync Hub (documentation, issues)
First occurred: 1:13:08 PM (1 occurrences)
Last logged: 1:13:08 PM

Unexpected exception
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/ultrasync/config_flow.py", line 68, in async_step_user
    await self.hass.async_add_executor_job(
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/ultrasync/config_flow.py", line 38, in validate_input
    if not usync.login():
  File "/usr/local/lib/python3.8/site-packages/ultrasync/main.py", line 143, in login
    if not self._areas(response=response) or not self._zones():
  File "/usr/local/lib/python3.8/site-packages/ultrasync/main.py", line 418, in _areas
    sequence = json.loads(match.group('sequence'))
  File "/usr/local/lib/python3.8/json/__init__.py", line 357, in loads
    return _default_decoder.decode(s)
  File "/usr/local/lib/python3.8/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/lib/python3.8/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

I will also mention that I have tried a “maintenance” user as well as the “installer” user. All with the same fault.

No worries @bojo,

I anticipating this happening eventually since I’m really the only one who’s appeared to test this (now aside from you). The good news is because i anticipated it, i prepared for it. The ultrasync library was tested with my alarm system; my hub produces a web page that appears to be v3.02-C. It’s possible you have an newer or older version of the software installed on your side which is giving you slightly different results I’m not able to parse yet.

The easiest way to see what version you’re running is to log in, and just view the source with your browser… for me, it looked like:

<!doctype html>
<html>
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>UltraSync :: Secure Network</title>
  <meta name="viewport" content="initial-scale=1.0, width=device-width, maximum-scale =
    <script src="/v_ZW_03.02-C/eng_us.js" charset="utf-8"></script>^M
  <link href="/v_ZW_03.02-C/m.css" rel="stylesheet">
  <script src="/v_ZW_03.02-C/master.js" charset="utf-8"></script>
  <script src="/v_ZW_03.02-C/status.js" charset="utf-8"></script>
...

Informix for whatever reason embeds the version in the path to the static files (such as .css and .js, etc)

Anyway, if you could just use any operating system, or Docker, and install ultrasync:

# install ultrasync
pip install ultrasync

You’ll then need to create a small configuration file that’s super easy:

# 3 lines; let's say this is called ultrasync.conf
host: 192.168.0.30
user: My Username
pin: 1234

Now using the tool, i built in a switch called --debug-dump which will authenticate with your device (i’'m not sure if this is happening yet for you as you might be failing on the first page) and dump all of the .json and .htm files needed to interface with your device. If I could just see what they look like, I could tailor the tool to work with your version too.

You can call the tool like so:

# This will dump some details extracted from your Hub
# it will write them all into a new directory called: YYYYmmddHHMMSS.ultrasync-dump
# where the first half represents the date/time
ultrasync --config=/path/to/file/you/just/created/ultrasync.conf --debug-dump

If this doesn’t work (meaning it can’t even log in and scrape the first web page), no worries; can you just log in yourself (using the web site) and download the html source for me? Email it to [email protected] (my address) so that i can start updating the tool to support the differences (for better compatibility down the road). You can also post it here, but this thread might get a little unnecessarily busy (so email is probably better); your call.

Hey Chris,

Is there a way we can test it when we are running Home Assistant OS? Like add it as a custom component?

I tried to do it through SSH root, but I can’t make it work.

@stefdewilde,

You should be able to yeah. If you can get shell access to home assistant you can do all of the above and call ultrasync from within it. You can run commands like:

# A live monitor of your home (provided configuration is good)
ultrasync -c /path/to/config.conf --watch 

If it doesn’t work for you; and you need to do the --debug-dump, you’ll need a way to get the produced dumped data out of your container. I guess you could copy it into the same directory your configuration is kept? (that’s a mount to outside or your SD card if a Pi device) i believe.

/v_CN_0.108-m/lang_engeu.js

currently on Hass.io

Any way I can help with testing?

I assume we only have to copy the folder ultrasync from your github?

@stefdewilde:
No the best thing you can do at this time would be to gain access to your Pi and type the following:

# pull latest version from github, this way i can provide updates as we
# test (if required) and you can pull the latest all the time:
pip3 install git+https://github.com/caronc/ultrasync.git

Only then will you get access to the ultrasync command.

@panos2310: Interesting v_CN_0.108-m eh? This is all new to me as I’m learning as i go; I thought all of the UltraSync Hub’s were also nicknamed Zerowire (which was where i assumed the ZW came from on my system). Not sure what CN stands for and the versioning is so much different. Hopefully the all of the web interface isn’t too different. At the very least, it would be great if you could install the ultrasync standalone tool (lots of docs now in this thread on how to do it and set up a config file). I’d encourage you to send me your --dump-data results as well via email if you could. At the very least, if you can just log into your system (via it’s webpage) and view the HTML source (as you already did to provide me the version); just copy/paste that entire page into a attachment you can email me (or paste it straight into the email itself). I’ll just need something to work with so i can see how the versions/systems vary. HOPEFULLY :crossed_fingers: the systems are close enough that things won’t require much (if any at all) effort to get you set up.

Can’t seem to install anything through pip with the HomeAssistant OS.

This is my source:

<head>
	<meta charset="ISO-8859-1">
	<title>NX-595E :: Secure Network</title>
	<meta name="viewport" content="initial-scale=1.0, width=device-width, maximum-scale = 1.0, minimum-scale = 1.0" />
	<link href="/v_CN_0.108-j/m.css" rel="stylesheet">
	<script src="/v_CN_0.108-j/master.js" charset="utf-8"></script>
	<script src="/v_CN_0.108-j/status.js" charset="utf-8"></script>
  	<script src="/v_CN_0.108-j/engeu.js" charset="utf-8"></script> 

This is how my login look likes:

@stefdewilde: Your website looks very, very similar to mine with a few different options (I don’t have Email Reporting options, etc). I don’t think that matters though. Try doing this inside of your HA OS first and see if it works:

sudo apt update
sudo apt install python3-pip
# Then try installing ultrasync
sudo pip3 install git+https://github.com/caronc/ultrasync.git

# You should be able to call `ultrasync` now:
ultrasync -h

Hi Chris,

I’ve been working on getting the NX595E integrated into HA. I’ve found a number of other projects that I have modified/updated to work with my NX595E. I’ve looked at your code and our interfaces are very similar but our hardware (NX595E) are quite different. Would be nice if we could work together to get the Ultrasync Hub and NX595E working in one integration.

I’m no developer but have some basic scripting knowledge. More then happy to share my code to anyone that would like to help.

I had started another topic already

Yeah sorry, it seems this thread bounces back and forth between 595 and your hardware quite a bit Chris. I can confirm my setup is identical (in view source) as what @stefdewilde posted above. Unfortunately Im not clever enough to write the code, but will happily test anything you or Divyesh comes up with.

@dd77: Thanks for reaching out! I’d gladly work with you to make a single integration for sure. :+1: :slightly_smiling_face: Are the interfaces really that different? I can see by the screenshot above, the NX-595E login looks very similar to the UltraSync. I pictured the development team just doing a copy/paste behind the scenes. I mean they even went as far as to re-use the version information in the .css, and .js references; here is what it looks like for me:

I imagine under the hood it would work based on Areas and Zone banks. Zones (Sensors) were the hardest for me to grasp as they were parsed the strangest (like 16 banks, and the first 2 bytes of all 16 matched up with each sensor. Once I grasped that, it was easier to reverse engineer the rest of the code.

Does the NX-595E behave much differently? I would love to see the HTML files; i imagine they must be similar; no?

@bojo: No problem! We’ll get this straightened out; i’d love to be able to make both systems work under this integration if it’s at all possible for sure. I won’t leave you stranded. I just need time since I am operating blindly with the other model; but it seems as though @dd77 arrived like a knight in shining armor!

Ive sent you an email with the page source. I can confirm that --debug-dump does not work due to similar traceback errors mentioned before.

It looks like the interface are very similar.

Ill send you my files for the Comnav NX595E version, there is also a Interlogix NX595E version available with slightly different code to mine.