That’s really unfortunate; I have captures from a ComNav device going off and the latest changes appeared to work through all my testing. Reguardless, I pushed all of my latest changes to my GitHub Branch (Master), bumped the version (v0.9.2) and upgraded my HA Integration requirements (so the HA branch is updated too). Can you just try again using all of the latest code + latest integration? If it still doesn’t work, i may need you to do a --dump for me. I realize you don’t want your alarm to go off (audibly), the good news is the --debug-dump has been stripped of a lot of checks making it much much faster (might take 30s or so to run). You SHOULD be able to execute it and still disable your alarm panel right afterwards:
# only proceed if all of the latest code changes don't work
# make sure to restart HA too in order to be sure it all got
# loaded correctly
./ultrasync --debug-dump
./ultrasync --scene disarm
Now on a second topic; here is a the lovelace alarm panel i’m using and it works awesome in case anyone is interested; you’ll need to have the following lovelace resources added (whether manually or through HACS):
I created a HACS integration that might make it easier for people testing here.
If you have HACS installed, you just need to click on it and then click on the 3 little vertical ellipse tool at the top right hand side and choose to add a custom repository.
You can specify an Integration and add the host: https://github.com/caronc/ha-ultrasync
From there you can install the UltraSync tool directly into your instance of Home Assistant without all of they hacky options identified above.
Another thing i personally tend to do is go into the UltraSync integration (after it’s been added) and i change the timer to be 1 second. This makes the refresh and status update of the alarm really slick (much more responsive) when sensors get tripped, etc.
I had to restart twice; i’m not sure why. It seems that after adding the repository, the Install action doesn’t work (even though it says it does). After i re-started though, i was able to try the Install again and the files got placed in /path/to/config/custom_components/ultrasync.
I restarted a second time so that it could find the new python files (since HA was already loaded).
I have installed your plugin through HACS and it works great to arm/disarm the system! Thanks a lot for that.
Do you plan on adding the sensors status and/or the sensors as devices in HA so we could use them for automation like when a sensor is triggered, do something?
I did ask on Discord and was pointed to this section of code which is still a bit over my head at the moment . It’s implementation requires people to explicitly identify a white/black list for the entries while it scans over them all. I don’t think we’d need to go there yet. We should be able to use the ultrasync.zones dictionary variable that’s already being updated live with our live sensor data. If you follow the link though, it’s quite mind boggling…
If you or anyone knows what’s going on here, feel free to do a pull request. I’ll hopefully take another peek at it this weekend and see if i can figure it out. I too would love to use the variables. I imagine it would be something like sensor.ultrasync_zone10. They would be a sensor and not a binary_sensor just because they carry possible states like Bypass and Low Battery, etc too. I don’t think it would be good to use the sensor names (sensor.front_door); we can change the friendly name of them in Home Assistant anyway. Using zone numbers would eliminate any possible ambiguity caused by 2 (or more) sensors that could potentially have the same name (worst case). Thoughts?
I haven’t program for HA yet so yes that is a little confusing for me too. I’m also not fluent with python so I haven’t went through your code for now to see what has been done.
My first thought would have been to go through the zones using the ultrasync.zones dictionary has you mentionned. Also use the generic name and not custom sensor name like you say would be a better idea.
I would need to do a lot more reading to help you more for now because I just came back to Home Assistant after a long time.
Newer Hills ComNav devices can have like 128 of them; older can only have 16 or so. I think my Informix model can have 24 (not sure). But the point is no one will want to see 128 fixed sensors. I think we’d want to just see the detected/activated ones. Again, I don’t know how to do this (not yet anyway).
Then with respect to this question:
My thoughts are… that would be ‘A LOT’ of empty unused sensors as we’d need to initialize 128 of them which might be overkill. But this is definitely a solution for sure.
In my opinion, the zone sensors need to be a bit more dynamic (just use the ultrasync.zones dictionary as discussed; it’s already filtered). The issue is: at the start of the async_setup_entry() function, we haven’t gotten the zone information available to us yet. (the ultrasync.zones dictionary is empty). We need to add the zones dynamicallyafter the first poll to the UltraSync hub. This is where that strange chunk of code comes in I sourced earlier. Apparently within that shows how to add sensors dynamically after (once they are known). The code is confusing because it does a lot more then we need it to as well (sourcing black/white lists and dynamically adding and destroying sensors on the fly), where we just want to add the sensors we fetch (once) and keep them updated.
Just to let you all know I’ve made some progress with having all zone and area sensors get dynamically generated on the fly here.
It’s really cool when it works.… but there is some strange timing issue that prevents it from working all the time… and that’s what I’m still trying to figure out.
It dynamically loads just the Area’s detected (for most of us, this is only 1 area), but it no longer generates the extras
It dynamically creates a zone for every detected zone found too. As discussed in an earlier thread, i did not use the assigned names from the panel though. I just used Zone1State, Zone15State, etc. It’s consistent with the Area entries.
Hopefully I’ll figure it out an will merge it for you all to test. If there are any devs in this thread who can see what I’m doing wrong, I’d absolutely love some help here.
Zones and Areas sensors are now dynamically generated in the latest HACS update.
I also recently got my other PR’s merged so I believe this UltraSync implementation is now part of the default HACS install; so no need to add the repository manually as identified in an earlier thread here.
This latest update includes all of the dynamic sensor generation as stated in my previous comment and I’ve also added attributes to the sensors too using the there details from the hub. I figured it might be easier for everyone to match up what zone sensor goes where. You can rename their friendly name if you need to from within HA.
I have not pushed these over to the core PR I’ve also already still got open. I’ll be interested in everyone’s feedback!
Hi!
That is good progress!! It works very well on my side!
Now that there are sensors, do you have any ideas how to add them to HomeKit using HomeKit Bridge?
All my other devices are added correctly.
Can it be because you do not create a “Device” with all the entities linked to it? I think that if there is no device grouping them it can’t be added to HomeKit.
Do you think it would be easy to create such a device?
I honestly do not know much about HomeKit at all. I’m not sure what is involved in creating a device. It looks exclusive to Apple (I don’t actually own anything Apple myself)? Based on a few Google searches, you may need to reverse engineer some of the Python code I wrote so that it works with the Apple framework? I don’t think i’ll be able to help you here
I don’t think there is something special to do at all. It is all handled with the HomeKit Bridge integration but to be able to be detected as a device it needs to be added to Home Assistant as a device (which contains entities).
In other words, if you check your devices list in HA (config/devices/dashboard), Ultrasync should appear there.
Most of my other integrations have 1 device + X entities and this way it can be added as a HomeKit device. Ultrasync only as entities and no device.
EDIT: maybe I’m wrong and I’m understanding all of this wrong
My guess is that we are using sensor for the zones but it would not work because it is not one of : TemperatureSensor, HumiditySensor, AirQualitySensor, CarbonMonoxideSensor, CarbonDioxideSensor or LightSensor.
I think it would be directly working if it was binary_sensor instead. But as you mentionned before, you can’t really use them as binary_sensors
Yeah, i’m not sure how easy it is to integrate there.
The alarm_control_panel might be possible, but it seems to be more geared towards systems that only have a digital screen interface (keypad). Where with the UltraSync this is all bypassed because you log in to the device itself through it’s web interface (there is no numeric/integration per say).
But i suppose it would be possible to have the numbers just not do anything, but have the Arm/Disarm buttons trigger what you can already do? This might be a bit of overkill for very little reward though, It also won’t solve your sensor issue