Somewhat hackey solution but it works. More info here. I’ll probably just update the dev thread in the future if there is anything more to say.
I’m very interested in UPB support. I have a ton of old device that I’m not using, but now that I’m getting into Hassio, I would like to incorporate into my system. I’m not a strong developer, but I’m just starting to read through the docs and api’s to see if I can figure things out. Big mountain to climb for me.
Try out what I have so far and see where you end up. I’m working on a solution to read from the lights and get the data into hass but it’s been tough. Programming in the bowels of hass is much more than basic scripting.
I know we still don’t have a great implementation of UPB but I did update mine to add flash/blink support. As a reminder, I have it working two-way, but it requires another daemon I can PM you. It’s super-hackish (coding wise) but actually works very well.
https://github.com/bbrendon/hass/tree/master/custom_components
I’m looking into building a UPB system for use with home-assistant using pyserial-asyncio, the protocol seems to be fairly straight forward although probably somewhat time consuming to implement. The pytomation and openhab modules seem to provide a good protocol implementation reference as well. I’ll probably order some sample hardware to test with soon but if someone has a UPB system I can test against remotely that would probably speed things up. I’m a fairly experienced python developer and have written a number of serial protocol modules in python for other projects, I’ve currently written one native home-assistant module so far for a relay controller which uses a serial over tcp protocol.
I have several UPB dimmers (mostly Simply Automated US11-40 and a few US2-40) … but I’m not comfortable providing someone with remote access to my home automation system. However, I would be willing to test whatever you have to offer.
I currently use another home automation software (Premise) to interface with UPB lighting. Premise’s UPB driver is excellent. I have the source code (bajillion lines of C++) but a great deal of it involves managing the interface with Premise so I’m not sure it would be of much use to you. Anyhow, here are a few things the driver can do:
-
Supports automatic discovery of devices. By this I mean it not only detects the device’s presence but also the device’s model. For example, a US2-40 can be outfitted with one of 13 different faceplates which allow it to have from 1 to 4 rocker buttons or up to 8 buttons. Naturally, this impacts how the device is represented in the home automation software.
-
Supports the transmission of links. UPB links are scenes; a single command can activate multiple devices (a very efficient way to turn a large group of devices on/off). Each device can be programmed to respond to the link in the same way or uniquely.
-
Reports all of a device’s properties such as device name, room name, network id, load type (dimmer or switch), LED color, manufacturer, model, firmware version, fade rate, etc.
-
Supports programming UPB devices such as fade-rate, LED color, load type, if it reports its state-changes when manually operated, how many times it transmits a command, etc. To be fair, I don’t use this capability and wouldn’t expect to find it in other drivers. I prefer to use UpStart to program my UPB devices.
Here’s a screenshot of the details provided by Premise’s UPB driver. I think it gives you a rough idea of what all that C++ code under the hood is doing in order to provide a live UI for the device. This is for a US2-40 configured for one rocker switch on its upper half (represented as TopUpper
and BottomUpper
) and four buttons on its lower half (Button1
to Button4
).
For starters, I would be happy with the ability to have a UPB component support sending/receiving UPB commands and links. Automatic discovery of devices would be a bonus.
That would be useful, the more reference source code the better as I like to verify protocol implementation logic against other implementations when writing serial drivers.
OK, I’ll have to find the soft-copy first. I know where the hard-copy version is (dog-eared spiral-bound book of 3000+ lines of code) but that’s a bit awkward to share with you.
I did find this which seems to be a UPB driver for premise(not sure if it’s the same one you have). The code seems to be more complete than any of the other reference code I’ve come across.
That’s the one. Sheesh, I forgot I posted it there! Ten years ago! Time really does fly.
Cool, I went ahead and uploaded it here to make it easier to search/view. Once I get some sample hardware to test against I should be able to start writing a python module for it.
I suggest purchasing one of Simply Automated’s starter kits. It’s more cost-effective than buying the items separately. It includes:
- 2 x US11-40-W single white rocker dimmer/switch
- 1 x US2-40 universal dimmer/switches
- 1 x ZS25O-W rocker+4 oval button face plate installed
- 1 x UMC-DB9-W Serial CIM Interface
- 1 x ZPCI-W Wire-In Phase Coupler
The interface module is available with either an RS-232 serial interface (Serial CIM) or USB interface (USB CIM). I have the serial version and use it with a RS-232 to USB converter.
FWIW, I have a phase coupler and installing it has been on my ‘to-do’ list for years. The Upstart software can tell you the signal strength at the device’s end. So far, I’ve always seen strong signals for all devices in my home even the ones located on the opposite phase from the one the CIM is plugged into. Based on that, I haven’t found a pressing need to install the phase coupler. However, YMMV.
Do you have a store link for that?
I cannot vouch for this supplier because I’ve never done business with them (seem to offer an odd mix of products). However, this is an attractive price for what appears to be the starter kit with the serial CIM (you’ll need a serial-to-USB converter).
If you need a Canadian supplier, I’ve purchased from Aartech.ca and they provide great service. Here’s the starter kit with serial CIM (they also offer the USB version). Prices are, of course, in Canadian currency.
Here’s Simply Automated’s description of the (serial) starter kit:
http://www.simply-automated.com/products/items/DKIT-serial_cim_wire-in.php
PCS also manufactures UPB lighting (I believe they invented it) but I find their products to be more expensive. http://www.pcslighting.com/
Right now I’m trying to decide between going with a UPB system or Insteon system, they both seem to use a powerline type protocol for communications(although insteon seems to also use RF as a backup). Is anyone familiar with the advantages of one over the other?
You won’t have to create a component if you choose Insteon.
I’ve never used Insteon but was automating my home when it was first being introduced into the marketplace (over ten years ago). It had a rocky start and lost some early adopters as a result. You can scour cocoontech.com for old, old posts from unhappy users (circa 2008).
Eventually they stabilized the protocol and some people swear by it … and others at it. The Insteon hub has a reputation for locking up. There’s even a special section in Home Assistant’s docs: Known issues with the Insteon hub. Some Insteon users prefer to use Universal Devices’ ISY994i for improved stability. It’s a spendy little device but it can do more than just communicate with Insteon devices.
Because Insteon includes an RF protocol (in addition to powerline bus) it can offer wireless devices. UPB is strictly powerline bus therefore no wireless devices.
AFAIK, Insteon switches tend to be slightly less expensive than UPB switches. However, I can vouch for UPB’s reliability and the quality of Simply Automated’s light switches.
One neat feature is the ability to reconfigure a UPB device from operating as a dimmer to a switch. It’s done with Upstart (management console) and doesn’t even require touching the physical device. I believe Insteon offers separate dimmers and switches.
Yeah, that’s true, although probably not a major issue for me.
Yeah, it does however seem the RF protocol apparently is completely insecure.
Yeah, that was the main reason I was looking into Insteon.
If someone wants to set up a bounty or send me some hardware that would probably help motivate me to choose a UPB system over Insteon and write a proper module for it.
I’d be willing to chip in some… say $100. I spent a lot of time on this a few years ago. I even hired someone on upwork but they flaked. Eventually I learned enough python to write a workable solution on my own.
I think most developers would probably have trouble writing a proper UPB home-assistant module unless they’ve worked with serial protocols before, doing it properly(ie implementing the serial protocol in native async python) is not something I would expect a novice python developer to be capable of doing in a reasonable amount of time.
There’s also a learning curve when it comes to the home-assistant module interface(it took me quite a few revisions in order to get the first module I wrote cleaned up and merged), the home-assistant maintainers are quite helpful during code review at least. I expect the UPB module will take me longer than that module due to it being a bit more complex than the relay protocol.
It just so happens I’m already familiar with everything needed for the most part since I do embedded Linux firmware development using a lot of async style python to interface with serial devices.
I’m probably going to try and get a bunch of UPB components off of ebay since they seem to be significantly cheaper there.
FYI I’ve ordered a bunch of UPB gear off of ebay, I’m currently traveling but should hopefully be able to get started on this in the next few weeks.