UPB (Universal Powerline Bus) integration

I’ve been working on getting UPB integration written. I’m looking for advice on the “best” way to model a UPB concept known as Links. A link is a command that is sent out over the powerline and any device that recognizes the link number in the command responds to the link. Respond in the most common case means something such as turn light on to my programmed level at my programmed rate.

For example say I have 10 dimmer switches, each controlling a light and 3 of those switches were programmed to respond to link #42 then when a link #42 command is sent over the powerline, 3 switches would respond to the command and the other 7 switches would ignore the command.

A link has no state, so no way to track is a link is “active”. There are multiple types of commands that can be sent in a link. For example an ACTIVATE command tells the switches to turn on to their programmed dim level. Each switch that is activated can have different programmed dim levels. This is the UPB way of creating a scene. You can also send a DEACTIVATE command to turn off all lights in the scene and GOTO to set all lights in a scene to a specified dim level.

Modelling a Link as a Light is close, but Links don’t have state, which Lights require.

Modelling a Link as a Scene only provides a turn_on service. No way to DEACTIVATE or GOTO, at least by default. Also, a Scene seems similar to a Group the way I read it. (Newbie on this, trying to understand the difference).

Here’s my best guess on what to do. Model a Link as a Scene. Add custom services for DEACTIVATE, GOTO, etc.

Are there better base classes to use? What are your thoughts on using Scene?

2 Likes