Connected mousetrap

Bothered by mice living in our attic, we have set up simple mousetraps and caught multiple mice every winter. This has spawned two problems based on mousetraps not being checked systematically or frequently:

  1. In some cases a mouse has been caught and left for weeks or even months unnoticed. This is a quite undesired discovery when finally checking.
  2. In other cases a mouse has successfully eaten the bait without having been caught. This has (also) left the mousetrap out of function for longer periods.

To accommodate both problems and optimize the “mousetrap operational uptime” I wanted/needed a connected mousetrap. I researched online, but was not able to find any attractive solutions. After complaining about this at a Christmas party, a friend of mine, Thomas Jørgensen, came to the rescue with a custom-made hardware solution.

Hardware and configuration

It is based on a microcontroller connected to a HAT on a Raspberry Pi Zero WH which acts as a gateway for this custom long-range RF communication:

The sensor will register any movement. So I just let it touch my old-fashioned mousetrap, and when the trap is moving, the sensor will be triggered and send a small packet to the Raspberry Pi Zero WH.

The Pi will listen to serial communication with a small Python script and receive a small JSON payload from the microcontroller:

	"sensortype": "mousetrap",
	"messageid": "10",
	"guid": "0x00000001",
	"seq": "27",
	"status": "0x01",
	"mousecount": "134",
	"batteryvoltage": "304",
	"temperature": "20",
	"rssi": "-57",
	"snr": "11",
	"freq": "868900",
	"freq_error": "-1246",
	"sf": "10",
	"bw": "125"

The script will parse this and use MQTT to inform openHAB about any state changes for mousetrap triggered, temperature and battery voltage (converted to approximate level in percent). Every seven hours a payload will be sent even if sensor wasn’t triggered. This is quite battery-optimized and also makes it possible to monitor if it’s operating correctly, temperature and remaining battery life.


Rules implemented in openHAB makes sure I get notifications when:

  • The mousetrap has been triggered (on cellphone and TV).
    • On cellphone a picture will be included (from a Hikvision surveillance camera).
  • It has been more than sevens hours since last payload was received.
  • When payload has been received again after previously missing.
  • When battery is low.

A notification could look like this:

Power consumption

The Raspberry Pi Zero WH with HAT uses ~0.6 W in this configuration. It’s connected through Wi-Fi, not Ethernet.


I started using this setup in October 2020. Since then caught 3-4 mice and quickly reloaded traps at least as many times without a successful hit. The last part is important as this increases the chance of actually catching the small rodents when traps are always operational and loaded with bait.

LK Fuga Wiser Wireless Dimmer hands-on

Lauritz Knudsen by Schneider Electric just released a range of new ZigBee-based products for the Danish market, and today I got my hands on the LK Fuga Wiser Wireless Dimmer:

LK Fuga Wiser Wireless Dimmer as shown everywhere.

This dimmer is ZigBee-certified and should work with any ZigBee-gateway (like Philips Hue or IKEA Trådfri) as well as their own Wiser Gateway, which was also introduced in Denmark this week. And which, by the way, seems to be replaced soon by this Wiser Basic Hub.

My expectation is that this dimmer should identify itself as a dimmable light and work the same way as a Sunricher dimmer or any Philips Hue, IKEA Trådfri, Osram Smart+ or other dimmable ZigBee bulb. In other words, I would not expect any problems adding this dimmer to my Philips Hue bridge. So let’s see if my expectations will be fulfilled…

Experimental set-up

Pairing the device with Philips Hue bridge was painless. After three fast clicks on upper left button, it was found by the bridge as a dimmable bulb. Perfect. Now tried to control the connected LED bulb through the Philips Hue app and experienced some weird behavior: Light cannot be switched off! It can be switched on and dimmed up and down without much delay, but it can’t be switched off. When using the buttons on the dimmer to control the light, there is some delay until reflected in Philips Hue, but this is somewhat expected. Within a minute it will be there.


Now decided to investigate this switching off issue a bit more, so added the dimmer to openHAB through the Hue API to monitor exact values with timestamps etc. and try to control it with specific values. It turns out that using openHAB I was able to switch it off by simply setting brightness to 0 like any dimmable light.

So without openHAB, I thought, will I be able to somehow switch it off from within Hue itself? I configured one of my Friends of Hue switches to control the dimmer, and without any problems was able to turn it on as well as off.

Last, I tried configuring a Philips Hue motion sensor for controlling the room where I added the dimmer. This doesn’t work either. Just before it’s about to switch it off, Hue dims a tiny bit as a warning. This part works, but it stays like that and doesn’t switch off.

So it seems that the problem is a very specific compatibility issue with the Philips Hue app and accessories – perhaps some slight difference in the way it turns off lights and dims to 0%. I have ruled out my bridge/configuration since the same problem has been reported by others. LK Dimmer FW version: 001.002.021.R.

Digging deeper

In openHAB the dimmer is represented by a single item, Brightness. However, this kind of item can be used as a dimmer/slider as well as a switch. So in a sitemap I tried to create both types to be able to compare the difference, since dimming to 0% actually works. Here is the result:

Switch it on:

2021-03-07 15:37:26.109 [INFO ] [openhab.event.ItemCommandEvent ] – Item ‘Wiser_Brightness’ received command ON
2021-03-07 15:37:26.129 [INFO ] [penhab.event.ItemStatePredictedEvent] – Item ‘Wiser_Brightness’ predicted to become ON
2021-03-07 15:37:26.136 [INFO ] [openhab.event.ItemStateChangedEvent ] – Item ‘Wiser_Brightness’ changed from 0.0 to 100

Swith it off – this didn’t work:

2021-03-07 15:37:35.408 [INFO ] [openhab.event.ItemCommandEvent ] – Item ‘Wiser_Brightness’ received command OFF
2021-03-07 15:37:35.427 [INFO ] [penhab.event.ItemStatePredictedEvent] – Item ‘Wiser_Brightness’ predicted to become OFF
2021-03-07 15:37:35.434 [INFO ] [openhab.event.ItemStateChangedEvent ] – Item ‘Wiser_Brightness’ changed from 100 to 0

Dim it to 0%, effectively switching it off (this worked):

2021-03-07 15:37:43.178 [INFO ] [openhab.event.ItemCommandEvent ] – Item ‘Wiser_Brightness’ received command 0.0
2021-03-07 15:37:43.194 [INFO ] [penhab.event.ItemStatePredictedEvent] – Item ‘Wiser_Brightness’ predicted to become 0.0
2021-03-07 15:37:43.217 [INFO ] [openhab.event.ItemStateChangedEvent ] – Item ‘Wiser_Brightness’ changed from 100 to 0.0

Did you notice the difference? When setting brightness to “0”, nothing happened. When setting it to “0.0” it works. This should give some indication of the type of bug/incompatibility. Until Lauritz Knudsen hopefully fixes this issue, this can be used as temporary work-around in openHAB:

rule "Wiser work-around"
    Item Wiser_Brightness changed to 0

This will detect all attempts to switch off the dimmer, also attempts made by accessories like a motion sensor.

Update, March 16th 2021: Although the description above might give some indication about the problem, it’s still only that – an indication. Today I decided to investigate a little deeper to be able to understand the problem without distraction from openHAB. So I created a Hue Developer account to access the Hue documentation and tested directly using the Hue API. Here’s my new finding – this doesn’t work:

URL: /api/<username>/lights/<id>/state
Method: PUT
Body: {"on":false}

But with this body, it works:

{"on":false, "transitiontime":0}

It seems to work with any transitiontime value. As documented:

The duration of the transition from the light’s current state to the new state. This is given as a multiple of 100ms and defaults to 4 (400ms). For example, setting transitiontime:10 will make the transition last 1 second.

To be very specific: It turns off almost immediately with 0, and in 400 ms with the value 4. This is supposed to be the default value, but without it, it doesn’t work. So the Hue app most likely doesn’t include transition time when using the on/off switch, and the same seems to be the case for openHAB. I believe I found the explanation in the binding source code:

           case CHANNEL_BRIGHTNESS:
                if (command instanceof PercentType) {
                    newState = LightStateConverter.toBrightnessLightState((PercentType) command);
                } else if (command instanceof OnOffType) {
                    newState = LightStateConverter.toOnOffLightState((OnOffType) command);
                } else if (command instanceof IncreaseDecreaseType) {
                    newState = convertBrightnessChangeToStateUpdate((IncreaseDecreaseType) command, group);
                    if (newState != null) {

So when brightness is set from a switch (OnOffType), the transitionTime attribute is not set, thus it will not work.

With this knowledge work-arounds are possible, although no generic work-around that would fix all integrations. For example for a Hue motion sensor, transitiontime can be added through the Rules API (this has been tested and works):

URL: /api/<username>/rules
Method: POST
     "name": "Wiser motion sensor work-around",
     "conditions": [
             "address": "/sensors/1/state/presence",
             "operator": "eq",
             "value": "false"
     "actions": [
             "address": "/lights/1/state",
             "method": "PUT",
             "body": {
                 "on": false,
                 "transitiontime": 0

Power consumption

No post without some mentioning of power consumption. Measured switched off over 24 hours with SparOmeter it used 0.009 kWh, so just below 0.4 W in average. This is exactly as specified in the manual with 0.4 W as max. power consumption. Sunricher dimmer box in comparison uses 0.015.kWh in 24 hours, i.e. roughly 0.6 W.

Dimming characteristics

This is probably a difficult topic with a lot of compatibility concerns, but it’s important to know how well this dimmer can actually dim. I don’t have the equipment or knowledge to measure this. I used an IKEA 1000 Lumen LED bulb for testing, and it went from ~15 W to 3.4 W when fully dimmed. In comparison, a Sunricher dimmer was able to dim below 1 W. The bulb used in my test can only be dimmed to ~2.6 W, after that it starts flickering and eventually it will turn off. However, to be able to dim this much, the minimum level should be configurable. This does not seem to be the case with this LK Dimmer, at least not by using the buttons (when not using their own Wiser gateway).

For the same bulb the LK Touch LED 180 IR will dim this bulb to 4.0 W, so here Wiser is a slight improvement.


This dimmer is the most expensive dimmer I have ever seen. LK LED Touch is cheap in comparison, so is IHC Wireless in general. I really hope prices will drop sooner than later in order to sell more. I bought one after waiting for a product like this for years, but won’t be buying more until prices will drop. The same goes for the double relay switch. At the time of writing, the cheapest I have been able to find has a price tag of 899,- DKK.


Unfortunately, and this is also the reason for the price tag, almost no competition exists. This is only because of the small Danish market for LK Fuga design. Currently, this is the best solution on the market for LK Fuga, if:

  • You don’t have anywhere to put a Sunricher (or similar) dimmer.
  • You want to be able to control your light through ZigBee and using a wall switch (without the wall switch taking your light offline).
  • You want to be able to control your light always, even when your gateway is down or wireless signal is disturbed.
  • You want to be able to control your light without any concern about batteries running low.
  • Until switching off bug is fixed: Replace “ZigBee” by “Wiser app”.


I have wanted this product for years. Now that it’s here, I wish it would work better with Philips Hue, and I wish I could use it everywhere in my house. Unfortunately I can’t/won’t because of the price tag. Summary:

  • Price: Too high.
  • Software: Too buggy (switching off doesn’t work).
  • Dimming: Can’t dim as much as some other dimmers on the market, and minimum level can’t be configured.

If LK would fix the problem of not being able to turn off the dimmer without supplying transition time, this would actually be a pretty decent product. Pricey, but decent, and I would instantly install this dimmer in my family room for controlling our PH5 lamps.

Velux Active KIX 300 integration

It’s been a while since my last post, so just a short one this time. I invested in VELUX ACTIVE with NETATMO in 2019 for controlling my skylights. I knew it was a cloud-based solution with all its cons, and even without any API for integration. This obviously sucks, but suddenly ClientID and ClientSecret was published in an openHAB Community thread, so I no longer had the excuse that I didn’t want to spend time reverse engineering the APK for Android. Now it was just a matter of implementing an integration.

Since I didn’t have experience with Python yet, I decided I wanted to try to use that for an implementation. It was my impression that it had everything I needed: HTTPS, JSON and MQTT. And I was right, so after 90 minutes of google-coding, this is my implementation for fetching my data from my sensor switch (CO2, temperature and humidity). Implementation is based on

First script is run to get a token which will be used for authentication. Script will ask for the password for the corresponding Velux account:


import getpass
import requests


# From Android app reverse engineering

# My account

        password = getpass.getpass()
except Exception as error:
        print('Error:', error)

data = {
        'grant_type': 'password',
        'client_id': CLIENT_ID,
        'client_secret': CLIENT_SECRET,
        'username': USERNAME,
        'password': password,
        'user_prefix': 'velux'

response =, data=data)

if response.status_code == 200:
        file = open('token.json', 'w')
        print('Error:', response)

A file ‘token.json’ will be saved in current directory. Next script will refresh the token, so this must be run once per every few hours. I don’t remember exact expiration period, but it’s in the response.


import json
import requests


# From Android app reverse engineering

file = open('token.json', 'r')
body =

token = json.loads(body)

data = {
        'grant_type': 'refresh_token',
        'refresh_token': token['refresh_token'],
        'client_id': CLIENT_ID,
        'client_secret': CLIENT_SECRET

response =, data=data)

if response.status_code == 200:
        file = open('token.json', 'w')
        print('Error:', response)

And finally this last script is run every 5 minutes which seems to be the frequency for new measurements:


import json
import requests
import paho.mqtt.client as mqtt


file = open('token.json', 'r')
body =

token = json.loads(body)

data = {
        'access_token': token['access_token'],
        'home_id': HOME_ID

response =, data=data)

if response.status_code != 200:
        print('Error:', response)

data = json.loads(response.text)
home = data['body']['home']
rooms = home.get('rooms')

if rooms:
        room = rooms[0]
        print('Unexpected response:', response.text)

client = mqtt.Client()

client.publish('velux/hallway/co2', payload=room['co2'], qos=0, retain=False)
client.publish('velux/hallway/humidity', payload=room['humidity'], qos=0, retain=False)
client.publish('velux/hallway/temperature', payload=(room['temperature']/10), qos=0, retain=False)
client.publish('velux/hallway/lux', payload=room['lux'], qos=0, retain=False)

for module in data['body']['home']['modules']:
        if module['type'] == 'NXD': # Departure switch
                client.publish('velux/departure_switch/battery_percent', payload=module['battery_percent'], qos=0, retain=False)
        if module['type'] == 'NXS': # Sensor
                client.publish('velux/sensor1/battery_percent', payload=module['battery_percent'], qos=0, retain=False)

In openHAB I have configured a thing to receive these MQTT updates, so I have them persisted in MySQL, shown in sitemaps, etc.

Homemade Smart Power Strip

This post is not a hardware post, but just a simple way to use a smart plug to replace a conventional smart power strip to avoid unneeded standby power consumption. For my home entertainment system I previously used a conventional smart power strip, but it caused several crashes of my media center, a Raspberry Pi running Kodi. So I decided to replace it with a standard power strip connected to a smart plug, and let openHAB do the magic.

I decided to use a ZigBee smart plug due to low power consumption and since already having a Philips Hue bridge within range. I went with an Innr smart plug, since the Philips Hue smart plug hadn’t been introduced at the time.

As trigger for turning power on or off, I went with my Harmony Hub. This way I can also turn off the network switch, since the Hub is Wi-Fi connected. When any activity is started, requiring any of the powered off devices, I’ll simply turn on the smart plug. When powering off, I need Kodi to shutdown and wait for this. So here are the rules I ended up with:

rule "TV turn on socket"
    // This is logically correct, but too slow because it's only fired when
    // activity has completed. It's a fallback solution because of a bug in
    // the binding, see below.
    Item HarmonyHub_CurrentActivity changed from "PowerOff" or
    // These channel triggers are fast, but logic is messy because logic
    // cannot be reversed. The correct solution would be to trigger on an item
    // bound to "Activity Starting Trigger" and use same logic as above:
    // Item HarmonyHub_ActivityStartingTrigger changed from "PowerOff"
    Channel "harmonyhub:hub:HarmonyHub:activityStarting" triggered Watch_tv or
    Channel "harmonyhub:hub:HarmonyHub:activityStarting" triggered Listen_to_music or
    Channel "harmonyhub:hub:HarmonyHub:activityStarting" triggered Watch_a_movie or
    Channel "harmonyhub:hub:HarmonyHub:activityStarting" triggered Kodi or
    Channel "harmonyhub:hub:HarmonyHub:activityStarting" triggered Chromecast

rule "TV turn off socket"
    Item HarmonyHub_CurrentActivity changed to "PowerOff"
    var num_of_attempts = 20
    var delay_between_attempts = 5000
    var attempt = 0

    var kodi_initial_online_state = NetworkDeviceKodi_Online.state

    // Waiting for Kodi (might be booting up)
    while (NetworkDeviceKodi_Online.state == OFF && attempt < num_of_attempts)
        attempt = attempt + 1

    if (NetworkDeviceKodi_Online.state == OFF)
        sendPushMessage.apply("Tv turned off", "Kodi is offline. Something wrong?")
    else if (kodi_initial_online_state == OFF)
        // Initial state offline, now online - waiting for services to start"

    if (HarmonyHub_CurrentActivity.state == "PowerOff")
        // Attempting to shut down Kodi
        sendHttpPostRequest('http://pi3:80/jsonrpc', 'application/json', '{"jsonrpc":"2.0","method":"System.Shutdown","id":1}')

        // Waited 30 seconds, checking if activity didn't start again
        if (HarmonyHub_CurrentActivity.state == "PowerOff")
            sendPushMessage.apply("Tv turned off", "Tv turned on again after Kodi was shut down - now offline. Trying to restart.")
        // Shutdown/power off aborted, new activity started.

I might look over-complicated, but I wanted a defensive approach to make sure everything is done to not trigger data corruption when power is taken from the Kodi Pi without proper shutdown. For example, if the Pi is still booting when TV is turned off, it won’t be able to accept a shutdown command yet, so I’m waiting for it to complete booting. Also, in case the TV is turned on again while the Pi is shutting down, I try to boot it again by turning it off and on again.

Lock YouTube

Inspired by my own LockU2 utility and Useless Box, I came up with a simple and stupid, yet effective, openHAB rule to prevent my kids from watching YouTube when they are not allowed to do so. So first requirement was ability to turn this lock on or off – just added a new switch item for this, and added it to a sitemap.

The rule makes use of the LGTV binding as well as HarmonyHub binding. Without any of these, I don’t think it would be possible to pull off.

Here goes:

rule "Lock YouTube"
    Item LGTV_Application changed to "youtube.leanback.v4" or
    Item LGTV_Application changed to ""
    if (Lock_YouTube.state == ON)

rule "Enable Lock YouTube"
    Item Lock_YouTube changed to ON
    if (HarmonyHub_CurrentActivity.state == "Watch TV" &&
        (LGTV_Application.state == "youtube.leanback.v4" || LGTV_Application.state == ""))

This YouTube blocker won’t actually block the YouTube app on the television, but will instead immediately quit the app once it’s launched. If YouType (or YouTube Kids) is already running when activating the lock, it will also quit the app. Update: Changed to use LGTV binding for quitting YouTube – old method commented out.

I almost couldn’t wait for the premiere which was last Saturday morning. I also have a rule in place for generating notifications when the lock has been triggered. After explicitly instructing my son that YouTube was not allowed that morning, only five minutes later I received the first notification that an attempt was made. After that four more identical notifications. Then a final notification that YouTube Kids had also been attempted. Success.

Playing with openHAB binding for Danfoss Air unit

In summer 2019 we had heat recovery ventilation installed in our house: A Danfoss Air A2 unit with a CCM module connected to our existing Danfoss Link CC Controller. The integration here is pretty useless: The Danfoss Link app can’t do anything other than read outdoor temperature and set vacation mode. Even the Link CC is crippled, compared to the Air Dial – for example it’s not possible to read relative humidity, thus completely impossible to check if the system is running as it should.

A few days after installation I added a WeMo Insight integrated with openHAB, so at least I have logged power consumption data since then. Then in November I finally couldn’t resist installing a network cable to the CCM unit as I saw it having an Ethernet port.

I was able to run the Danfoss HRV PC-Tool and finally read some more data like relative humidity. Naturally, next thing on my mind was reverse engineering of the protocol used. I didn’t have to do much research until I found this openHAB Community thread. Reading through the thread ended with the good news that someone already did all the work and even created an openHAB binding.


Installing the alpha version of the binding couldn’t be any easier and it worked out of the box without any problems. I linked almost all channels and started seeing and logging useful information like operating mode, fan speeds, boost, humidity, temperatures and remaining filter life.

Next, I could start adding rules to actively monitor how the system was operating. I started getting notifications on my phone when boost was activated to get a feeling about when that usually happens. I could also start making humidity graphs, which got me suspicious about these measurements. Comparing with my Netatmo data from four different indoor stations in the house, the Air unit’s measurements are consistently 5-10 % higher. This of course impacts how the system operates, as humidity is likely the only parameter used for calculating fan speed in “demand” mode.

Energy savings

Next revelation came when I found that some of the channels were writable, like operating mode, manual fan speed and boost. Now this turned into something really useful!

The one thing even the Danfoss Link app can do is set vacation mode when away from the house. This will set the HPV to manual fan speed level 1 which consumes about 9 W. So I figured that this could be automated and also used on weekdays some time after everyone has left the house. I used existing presence logic for that (from Unifi access point), but also decided to add CO2 level as parameter for safety. During the night our phones will also go to sleep at some point, so some additional logic is needed.

Trying to perform humidity/demand calculations like the unit itself does would be cool, but also somewhat more complicated than what I had in mind to begin with. Also, it would require me to integrate some new humidity sensors as I don’t want to rely on Netatmo for this, since data is only refreshed every 10 minutes and also Internet-dependent and Netatmo service-dependent. In other words, untrustworthy. But as safety mechanism for presence-flaws and not needing fast reaction, CO2 measurements could be used.

Nest smoke alarm

I also have a couple of Nest smoke alarms which are integrated in openHAB as I haven’t migrated to Google. So why not use them and trigger boost if smoke is detected?


So here we go. First, I have a rule that will trigger an Android notification when boost is activated. This includes relative humidity from the Air unit as well as from four different rooms in the house, and includes previous values 20 minutes ago. The rule is too ugly to post, and probably too specific to share anyway, so let’s skip it and go directly to the power-saving rule:

rule "Danfoss control"
    Item Anyone_Home changed to ON or
    Item SkynetStationIndoor_Max_CO2 changed or
    Item HomeLeft30MinutesAgo received command OFF
    var hasChanged = Anyone_Home.changedSince(now.minusMinutes(29))
    if (Anyone_Home.state == OFF
        && !hasChanged
        && (SkynetStationIndoor_Max_CO2.state as Number).intValue < 500
        && DanfossHRV_Main_Mode.state == "DEMAND")
    else if ((Anyone_Home.state == ON || (SkynetStationIndoor_Max_CO2.state as Number).intValue >= 700)
        && DanfossHRV_Main_Mode.state != "DEMAND")

SkynetStationIndoor_Max_CO2 is a group with function “MAX” being linked from my four different Netatmo CO2 items. HomeLeft30Minutes ago is a manually created item based on the Expire Binding:

Switch HomeLeft30MinutesAgo { expire="30m,command=OFF" }

Updated from presence.rules:

rule "Anyone home timer start"
    Item Anyone_Home changed to OFF

rule "Anyone home timer cancel"
    Item Anyone_Home changed to ON

So this first rule will, in a pretty simple way, just switch to lowest step 30 minutes after everyone left the home and CO2 levels are all below 500. This is a conservative way to take control only when assuming no humidity will be generated. Weakest point is that humidity is not considered at all, so for example when drying clothes indoor, rule might trigger anyway.

Next, the smoke alarm rule (still untested):

rule "Danfoss boost on smoke alarm with oven running"
    Item NestProtectFamilyRoom_SmokeAlarmState changed from "OK" or
    Item NestProtectHall_SmokeAlarmState changed from "OK"
    if (Oven_Status.state != "Off")

And last, the filter notification:

rule "Danfoss filter monitoring"
    Item DanfossHRV_Service_RemainingFilterLife changed
    if (DanfossHRV_Service_RemainingFilterLife.state < 10)
        var body = String::format("Remaining filter life: %d %%", (DanfossHRV_Service_RemainingFilterLife.state as Number).intValue)
        // Use some service to push notification, I use Pushbullet.

Of course also added a sitemap section to have some app control, since Danfoss doesn’t provide this (in Danish, but you probably get the idea):

openHAB sitemap

Thanks to pravussum for the binding, which can be found here:

Update: Officially integrated into openHAB 2.5.5!

Problem with openHAB UniFi Binding

After upgrading UniFi Controller to version 5.12.35 last week, the openHAB binding started having problems with the Online channel. Going from OFF to ON is still detected correctly, but not the other way around. I’m still not sure if this is a problem in the binding, the controller or in my configuration. Only thing I know for sure is that after upgrading the controller image in Docker and the access point firmware at the same time, binding stopped detected our phones disconnecting from the access point.

openHAB is version 2.5.1. I have asked in the openHAB forums, but is still waiting for feedback.

In the meantime I’ve created a work-around using rules. Problem is that once client goes offline, it seems to be excluded from the list fetched by the binding, and channel stops receiving updates. For LastSeen it makes sense, but Online should be updated to OFF, when client is no longer listed. So I used LastSeen to mimic this desired logic in my rule:

var Timer timerUniFiJacob = null

rule "UniFi work-around Jacob"
    Item UniFi_OnePlus5_LastSeen changed
    if (Jacob_Home.state == OFF)

    if (timerUniFiJacob === null)
        timerUniFiJacob = createTimer(now.plusSeconds(180), [ |

This rule simply restarts a 3 minute timer on each LastSeen update. When client goes offline, these updates will stop and after three minutes, item Jacob_Home will be set to OFF.

Luxaflex PowerView roller blinds

In 2018 my girlfriend and I decided to invest in new roller blinds for our living room. We needed to cover six windows right next to each other. Luxaflex offered some appealing designs like Duette and Twist. At the time PowerView motorization wasn’t available for Duette, so we settled with Twist. That sums up the introduction and cosmetic part of this review, so let’s move on to the technical part as this is a technical blog. 🙂

Electrical installation

First challenge was the electrical installation, since the blinds are powered by 18 V DC. Had it been 230 V AC (like Somfy), I could have powered them from a nearby ceiling mount, but this requirement had to be planned carefully. I didn’t want to settle with batteries, as I would have to recharge six blinds something like three times per year. I’m pretty sure this would annoy me more than I would appreciate the motorization. Only option for me was to bore holes in the ceiling and supply power from here.

But that triggered next challenge: Where to place the power supplies? It would have to be somewhere reachable and somewhere near 230 V. As preparation I created a new power socket at the attic. However, ultimately I decided to pull 15 meter 2.5 mm² cable over the ceiling to each pair of motors (so motors to the right, left, right, left, right and left) with individual conductors for each motor. All cables end where I have my electrical installation in another part of the house. Official requirement per motor is 1 A/18 V. This is really to be on the safe side and I decided to go a bit lower than that, so settled with a single Mean Well DR-100-15 for supplying all motors instead of two (after performing some tests and measuring the load) – that’s ~5.4 A.

Installation looks like this:

Luxaflex Twist blinds electrical installation. The lose ends are the antennas.

This year we extended our house, and I of course made sure that we would have 2.5 mm² cables with three conductors inside the wall – for each window. This way I’m in full control, and in the future I will be able to easily replace by 230 V motors if needed. The power supply was upgraded to a Mean Well HDR-150-15 which is now supplying all blinds, including three new roller blinds in the extended part of the house (~8 A in total):

Luxaflex blinds electrical installation.

Quick summary: 18 V is troublesome – separate cables needed from all locations to a power supply. 230 V would have been the better choice for easy installation and less cables.

DC connectors

Now next problem. Standard DC 5.5 x 2.1 mm connectors are used. But the motor doesn’t have an internal connector. Instead it has a small piece of cable (~30 cm) with a male connector on it. So keep that in mind, because that connector needs to be hidden somewhere, and it may have to be able to go through bored holes in the ceiling etc. instead of just the cable itself (which would require a smaller hole).

I had to buy as bunch of these female panel mount connectors to be able to fit them and the male connector inside the housing for built-in mounting in the wall:

RF quality

Since PowerView is wireless, we need to look into the RF implementation/performance. The implementation is proprietary, so no integration possible through ZigBee or Z-Wave. Only Hunter Douglas remotes and Hub can be used. The Pebble remote I bought with the six original blinds performs quite poorly. It litterally needs line-of-sight in order to get transmissions through. If I’m behind a corner in the living room (same room) and want to operate all six blinds at the same time, one or two of the last ones won’t get the signal. So performance is similar to IR.

Luckily the Hunter Douglas Hub (Gen 2) has better range. I initially placed it in my server room, not far from the living room, but still two rooms away. Often one random blind would not receive the command, so I had to move the Hub closer. I first moved it into the same room very close to the blinds. That improved the setup significantly, so most times all blinds would react as they should. However, I was told by support that there’s no feedback from the motors, they just receive 3-5 RF impulses and that’s it. So on rare occations, I can still experience one of the blinds not being in the correct position. This year I moved the Hub on the other side of a wall, and range is still acceptable, but not completely reliable. That’s not quite good enough in my opinion for a product in this price range.

Worst part is that communication is one-way. Not only does it hurt reliability, but also synchronization. If the Pebble remotes are used to operate the blinds directly, the Hub will not be informed, and as a result the state is out of sync. This makes it impossible to create home automation rules based on blind state, or at least it will not work in conjunction with the Pebble remotes.

Hardware summary

A small recap before we move on to the fun part – the software:

  • Voltage: 18 V DC – annoying, but not a showstopper for me.
  • DC connectors not integrated – annoying, but I was able to hide them with some effort.
  • RF proprietary protocol – bad.
  • RF range/reliability – bad, and no work-arounds for this.

Software support

Now the fun part and the reason why I went for Hunter Douglas PowerView back in 2018: I knew that it was supported by Logitech Harmony and also by openHAB. Hunter Douglas also made a nice app to configure and control the blinds through the Hub on local network.


The app works pretty decent. It’s not without issues, but overall it does its job. Initially it is used to configure the Hub, i.e. add the blinds, so they can be controlled. It can also be used to create automations like “open blinds 10 minutes before sunset on weekdays”. For most common scenarios, where conditions are not needed, this is sufficient. Automations live on the Hub, so there are no external dependencies. However, if you want blinds to open at sunset or 6:30, whichever comes last, you will have to use home automation like openHAB or interface directly with the API yourself.


The openHAB binding works like a charm. It let’s you control/monitor each blind as well as trigger scenes. That’s really everything you need. Configuration is easy with discovery and easy adding of blinds as things.

Logitech Harmony

This integration worked out of the box. The Hunter Douglas Hub was simply added in the Harmony app and after that it was easy to add scenes to hardware buttons on my Harmony Elite remote control as well as include a scene in my Movie activity. This means that all blinds will close when starting the movie activity, and two buttons on the remote are dedicated to trigger open/close scenes.

Scenes can be configured to include any blinds in any individual positions. The downside of using scenes is that the motors are operating at slow speed when triggered from a scene (as opposed to direct commands). This is probably implemented this way because the motors are noisy, so when using automation, it wouldn’t be very discrete. However, I would have preferred this to be configurable, and also that the motors were less noisy.


Overall I’m pretty happy with my setup and I have come to enjoy the automation part more and more, especially as we now have nine motorized blinds in the house. Automations based on sunrise/sunset offsets are really nice and convenient. Most of the time we don’t manually control the blinds anymore, as the automation already did what was needed when it was needed.

RF (lack of) reliability is probably the worst part (apart from the installation) since there is no way to fix it. I wonder how it compares to Somfy.

Innr Smart Plug vs. Philips Hue Smart Plug

Quick review/comparison of Innr Smart Plug and the new Philips Hue Smart Plug. First impression:

Side-by-side physical comparison

Innr’s plug is considerably smaller, and the Hue plug actually feels clumpsy next to it:

It’s bigger in all dimensions.

Now, let’s compare functionality. Both plugs have a two-color LED showing whether it’s on or off, and both also have a physical button to turn it on or off. Both plugs are easy to integrate with a Philips Hue bridge and offers the same functionality. The Philips Hue plug also supports Bluetooth.

IKEA Trådfri

Let’s quickly throw in an IKEA Trådfri wireless control outlet before we compare power consumption. I collegue of mine brought one:

IKEA Trådfri

It’s even bigger than the Hue version, and also without any physical button. However, at only half the price of the Hue/Innr plugs, it’s definitely worth considering where size and the physical button doesn’t matter.

Power consumption

  • Philips Hue: 0.1 W when off, 0.8 W when on. (0,003/0,019 kWh in 24 hours)
  • Innr: 0.3 W when off, 0.7 W when on. (0,010/0,017 kWh in 24 hours)
  • IKEA: 0.1 W when off, 0.8 W when on. (0,002/0,019 kWh in 24 hours)

The winner is… Innr Smart Plug when physical size matters. Hue uses 0.1 W more than Innr when on, but 0.2 W less when off, so if turned off most of the time, it might be a better choice. The Hue plug also has Bluetooth, so it can be used without a ZigBee bridge.

In Denmark prices are exactly the same.

Modifying Miele@home prepared refrigerator

I bought a new refrigerator, model K 34673 iD, which I wanted to add to my Miele@home system. It was marked as “Prepared” for Miele@home, which I assumed meant that it was simply a matter of adding an XKS module to it. I already bought an XKS 3000 Z (ZigBee) module two years ago at the same time as I placed an order for the previous model, K 34473 iD. That order was unfortunately cancelled, so I ended up with the XKS 3000 Z module and a retrofit kit, XKV 3000 KF.

The new model was prepared for the XKS 3130 W (Wi-Fi) module, but as this is an upgrade that should be backwards compatible, I had hope that XKS 3000 Z would also be forwards compatible. Back to that later. Both modules look exactly like this:

XKS module

The first problem was that I could not find anywhere to connect the XKS 3000 Z module on the back of the refrigerator as documented. I eventually gave up and desperately created a support ticket at Miele Denmark. A technical employee called me back pretty quickly and instructed me how to perform the operation. This is where the retrofit came into the picture. I was told that I needed a special cable, and that he would send it to me. This is the cable I already got:

Product name: XKV 3000 KF
Materialnummer: 9788210
EAN: 4002515415245

And this it the cable that was sent to me:

Materialnummer: 11034080
EAN: 4002516106159

The cables look pretty identical, but I’m not sure they are. It could actually be the case that some models would need one cable type and others would need the other. Otherwise I don’t see why they would change the product number etc., but of course, you never know.

The modification I had to do involved dismounting the display panel on the front of the refrigerator. A screwdriver was needed to remove the covers on each side of the panel, but this I had to do anyway, since I need to change the door hinging. After reading the manual a few times, I succeeded with this without leaving any visible scratches from the front. Next, the display had to be removed. This can be done without any tools, but it requires a lot of force. The cables are long enough so it can be safely pulled out. It was hard to do, especially at the sides, but it worked out:

Front panel dismounted

Next challenge was to connect the cable and get it to work. This is actually very easy, but a simple mistake delayed my project with more than a week, cost me € 80 and a lot of frustrations. Again I was saved by the same Miele employee that called me the week before.The mistake was this:

Main electronics
Wrong slot

The connector fits perfectly into this socket. But this is the wrong place, and it took me a week to figure that out. In the meantime I was struggling with error “FF” – the refrigerator will not function when a module is connected to this socket. The display will just blink and switch between displaying “FF” and “–“. In the meantime I ordered the XKS 3130 W module, because it could be compatibility issues with the old XKS 3000 Z module, and also this old module wasn’t supported.

The module should not be connected to the main electronics, but instead on the side of the display panel:

Correct slot

After correcting this mistake, everything started to work. I tried the XKS 3000 Z module first, and it worked:

Miele@home configured

Note: It might take up to a minute before the Miele@home logo displays. To perform the configuration click the menu button (second rightmost), then click up or down until the symbol is blinking. Now click OK, and “0” is displayed. Click Up so that it changes to “1” and click OK again. Now add the device on the XGW 3000 Z gateway.

Next I tried the XKS 3130 W module for comparison. The configuration is different. In this case you just have to use the Miele@mobile app to add the module to the Wi-Fi network. This worked out pretty easily.

I haven’t been able to spot any differences in terms of functionality between the two modules, so I have decided to mount the refrigerator with the ZigBee module instead of the Wi-Fi one. Since I own the XGW 3000 Z gateway, this way I will not create a dependency to my router/Wi-Fi network, and the ZigBee module will perhaps even help creating a better ZigBee mesh network together with my other ZigBee Miele@home devices. Functionality of both modules – from app and Homebus protocol:

  • Reading of current temperature.
  • Reading of target temperature.
  • Reading of state “door open”.
  • Starting and stopping super cooling.
  • Starting refrigerator when off (only through Homebus, Miele’s app doesn’t support this).

That’s it. You do this kind of project because you can, and for no other reason. I’m not letting people get to me by asking why. It’s simply because I can, and because it’s fun. 🙂 Time for wrapping up, having the new cable nicely put into place:

Top cover unmounted

And put top cover back on again:

Top cover mounted

The new appliance as seen in the Miele@mobile app:

Power consumption

As bonus info, I made some power measurements before integrating the refrigerator. Here are the numbers:

  • Idle without any module installed: 1.0 W
  • Idle with XKS 3000 Z installed: 1.5 W
  • Idle with XKS 3130 W installed: 1.9 W

Twin refrigerator

Fun fact: Miele K 34673 iD seems to be a rebranded version of Liebherr IKBP 2360-20. It would be interesting to try to integrate a Liebherr refrigerator into a Miele@home system. The model number and serial number is identified though, so it might not be possible. Price difference: >300 EUR.