UPB lighting

As reference:

More code reference.

Just joined to say I would be interested in this as well.

2 Likes

I was digging around who wrote the UPB interface for pytomation and I think it was the guy below. I think he also wrote the UPB interface for OpenHAB. Now how do we convince him to write it for home-assistant?

UPB master mind : https://github.com/cvanorman

If you’re interested add a Super Vote to get this higher up the list!

1 Like

Its a hack but it partially works. (one way communication)

+1 for UPB support

Maybe we can figure out a way to get a bounty together to get this done.

+1 for UPB Support. Thanks

I’m going to mention everyone that has hinted an interest in UPB…
@rismoney @llothos @eric24 @briodo @GraysonPeddie @jeremyowens @elcano @dramamoose @jasv

There have been people with interest in UPB since May of 2015 and here we are, over two years later and nothing in sight. This is basically an attempt to restart a conversation about getting this moving :slight_smile:.

What do you guys think about getting our money together and hiring someone? Either we pay them in money or UPB hardware or a combination of the two.

I’m not sure the best way to organize the payment. Maybe gofundme.com? Maybe the honor system?

As for finding a developer. Maybe we can advertise on discord. Or maybe someone will chime in here?

If you’re interested, speak up with how you can contribute or other constructive thoughts are welcome!

I am definitely on board for payment to someone to do the work. Not sure what I have to offer, I might have some simply automated switches, a couple of omnistats I’m not using. But if cash is desired that’s fine and easier overall to deal with than shipping random parts. Not sure what it will take.

In the time I’ve spent trying to understand how to approach this project (which admittedly has only been several hours), I have not yet gotten a clear idea of exactly how to do it. I’m sure I could, given the time, but there aren’t enough hours in the day. That said, I’d be very interested in working with someone that has direct experience with doing this for HA, and paying them for their time. I would think the ideal person is someone that’s already on this forum, so if that person is out there, make an offer for the project or for an hourly rate, and let’s make it happen!

To be clear, what I want is a “native” solution, not one that uses shell scripts to execute UPB commands via some third-party command line tool. It should also be bidirectional, for lighting and switch control to the UPB devices and feedback so that changes to UPB devices can update HA and trigger events. This functionality is similar to Z-Wave, although UPB should be much simpler to implement (among other things, there is less variety in UPB devices). I’ve done significant research on that front, so I can certainly contribute to the project.

The alternative would be a guide on how to do this. I’ve read everything I could find about adding a platform (which is what I think we’re talking about here) to HA, but I still feel like there are too many gaps in that information for me to formulate a design approach. I know it can be done, but again, I have limited time to devote to this.

Well, sounds like we need someone more technical and knowledgeable with python/hass to push this along. I suggest you guys help try recruit someone :wink:

I posted to Discord and a project recruiting website but haven’t gotten anywhere yet.

In case a developer is wondering what UPB is…

It’s “mostly” used for lighting control. This is acheived by a network that runs over the power wires in a house. The physical devices it consists of are “usually” wall switches, light modules (a box with a plug and outlet on it to control a lamp or appliance). The bridge between the computer and power line is a box (aka PIM) with a plug and serial port. The serial port connects to your computer.

The serial port spits out what is happening on the UPB network and also will take commands to control devices (switches and lamp modules). Each device has an ID and a on/off or light level value.

That’s the quick explanation. It can get more involved with groupings, links, and virtual devices, but if those basic things were integrated and working, I bet someone would pick up and expand on it.

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.

1 Like

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.

1 Like

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.