UHPPOTE controller custom component for Home Assistant.
Development status: ALPHA
uhppoted-app-home-assistant is an experimental Home Assistant custom component for the UHPPOTE access controllers, leveraging the uhppoted-python library. It turns out that an access control system has quite a lot more moving parts than e.g. your average thermostat, and the current implementation, although functional and usable, is intended more for the (brave) early adopter.
The current version is most suited to a small'ish home ACS i.e. a couple of controllers with half a dozen
doors and maybe a ten or so access cards - so, not a large mansion or an office building.
Contents
Screenshots
v0.8.9 - 2024-09-06
NOTE: The Alpha release is a first release and is entirely use at your own risk/discretion. It has had very limited testing - you probably won't lock yourself out of your own home (unless of course it's late at night and pouring with rain, in which case it's inevitable) but please do have a backup plan (which may or may not include a fire axe). It is also reasonably likely that future releases may require you to reconfigure your system again i.e. it is for the brave and adventurous who like living on the edge.
The installation below is entirely manual and installs the project as a Home Assistant custom component.
config/custom_components
subdirectory under the Home Assistant folder (if it does not already
exist) and create the __init.py__
file:cd <Home Assistant>
mkdir -p config/custom_components
touch config/custom_components/__init.py__
config/custom_components
folder under
the Home Assistant folder, e.g.:cd <Home Assistant>
cd config/custom_components
tar xvzf uhppoted-app-homeassistant.tar.gz .
(Optionally), add the default configuration to the configuration.yaml
file in the config
folder of
Home Assistant, e.g.:
...
uhppoted:
bind_address: 192.168.1.100
broadcast_address: 192.168.1.255:60000
listen_address: 192.168.1.100:60001
timezone: LOCAL
debug: false
max_cards: 10
preferred_cards:
- 10058400
- 10058401
card_PINs: false
controllers_poll_interval: 30
doors_poll_interval: 30
cards_poll_interval: 30
events_poll_interval: 30
...
Start (or restart) Home Assistant and confirm there are no errors in the logs.
Configure your UHPPOTE controllers:
The suggested installation for the development version installs the cloned project as a symbolic link under the
Home Assistant config/custom_components
folder. Be warned - the development version changes almost daily and
is completely NOT guaranteed to be any kind of stable. You could quite conceivably lock yourself out of your
apartment, your house, the planet or possibly the entire galaxy. At the very least expect to have to reconfigure
your system often. You have been warned :-).
cd ~/experimental-stuff
git clone https://github.com/uhppoted/uhppoted-app-home-assistant
config/custom_components
subdirectory under the Home Assistant folder, if it does not already
exist and create the __init.py__
file:cd <Home Assistant>
mkdir -p config/custom_components
touch config/custom_components/__init.py__
config/custom_components
folder.ln -s ~/experimental-stuff/uhppoted-app-home-assistant/custom_components/uhppoted config/custom_components/uhppoted
(for Windows users: https://superuser.com/questions/1020821/how-can-i-create-a-symbolic-link-on-windows-10)
configuration.yaml
file in the config
folder of
Home Assistant, e.g.:
...
uhppoted:
bind_address: 192.168.1.100
broadcast_address: 192.168.1.255:60000
listen_address: 192.168.1.100:60001
timezone: LOCAL
debug: false
max_cards: 10
preferred_cards:
- 10058400
- 10058401
card_PINs: false
controllers_poll_interval: 30
doors_poll_interval: 30
cards_poll_interval: 30
events_poll_interval: 30
...
uhppoted.controller.{controller}.info
uhppoted.controller.{controller}.datetime
uhppoted.controller.{controller}.event
uhppoted.door.{door}.info
uhppoted.door.{door}.open
uhppoted.door.{door}.lock
uhppoted.door.{door}.button
uhppoted.door.{door}.mode
uhppoted.door.{door}.delay
uhppoted.door.{door}.unlock
uhppoted.door.{door}.open.event
uhppoted.door.{door}.button.event
uhppoted.door.{door}.unlocked.event
uhppoted.card.{card}.info
uhppoted.card.{card}.cardholder
uhppoted.card.{card}.start-date
uhppoted.card.{card}.end-date
uhppoted.card.{card}.{door}
uhppoted.card.{card}.pin
uhppoted.card.{card}.swipe.event
Controllers that are not on the local LAN segment are not discoverable and have to be added manually to the
uhppoted section of the Home Assistant configuration.yaml
file (in the config folder), e.g.:
...
uhppoted:
...
controllers:
-
controller: 504030201
address: 192.168.1.100
-
controller: 605040302
address: 192.168.1.100
port: 60000
protocol: UDP
-
controller: 706050403
address: 192.168.1.100
port: 54321
protocol: TCP
timeout: 0.56
...
The controllers
subsection is a YAML array/list of controllers with the following properties;
controller
: controller serial numberaddress
: controller IPv4 addressport
: (optional) controller UDP port (defaults to 60000)protocol
: (optional) controller transport protocol (UDP or TCP - defaults to UDP)timeout
: (optional) controller timeout (default to the global uhppoted timeout of 2.5s)The controllers listed in configuration.yaml
are included in the list of discovered controllers and
can be configured from the Home Assistant user interface in the same way as local controllers i.e. controllers
listed in configuration.yaml
are NOT automatically added to the list of managed controllers -
they do still need to be configured.
The operational configuration can be customised by the (entirely optional) setttings in the uhppoted section
of the Home Assistant configuration.yaml
file (in the Home Assistant config
folder). The full list of
configurable settings comprises:
Setting | Description | Default value |
---|---|---|
bind_address |
Default IPv4 UDP bind address | 0.0.0.0 |
broadcast_address |
Default IPv4 UDP broadcast address | 255.255.255.255 |
listen_address |
Default IPv4 UDP listen address (for events) | 0.0.0.0 |
timezone |
Default controller timezone | local |
timeout |
Default timeout for controller requests/responses (seconds) | 2.5 |
debug |
Enables/disables logging of controller packets | false |
max_cards |
Max. cards to 'discover' for configuration | 10 |
preferred_cards |
YAML list of of cards that take priority for 'discovery' | - none - |
card_PINs |
Enables/disables retrieving/setting card PINs | false |
controllers_poll_interval |
Interval at which to fetch controller information (seconds) | 30 |
doors_poll_interval |
Interval at which to fetch door information (seconds) | 30 |
cards_poll_interval |
Interval at which to fetch card information (seconds) | 30 |
events_poll_interval |
Interval at which to fetch missed/synthetic events (seconds) | 30 |
controllers |
List of off-LAN controllers (see above) | -none- |
e.g.
uhppoted:
bind_address: 192.168.1.100
broadcast_address: 192.168.1.255:60000
listen_address: 192.168.1.100:60001
debug: false
timezone: CEST
timeout: 1.23
max_cards: 7
preferred_cards:
- 10058400
- 10058401
card_PINs: true
controllers_poll_interval: 29
doors_poll_interval: 31
cards_poll_interval: 33
events_poll_interval: 35
controllers:
-
controller: 504030201
address: 192.168.1.100
port: 54321
-
controller: 605040302
address: 192.168.1.100
port: 54321
-
controller: 706050403
address: 192.168.1.100
port: 54321
protocol: TCP
timeout: 0.56
unlock-door
Unlocks a door by name - the name is case- and space-insensitive.
Example:
service: uhppoted.unlock_door
data:
door: Gryffindor
add-card
Adds a card to all the controllers configured by the uhppoted service. The card is not added to
the list of configured cards - to include the card in the managed cards, open the CONFIGURE
section
for the uhppoted service (under Settings/Devices & Services/uhppoted).
Example:
service: uhppoted.add_card
data:
card: 10058400
delete-card
Delets a card from all the controllers configured by the uhppoted service. The card is not removed
from the list of configured cards - to remove the card from the managed cards, open the CONFIGURE
section
for the uhppoted service (under Settings/Devices & Services/uhppoted).
Example:
service: uhppoted.delete_card
data:
card: 10058400