Skip to content

Add a Zoneminder availability sensor#20184

Merged
balloob merged 4 commits intohome-assistant:devfrom
rohankapoorcom:zoneminder-availability-sensor
Jan 17, 2019
Merged

Add a Zoneminder availability sensor#20184
balloob merged 4 commits intohome-assistant:devfrom
rohankapoorcom:zoneminder-availability-sensor

Conversation

@rohankapoorcom
Copy link
Copy Markdown
Member

@rohankapoorcom rohankapoorcom commented Jan 17, 2019

Description:

In #18946, I hooked up the existing ZoneMinder entities with the availability of ZoneMinder. It would be useful to have this information available to automations. The simplest approach appears to be creating a new binary sensor platform.

This should be rebased and then merged after #20182.

Pull request in home-assistant.io with documentation (if applicable): home-assistant/home-assistant.io#8206

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • New dependencies have been added to the REQUIREMENTS variable (example).
  • New dependencies are only imported inside functions that use them (example).
  • New or updated dependencies have been added to requirements_all.txt by running script/gen_requirements_all.py.
  • New files were added to .coveragerc.

If the code does not interact with devices:

  • Tests have been added to verify that the new code works.

@balloob
Copy link
Copy Markdown
Member

balloob commented Jan 17, 2019

I'm not sure if I understand the purpose. Wouldn't users be able to just track the state of any Zoneminder entity and just check if it became unavailable?

@rohankapoorcom
Copy link
Copy Markdown
Member Author

I'm not sure if I understand the purpose. Wouldn't users be able to just track the state of any Zoneminder entity and just check if it became unavailable?

Yes (kind of), but this feels a little brittle to me. In my case I'm connected to a couple of different of ZoneMinder instances (one over a site to site vpn) and want to bounce the VPN if multiple things I'm connected to aren't connecting properly. It makes for a simpler automation for there to just be a binary sensor per ZoneMinder host, rather than looking through the camera entities and picking one from there. It could also be problematic if you moved cameras from one host to another and that was the camera you were using to track host availability.

Additionally, the cameras, switches and sensors are tracking the availability of the ZoneMinder monitor (the camera), this is tracking the availability of the ZoneMinder system. There's a bunch of situations where a single monitor could go offline but the ZoneMinder system is still connected.

Copy link
Copy Markdown
Member

@balloob balloob left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds like a good use case.

@balloob balloob merged commit 5232df3 into home-assistant:dev Jan 17, 2019
@ghost ghost removed the in progress label Jan 17, 2019
@rohankapoorcom rohankapoorcom deleted the zoneminder-availability-sensor branch January 17, 2019 19:08
@rohankapoorcom
Copy link
Copy Markdown
Member Author

I'll update docs for this platform tonight.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants