- Platform information:
- Hardware: x86/16GB/1TB
- OS: Linux/5.4.0-94-generic (amd64) - Ubuntu 20.04
- Java Runtime Environment: 11.0.13 (Zulu11.52+13-CA)
- openHAB version: 3.2.0, Docker
I was reading a few comments here and it got me thinking about how I’m setting up my model. I was hoping you all could help me clear up what I think may be a conceptual misunderstanding I’m having.
I’ve read that the model should be a physical representation of your house. An equipment, for example, should contain all the points you want to control. The equipment should exist in one place, as one unit. As I understand, it should look something like this:
- Group: Living Room
- Group: Lights
- Group: Overhead Lights
- Equipment: Light bulb 1
- Point:Color
- Point:ColorTemperature
- Equipment: Light bulb 2
- Point:Color
- Point:ColorTemperature
- Equipment: Light bulb 3
- Point:Color
- Point:ColorTemperature
- Equipment: Light bulb 1
- Group: Floor Lamp
- Equipment: Light bulb 1
- Point:Color
- Point:ColorTemperature
- Equipment: Light bulb 2
- Point:Color
- Point:ColorTemperature
- Equipment: Light bulb 1
- Group: Overhead Lights
- Group: Lights
In practice, I’m struggling to do that. It may have something to do with my light bulbs.
For context, I’m using TP-Link KL130 bulbs with only two controllable channels: Color and ColorTemperature. The Color channel seems to double as a dimmer (for the current color or color temperature setting), so sending 0 to Color is off, 100 is full brightness, etc. Sending 150,150,150 or something to that channel would result in a color. ColorTemperature also works on 0-100. The concept to note here is that both channels of each bulb can accept the same command (e.g. 35), but do different things with it–things that shouldn’t happen together.
Most of these lights need to be controlled together. Ceiling light fixtures will have 2 or 3 lights, or a room will have maybe 4 or 5 total that all need to turn on, dim, adjust color temperature, or change color in tandem.
Now, I have that working fine–great actually, but how I got it working is the point of confusion that I think you all have the experience and understanding to tell me if it’s okay or totally off-base.
Because groups share commands down to everything in them, I can’t seem to represent the bulbs in the same piece of equipment. If I have a group “Lights” and an equipment for each light bulb under it, and each bulb has its points corresponding to the bulb’s channels, the commands I send to “Living Room Lights” fit within the parameters of multiple points. If “Lights” is a dimmer, and you send 35 to it, that 35 also goes to the ColorTemperature points, and is valid.
This problem occurs in reverse, too. Because stuff can only have one base member type and one aggregation function, I don’t understand how I’m supposed to have equipment with multiple points reporting different types of data–I lose the ability to see the aggregate status of and control any points not matching the base member type. A group can’t be a dimmer and a color at the same time, even if the lights under it are dimmable and colorable. Moreover if the dimmer and color temperature are all reporting values 0-100, no aggregation function will return an accurate representation of either since they’ll be mixed together.
This seems to break the idea that the model should be a physical representation of the house, at least in my case, if I’m understanding correctly.
My workaround has been setting my groups up like this:
- Group: Living Room
- Group: Lights dimmer (LivingRoomLightsDimmer)
- Group: Overhead Lights (LivingRoomOverheadLightsDimmer)
- Point:Color
- Point:Color
- Point:Color
- Group: Floor Lamp (LivingRoomFloorLampDimmer)
- Point:Color
- Point:Color
- Group: Overhead Lights (LivingRoomOverheadLightsDimmer)
- Group: Lights color temperature (LivingRoomLightsColorTemperature)
- Group: Overhead Lights (LivingRoomOverheadLightsColorTemperature)
- Point:ColorTemperature
- Point:ColorTemperature
- Point:ColorTemperature
- Group: Floor Lamp (LivingRoomFloorLampColorTemperature)
- Point:ColorTemperature
- Point:ColorTemperature
- Group: Overhead Lights (LivingRoomOverheadLightsColorTemperature)
- Group: Lights dimmer (LivingRoomLightsDimmer)
All of those groups are dimmers, except the parent group “Living Room” in this example, which isn’t touched. I’m leaving off how I got color working here since Groups of type Color don’t currently exist in 3.2.0, so that took some spicier misuse.
What this allows me to do, though, is have cards in my UI with multiple sliders on them for whole-room dimming (targeting item LivingRoomDimmer) and color temperature (targeting item LivingRoomLightsColorTemperature), or cards targeting individual lamps (multiple bulbs) for the same.
This doesn’t gel with what I’m reading about how a model should look, though. Could anyone explain how I’m going wrong here, and what the solution may be? I feel like I’m missing something big and obvious.
Thanks!