- Platform information:
- Hardware: Zotac ZBOX ID-80
- OS: Ubuntu Server 18.04.03 LTS
- Java Runtime Environment:
openjdk version “1.8.0_242”
OpenJDK Runtime Environment (Zulu 8.44.0.11-CA-linux64) (build 1.8.0_242-b20)
OpenJDK 64-Bit Server VM (Zulu 8.44.0.11-CA-linux64) (build 25.242-b20, mixed mode) - openHAB version: 2.5.0 Release Build
A bit of an introduction, if you’re lazy to read you may want to skip to the actual issue.
I recently bought some smart switches and lights and flashed tasmota on them. I wanted a way to control them all in one place and decided to go with openHAB installed on a Zotac Mini PC that I still had lying around gathering dust (my Raspberry Pi 2 is already used for Pi-hole and would rather keep it free from other projects, and my Pi Zero W that I used for flashing the devices would seem a bit under powered for the job). So I went ahead and put a fresh install of Ubuntu Server on the Zotac, installed openHAB, prepared it all and after reading many tutorials and lots of trial and error I managed to set most of it up by controlling them through MQTT.
First I only used Paper UI, but shortly after moved to just using configuration files that I edit in Visual Studio Code on my Windows 10 computer. I’m using MQTT.fx to monitor MQTT traffic, and controlling my devices through my iPhone with the openHAB app or using the BasicUI panel on my pc.
I already feel quite accomplished seeing how these lights turn on and off at the press of a button on my phone, however there are still some issues I’m facing.
Actual issues
Issue 1
I have two LED Filaments bulbs set up that also have a color temperature and brightness that you can control. I have a switch for each group, to turn on and off all devices in that group. When I turn off the group that has the filament bulb in it, the light will turn off, very shortly turn on and flash bright white and then turn off again. I made a slow motion gif of it for clarification: https://imgur.com/a/bXJ2SbU
When I turn it back on, it will turn on to maximum brightness and color temperature.
Of course this is not the behaviour I want. I want the light to just turn off normally, and when I turn it back on it should go back to the last used brightness and color temperature. Now when looking at my items configuration, I can sort of understand why it does this. Items LED_Groot_1 for the power, LED_Groot_1_CT for the color temperature and LED_Groot_1_Brightness for the brightness all belong to the group gKeuken. So when I switch off everything in that group, it also switches off the brightness and color temperature. A quick fix would be to remove the color temperature and brightness from the gKeuken group, but that would prevent the sliders from showing up under my gKeuken group tab in the BasicUI. I should note that in the things configuration, I used to have retained set to true on the channels but read that that could cause issues so I set it to false.
This is what MQTT.fx shows that is happening when I turn off the group switch (currently the group only has that one light):
- OFF is sent to cmnd/tasmota-LED-Groot/POWER.
- 153 is sent to cmnd/tasmota-LED-Groot/CT (153 being the minimum value for the color temperature).
- 0 is sent to cmnd/tasmota-LED-Groot/dimmer
- stat/tasmota-LED-Groot/RESULT shows {“POWER”:“OFF”}
- stat/tasmota-LED-Groot/POWER shows OFF
- stat/tasmota-LED-Groot/RESULT shows {“POWER”:“ON”,“Dimmer”:100,“Color”:“FF00”,“White”:100,“CT”:153,“Channel”:[100,0]}
- stat/tasmota-LED-Groot/RESULT shows {“POWER”:“OFF”,“Dimmer”:0,“Color”:“0000”,“White”:0,“CT”:153,“Channel”:[0,0]}
I believe something goes wrong too when turning on the lamp, but because it’s “ON” with 0 brightness before turning to full brightness and color temp it doesn’t show when you look at the lamp.
Below are my config files.
Issue 2
The filament lightbulbs have three channels. power, color temperature and brightness all belonging to the group where the light is located. The light LED_Groot_1 is currently the only on in its group, as is LED_Klein_1. When I switch off the group, the switch on my BasicUI flips to red indicating that the group is off. So far so good. BUT, when I go to the group page and turn off the switch only (thus leaving the color temperature and brightness “on”) the light will turn off but on the BasicUI homepage it will show that the group is on. It relates to issue one, but not sure how to fix this properly.
Unrelated issue 3
The bedroom icon for the group gSlaapkamer shows on BasicUI on my pc, but in the iOS app it doesn’t have an icon. My gWoonkamer group which has a custom .svg icon does show on both.
Picture of BasicUI
Config files
- Items configuration:
//Group Switches
Group:Switch:AND(ON,OFF) gVerlichting "Alle verlichting"
Group:Switch:OR(ON,OFF) gWoonkamer "Woonkamer"
Group:Switch:OR(ON,OFF) gKeuken "Keuken"
Group:Switch:OR(ON,OFF) gSlaapkamer "Slaapkamer"
//Woonkamer
Switch Stekker_1 "Stekker 1" <poweroutlet> (gWoonkamer, gVerlichting) {channel="mqtt:topic:e07934a6:Stekker_1:PowerSwitch"}
Switch Stekker_2 "Stekker 2" <poweroutlet> (gWoonkamer, gVerlichting) {channel="mqtt:topic:e07934a6:Stekker_2:PowerSwitch"}
//Keuken
Switch LED_Groot_1 "LED Groot 1" <lightbulb> (gKeuken, gVerlichting) {channel="mqtt:topic:e07934a6:LED_Groot_1:PowerSwitch"}
Dimmer LED_Groot_1_CT "Kleurtemperatuur [%d %%]" <ColorLight> (gKeuken, gVerlichting) {channel="mqtt:topic:e07934a6:LED_Groot_1:ColorTemp"}
Dimmer LED_Groot_1_Brightness "Brightness [%d %%]" <Slider> (gKeuken, gVerlichting) {channel="mqtt:topic:e07934a6:LED_Groot_1:Brightness"}
//Slaapkamer
Switch LED_Klein_1 "LED Klein 1" <lightbulb> (gSlaapkamer, gVerlichting) {channel="mqtt:topic:e07934a6:LED_Klein_1:PowerSwitch"}
Dimmer LED_Klein_1_CT "Kleurtemperatuur [%d %%]" <ColorLight> (gSlaapkamer, gVerlichting) {channel="mqtt:topic:e07934a6:LED_Klein_1:ColorTemp"}
Dimmer LED_Klein_1_Brightness "Brightness [%d %%]" <Slider> (gSlaapkamer, gVerlichting) {channel="mqtt:topic:e07934a6:LED_Klein_1:Brightness"}
//Misc
DateTime Date "[%1$tA, %1$te %1$tB %1$tY]" { channel="ntp:ntp:demo:dateTime" }
DateTime TimeLocal "[%1$tk:%1$tM]" { channel="ntp:ntp:demo:dateTime" }
- Sitemap configuration:
sitemap default label="Thuis"
{
Frame label="Algemeen"
{
Text item=Date label="Datum" icon=calendar
Text item=TimeLocal label="Tijd" icon=time
}
Frame label="Kamers"
{
Group item=gWoonkamer label="Woonkamer" icon="woonkamer"
Group item=gKeuken label="Keuken" icon="kitchen"
Group item=gSlaapkamer label="Slaapkamer" icon="bedroom"
}
Frame label="Verlichting"
{
Switch item=gVerlichting mappings=[OFF="All Off", ON="All On"]
Switch item=gWoonkamer mappings=[OFF="All Off", ON="All On"]
Switch item=gKeuken mappings=[OFF="All Off", ON="All On"]
Switch item=gSlaapkamer mappings=[OFF="All Off", ON="All On"]
}
Frame label="Misc"
{
Text label="Losse onderdelen" icon=settings {
Frame {
Switch item=Stekker_1
Switch item=Stekker_2
Text label= "LED Groot 1" icon=lightbulb
{
Switch item=LED_Groot_1
Slider item=LED_Groot_1_CT
Slider item=LED_Groot_1_Brightness
}
Text label= "LED Klein 1" icon=lightbulb
{
Switch item=LED_Klein_1
Slider item=LED_Klein_1_CT
Slider item=LED_Klein_1_Brightness
}
}
}
}
}
- Things configuration:
Bridge mqtt:broker:e07934a6 [ host="192.168.2.200", secure=false, username="MyUsername", password="MyPassword"] {
Thing topic Stekker_1 "Stekker 1" {
Channels:
Type switch : PowerSwitch [
stateTopic="stat/tasmota-stekker1/POWER",
commandTopic="cmnd/tasmota-stekker1/POWER",
on="ON",
off="OFF",
retained=false
]
}
Thing topic Stekker_2 "Stekker 2"{
Channels:
Type switch : PowerSwitch [
stateTopic="stat/tasmota-stekker2/POWER",
commandTopic="cmnd/tasmota-stekker2/POWER",
on="ON",
off="OFF",
retained=false
]
}
Thing topic LED_Groot_1 "LED Groot 1" {
Channels:
Type switch : PowerSwitch [
stateTopic="stat/tasmota-LED-Groot/POWER",
commandTopic="cmnd/tasmota-LED-Groot/POWER",
on="ON",
off="OFF",
retained=false
]
Type dimmer : ColorTemp [
stateTopic="stat/tasmota-LED-Groot/CT",
commandTopic="cmnd/tasmota-LED-Groot/CT",
on="ON",
off="OFF",
min=153,
max=500,
retained=false
]
Type dimmer : Brightness [
stateTopic="stat/tasmota-LED-Groot/dimmer",
commandTopic="cmnd/tasmota-LED-Groot/dimmer",
on="ON",
off="OFF",
min=0,
max=100,
retained=false
]
}
Thing topic LED_Klein_1 "LED Klein 1" {
Channels:
Type switch : PowerSwitch [
stateTopic="stat/LED-klein-1/POWER",
commandTopic="cmnd/LED-klein-1/POWER",
on="ON",
off="OFF",
retained=false
]
Type dimmer : ColorTemp [
stateTopic="stat/LED-klein-1/CT",
commandTopic="cmnd/LED-klein-1/CT",
on="ON",
off="OFF",
min=153,
max=500,
retained=false
]
Type dimmer : Brightness [
stateTopic="stat/LED-klein-1/dimmer",
commandTopic="cmnd/LED-klein-1/dimmer",
on="ON",
off="OFF",
min=0,
max=100,
retained=false
]
}
}
ntp:ntp:demo [ hostname="nl.pool.ntp.org", refreshInterval=60, refreshNtp=30 ]