Just take your time to make it work.
You are close to greatness haha.
Just take your time to make it work.
You are close to greatness haha.
I created a Pull Request against Home Assistant here. I am currently missing unit tests; I’ll start working on these next. There are some other things i need to review too, but there hopefully shouldn’t be a whole lot of work up ahead. If you use my branch; it all works right now (well for me anyway).
There are 3 services you can use stay
, away
, and disarm
which are working perfectly in Home Assistant now too! I tried to document most of this in the in the PR.
Can’t test it because I don’t have home assistant running in a docker but as a Raspberry Pi OS.
I have been waiting for something like this for a long time to be able to get alarm status info on my hass.io installation through my 595E. If somebody could point me towards the way to install it without docker I would be glad to help with testing.
Hey panos2310,
Have a moment… Chris is doing a good job and if everything goes, we will be adding it as a integration.
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.
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).
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.
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.
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.
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 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