Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Individual Zone Status #2

Closed
schmittx opened this issue Apr 25, 2017 · 15 comments · Fixed by home-assistant/core#28712
Closed

Individual Zone Status #2

schmittx opened this issue Apr 25, 2017 · 15 comments · Fixed by home-assistant/core#28712
Labels
Feature Request Label for feature requests

Comments

@schmittx
Copy link
Contributor

Not sure if you're still considering expanding functionality of this, but adding the ability to see individual zone status would be huge. It'd allow you to have some feedback when trying to arm the system when a zone is faulted, and it'd also allow the zones to function as various sensors (open/close, motion, etc.) within HASS.

I'm assuming you're referencing this list of calls already?

uchagani pushed a commit to uchagani/total-connect-client that referenced this issue Nov 13, 2017
uchagani pushed a commit to uchagani/total-connect-client that referenced this issue Nov 14, 2017
craigjmidwinter added a commit that referenced this issue Nov 14, 2017
Issue #2: Adding the ability to retrieve zone statuses
@uchagani uchagani added the Feature Request Label for feature requests label May 13, 2019
@uchagani uchagani changed the title [Feature Request] Individual Zone Status Individual Zone Status May 13, 2019
@austinmroczek
Copy link
Collaborator

From testing I've done with my own system, it seems that we can see if a zone is in normal, trouble, tamper or alarmed states, but faulted states are not shown.

However, I just noticed in the IOS app ( More > Settings > Notifications > Sensor Events ) there is a new thing called "Sensor Events" which says it will tell you if a zone is faulted -- if your service plan includes it. I'll have to check with my provider to see how much extra they want each month. I assume this means the faulted state would be provided to total-connect-client as well.

@austinmroczek
Copy link
Collaborator

Another issue would be how we want to present the zones to Home Assistant.

a) We could do a fairly simple text string that says "Zones 1, 4, 7 are alarming" using device_state_attribute(). I just did a PR home-assistant/core#24106 doing something similar to just tell HA if if was triggered by police, fire or carbon monoxide sensors.

b) We could re-write the HA integration and present each TCC zone as an HA sensor. That will take more work, but would be a better long term solution.

@austinmroczek
Copy link
Collaborator

"Sensor Events" now seem to be free, or at least my alarm company is giving me access. This means we can now do something useful with individual zone statuses. I've figured out that now a ZoneStatus of 2 means Faulted/Open for a normal door/window type sensor. I haven't tried anything else yet.

I can help code this up in Home Assistant to show individual zones, but how should we represent a zone?

@uchagani
Copy link
Collaborator

uchagani commented Oct 14, 2019 via email

@austinmroczek
Copy link
Collaborator

TC zones report status as Normal, (now) Fault, Triggered, Tampered, etc. If we just do a HA Binary Sensor, would it be True because of fault (door open) or triggered (burglar), or would there be multiple Binary Sensors for each zone? My system has a few dozen zones, so I don't like the idea of having more than one HA sensor per TC zone.

I think we have to do a normal HA Sensor which can hold a numeric value, then in HA automations we'll have to use the value of the sensor to decide what to do. If someone only wants to know if a zone is triggered or not, they could use a Binary Sensor Template based on the value.

I'd suggest sticking with the TC ZoneStatus result codes to be consistent.

Thoughts?

@uchagani
Copy link
Collaborator

uchagani commented Oct 14, 2019 via email

@schmittx
Copy link
Contributor Author

I'd imagine most users would want to know the fault state as the main value, so in keeping with other integrations (i.e. Wink sensors) I'd suggest exposing binary sensors with Fault status as True/False (with appropriate device class) and then add the Tampered, Triggered, etc. status as attributes to the binary_sensor. The alarm_control_panel entity could also show the Fault, Tampered, Triggered, etc. zones as attributes.

@austinmroczek
Copy link
Collaborator

I have a rough implementation using Sensor, which I started before I saw @schmittx comment above about Binary Sensor. It's pretty easy to switch if we want.

It shows all TC zones as sensors. This includes Button zones (e.g. the Fire button on the panel is zone 96 for me) from my Lynx Touch alarm, and secondary panel in my bedroom. It's a lot of zones.

There is no Zone "type" or other way to determine if a zone is a Perimeter, Motion, Smoke, CO, etc device. I don't see any easy way to programmatically decide what zones to include/exclude, so I'd import them all into HA. You can manually disable the newly created sensors that don't make sense using the HA entity registry.

Right now it pulls the name from my TC setup. I'm thinking of adding a "TC_" or something like that in front of each sensor by default to help distinguish these as coming from TC. Otherwise they'll all be jumbled in with the rest of my sensor.xyz list of names.

I haven't tested the speed of status updates coming from TC. the one case I have is when I saw that the sensor was finally appearing, I walked 10 feet over to my door and opened it, and when I got back to the computer it had updated status. Should be good enough for most applications.

Looking for feedback from others before I finish this up and submit a PR to HA. I'm leaning toward @schmittx recommendation. Any other thoughts?

@schmittx
Copy link
Contributor Author

Glad to hear it, nice work! Regarding the naming convention, I'd recommend something like binary_sensor.<structure_name>_<zone_name>. Other than that, it sounds good enough for an initial release. The device_class can always be set via customize.yaml for now.

@austinmroczek
Copy link
Collaborator

I submitted PR to HA. Looking for folks to try it and give feedback.

To test it, from your HA config directory:
mkdir custom_components/totalconnect
Copy the four files from https://github.com/austinmroczek/home-assistant/tree/dev/homeassistant/components/totalconnect into that directory
Restart HA

@FedgarLurch
Copy link

Hey Austin. Great work on this. It loaded up without any problems at all.
I have been poking at the system, and it seems like I can't actually see any of the "zones/sensors" change states. They all report false, even though I have propped a few doors open and I have one sensor that I know is bad.

I am going to play with it and see what comes up.

@austinmroczek
Copy link
Collaborator

Sorry I didn't note: you need to enable "sensor events" for the zones you want within Total Connect.

For ioS TC 2.0 app, it's More > Settings > Notifications > Sensor Events.

@FedgarLurch
Copy link

Hah, I was actually just looking around in the app at something like that. I don't have iOS and I can't find a comparable setting. I only have email and push notifications under my notifications, nothing for sensor events.

Ill keep looking.

@austinmroczek
Copy link
Collaborator

This is now supported. Support in Home Assistant has been merged into the code base. Hopefully we'll see it in version 0.105.

@codypet
Copy link

codypet commented Feb 29, 2020

So when this updated in 0.106.2 from 0.105.3, I lost my connection to TotalConnect, and get this error.

`Log Details (ERROR)
Logger: homeassistant.setup
First occured: 4:53:00 PM (1 occurences)
Last logged: 4:53:00 PM

Error during setup of component totalconnect
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/setup.py", line 174, in _async_setup_component
component.setup, hass, processed_config # type: ignore
File "/usr/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/totalconnect/init.py", line 37, in setup
client = TotalConnectClient.TotalConnectClient(username, password)
File "/srv/homeassistant/lib/python3.7/site-packages/total_connect_client/TotalConnectClient.py", line 81, in init
self.authenticate()
File "/srv/homeassistant/lib/python3.7/site-packages/total_connect_client/TotalConnectClient.py", line 119, in authenticate
self.populate_details(response)
File "/srv/homeassistant/lib/python3.7/site-packages/total_connect_client/TotalConnectClient.py", line 143, in populate_details
self.get_zone_details(location["LocationID"])
File "/srv/homeassistant/lib/python3.7/site-packages/total_connect_client/TotalConnectClient.py", line 411, in get_zone_details
+ str(result["ResultData"])
Exception: Could not retrieve zone detail data. ResultCode: -120. ResultData: Feature Not Supported`

I opened this issue not realizing it might be related to the zone updates.
https://github.com/home-assistant/home-assistant/issues/32358

My zones show up on the TotalConnect Website so I'm unsure why its not working now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request Label for feature requests
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants