Home Assistant to UPB


Purchased an HAI UPB PIM and connected it to my Home Assistant / HomeSeer mini PC.
Using an RS-232 to USB cable.  
Using this post as a reference ==> hxxps://www.home-assistant.io/integrations/upb/
Doing a copy and paste.
To add UPB to your installation, go to Configuration >> Integrations in the UI, click the button with + sign and from the list of integrations select Universal Powerline Bus (UPB).
The UPB integration requires that an export from the UPStart UPB configuration program. To create an export, in UPStart, click the UPB button in the top left and select Export to File. This will create a file with the .upe extension. The file must be placed somewhere in your Home Assistant installation, for example, in the configuration directory.

Device Configuration
Using UPStart, configure each UPB dimmer-switch to report its state when it is manually operated. If you omit this step, manual changes to a dimmer-switch’s state (on/off/brightness) will not be reported to Home Assistant.

An event is generated whenever a UPB Link is:
goes to a new level
fade is started
fade is stopped
blink is started
The event is upb.scene_changed.
The event_data contains the following:
command: One of activated, blink, deactivated, fade_started, fade_stopped, or goto.
address: The address of the link reporting the event. The address is comprised of the UPB network number and the UPB Link number.
For example for UPB Network number 42 and UPB Link number 24 the address would be 42_24.
brightness_pct: The brightness level as a percentage. brightness_pct is reported as -1 if the brightness is a default level of brightness is not applicable to the link change.
rate: The rate for link to transition to the new level. rate is -1 for the default transition rate.


Besides the standard services provided by the Home Assistant Light and Scene integrations, the following extra services are provided by the UPB integration:
  • upb.light_fade_start
  • upb.light_fade_stop
  • upb.light_blink
  • upb.scene_deactivate
  • upb.scene_goto
  • upb.scene_fade_start
  • upb.scene_fade_stop
  • upb.scene_blink
Both standard and custom services that take a transition or a rate for changing brightness levels take time in seconds. The UPB system only offers a discrete set of transition times. As such, the transition time requested is changed to the closest time based on the table below. Note that this table does not apply to blink rates, only to brightness transition times.
Request rate >= Requested rate < Rate Used
0 seconds 0.4 seconds 0 seconds
0.4 seconds 1.2 seconds 0.8 seconds
1.2 seconds 2.45 seconds 1.6 seconds
2.45 seconds 4.15 seconds 3.3 seconds
4.15 seconds 5.8 seconds 5.0 seconds
5.8 seconds 8.3 seconds 6.6 seconds
8.3 seconds 15 seconds 10 seconds
15 seconds 25 seconds 20 seconds
25 seconds 45 seconds 30 seconds
45 seconds 90 seconds 60 seconds
1.5 minute 3.5 minutes 2 minutes
3.5 minutes 7.5 minutes 5 minutes
7.5 minutes 12.5 minutes 10 minutes
12.5 minutes 22.5 minutes 15 minutes
22.5 minutes 45 minutes 30 minutes
45 minutes ∞ 1 hour


This is a description for installation on my BeeLink BT3 Pro which is running Ubuntu 18.04, Virtual Box W7e, Home Assistant and Homeseer.
1 - Installed Upstart to the W7e 32 bit Virtual Box running on the Ubuntu 18.04 desktop.
2 - Installed Upstart to VB W7e
3 - configured UPB serial port on VB
4 - installed Upstart, did a discovery of all UPB devices and and did export of the upe file
5 - copied the UPE file over to the HA config directory

6 - via ssh did a: docker stop home-assistant
7 - via ssh did a: docker rm home-assistant
8 - via ssh did a:
docker run -d --name="home-assistant" -v /opt/home-assistant/config:/config -v /etc/localtime:/etc/localtime:ro --device /dev/ttyUSB0:/dev/ttyUSB0 --net=host --restart unless-stopped homeassistant/home-assistant
9 - originally did a manual installation of UPB drivers editing the configuration.yaml file with:

url: serial:///dev/ttyUSB0:4800
file_path: ./upb.upe
10 - went to hxxps://github.com/gwww/hass-upb and copied over the /custom_components/upb directory
11 - restarted HA - docker restart home-assistant
12 - all looks well now in logs:

Logs show:

2020-10-26 08:19:01 INFO (MainThread) [homeassistant.setup] Setting up upb
2020-10-26 08:19:01 INFO (MainThread) [homeassistant.setup] Setup of domain upb took 0.0 seconds
2020-10-26 08:19:01 INFO (MainThread) [upb_lib.upb] Connecting to UPB PIM at serial:///dev/ttyUSB0:4800
2020-10-26 08:19:01 DEBUG (MainThread) [upb_lib.proto] connected callback
2020-10-26 08:19:01 INFO (MainThread) [upb_lib.upb] Connected to UPB PIM
2020-10-26 08:19:01 DEBUG (MainThread) [upb_lib.proto] queued write ''
2020-10-26 08:19:01 DEBUG (MainThread) [upb_lib.proto] write_data ''
2020-10-26 08:19:01 DEBUG (MainThread) [upb_lib.upb] Synchronizing status of UPB network...

13 - removed UPB configuration.yaml entries
14 - removed UPB directory /custom_components/upb
15 - added plugin via integrations