Rademacher Homepilot (DuoFern) via http-Binding

Hi all,
some more configs I found.

This is the definition for a closing contact switch:

        Type contact : Schaltkontakt "Schaltkontakt" [
        stateExtension="/v4/devices?devtype=Sensor",
        stateTransformation="JSONPATH:$.meters[?(@.did==<myDID>)].readings.contact_state",
        closedValue="closed",
        openValue="open"
        ]

In addition, I improved the Env Sensor a bit:

// -----------------------------------------------
        Type contact : UWS_Balkon_Regen "Umweltsensor Balkon Regensensor"[
        stateExtension="/v4/devices?devtype=Sensor",
        stateTransformation="JSONPATH:$.meters[?(@.did==<myDID>)].readings.rain_detected",
        closedValue="true",
        openValue="false"
        ]
// -----------------------------------------------
        Type contact : UWS_Balkon_Sonne "Umweltsensor Balkon Sonnensensor"[
        stateExtension="/v4/devices?devtype=Sensor",
        stateTransformation="JSONPATH:$.meters[?(@.did==<myDID>)].readings.sun_detected",
        closedValue="true",
        openValue="false"
        ]
// -----------------------------------------------

This transforms the string value for the rain sensor with a closing contact type, making it look nicer in OH :slight_smile:
and I added the sun detected value as well. This, afaik, triggers when the first sun config value of the sun detection in the sensor trips.

This, no big magic, is the definition of a standalone sun sensor (the suction cup type window sensor):

        Type contact : Sonnensensor_Arbeitszimmer "Sonnensensor Arbeitszimmer"[
        stateExtension="/v4/devices?devtype=Sensor",
        stateTransformation="JSONPATH:$.meters[?(@.did==<myDID>)].readings.sun_detected",
        closedValue="true",
        openValue="false"
        ]

More or less the same for a motion sensor:

        Type contact : Bewegung_Flur "Bewegungsstatus Flur"[
        stateExtension="/v4/devices?devtype=Sensor",
        stateTransformation="JSONPATH:$.meters[?(@.did==<myDID>)].readings.movement_detected",
        closedValue="true",
        openValue="false"
        ]

An add-on for - in my case - the motion sensor: timestamping!

        Type number : Bewegung_Flur_Zeitstempel "Bewegungsstatus Flur Zeitstempel"[
        stateExtension="/v4/devices?devtype=Sensor",
        stateTransformation="JSONPATH:$.meters[?(@.did==<myDID>)].timestamp∩JS:RademacherTsToUnix.js"
        ]

and with RademacherToUnix.js as such:

(function(x){
    try{
        return (parseInt(x) * 1000);
    } catch(e) {
        console.error('RademacherTsToUnix.js encountered an error: ' + e);
        return null;
  }
})(input)

as you can see, it’s a UTC timestamp with a resolution of 1 second (not too much, but okay for some compensation routines). I did not (yet) make it a timestamp type but just a number. But this works in a script, you can directly relate it to the values given by Date.now() :smiley:

Yet another new device: the door / window sensor which supports open, closed and tilted:

        Type number : Fensterkontakt "Fensterkontakt "[
        stateExtension="/v4/devices?devtype=Sensor",
        stateTransformation="JSONPATH:$.meters[?(@.did==<myDID>)].readings.contact_state∩JS:DoorWindowToNumber.js"
        ]
        Type number : Fensterkontakt_Batt "Fensterkontakt Batteriestatus"[
        stateExtension="/v4/devices?devtype=Sensor",
        stateTransformation="JSONPATH:$.meters[?(@.did==<myDID>)].batteryStatus"
        ]

with DoorWindowToNumber.js as such:

(function(x){
    try{
        if(x == "closed") {
            return (0);
        }
        if(x == "tilted") {
            return (1);
        }
        if(x == "open") {
            return (2);
        }
        return null;
    } catch(e) {
        console.error('DoorWindowToNumber.js encountered an error: ' + e);
        return null;
    }
})(input)

The DoorWindowToNumber transform makes it a number, as the name says, which for me is nicer to handle and visualize in OH. But it’s no must, you can leave away the transformation and work with the strings as well.
And it has a battery state between 0 and 100 :slight_smile: directly compatible to the battery state visualization of OH.

Last but not least, one thing I tried out and actually found working nicely - Auto / Manu Mode as a switch (read & write). This works for any Rademacher device with Auto / Manu mode the same, just set the DID and that’s it! :smiley:

        Type switch : Heizung_Arbeitszimmer_Auto "Heizung Arbeitszimmer Automatikbetrieb" [
            stateExtension="/v4/devices",
            stateTransformation="JSONPATH:$.devices[?(@.did==<myDID>)].statusesMap.Manuellbetrieb",
            commandTransformation="JS:AutoManuMode.js",
            commandExtension="/devices/<myDID>",
            onValue="0",
            offValue="100"
        ]

and with AutoManuMode.js as such:

(function(x){
  try {
        if (x == "0") {
            return ("{\"name\":\"AUTO_MODE_CFG\", \"value\":\"true\"}");
        }
        return ("{\"name\":\"AUTO_MODE_CFG\", \"value\":\"false\"}");
  } catch(e) {
      console.error('ManuAutoMode.js encountered an error: ' + e);
      return null;
  }
})(input)

Note that the reading of the mode in /v4/devices is Manu Mode which reads “0” for automatic and “100” for manual mode, while the setter command is complementary: Auto Mode and with “true” for automatic and “false” for manual mode. This works, and I verified that both of the values always change together and immediately. :slight_smile:

Please also note that I added some really good news to this older post - it’s possible to extract HomePilot’s API secrets by WireShark, and I added scripts to trigger scenes as well as automations (“Auslöser”) by their clear names! :slight_smile:

UPDATE: It’s been a while, but more good news!
The API of Rademacher seems to have no callback possibility at all. At least I found no hints to this, and their own config website uses regular polling to update its values. But the HomePilot is compatible to Philips Hue and can integrate a Hue bridge.

This, and this cannot be overestimated, offers the possibility of the HomePilot proactively outputting trigger events in real time!! :sweat_smile: instead of polling it to death with the HTTP binding for close-to-realtime applications.

How to do this?

  • Enable the Hue Emulator in OpenHAB and register as a Hue bridge in HomePilot (non-trivial, see below!)
  • Create a proxy item of type Switch, assign category “light”, add Non-semantic tag “Lighting”. You will see a dimmer light with the name of the proxy item in the Homepilot devices then. (HomePilot does not support the Zigbee switch type, so use a light).
  • In HomePilot, include this light in scenes and triggers of your choice, command it to be “On” and “Off”.
  • You will see the proxy item react to these commands almost instantaneously! This, you can use in all OpenHAB ways from there on :wink:

Nevertheless, HomePilot will not communicate with the Hue Emulator right away. The reasons are tricky, took me some days. The solution is simple, anyway, and can be found here.
Have fun! :smiley:

I’m using the Homepilot Premium Gateway. It seems that this Gateway has a different API. Here’s an example from a rollershutter with:

I changed the transfrom to:

(function(position){
    try{
	if (parseInt(position) != position) 
	{
	    return position;
	}
	var obj = {name: "GOTO_POS_CMD", value: parseInt(position)};
	return (JSON.stringify(obj));
    } catch(e) {
	return null;
    }
})(input)

Now I can have only a single item for a rollershutter that accepts UP/DOWN/STOP and an integer.

To get the IDs of your device curl http://<ip>/hp/devices | jq

1 Like

This is interesting. First time I heard about the Homepilot Premium, seems this is the equivalent to the “full” DuoFern Homepilot (now called Smarthomebox) in their new Homepilot DIY brand.

From what you wrote, it looks like it’s still a REST API, therefore I would guess the method of observing the message from and to the configuration website with Wireshark should still be working?

Just out of curiosity: does the Homepilot Premium still have the Philips Hue integration?

I guess so, but I haven’t tried.

I didn’t find any information about Hue in the official app.

Hi all, just FYI: Today I installed the recent firmware update on my Homepilot from version 5.7.x to 5.8.20.

So far it installed without any issues and all my bindings and commands from OH continue to work as before, so it looks safe from the API point of view. :slight_smile:

1 Like

Hey @April_Wexler ,

thank you very much for your example! :+1:
I just got a Rademacher Bridge (not the Homepilot) 2. hand because it seems to be no longer available. But it does the job of communicationg with all my Rademacher Rollershutters and Lights.
I implemented your example now in OH and it works in the same way also with the bridge! :heart_eyes:

1 Like

thank you for your feedback, @HolgerL :grinning:

And a big thank you to @Hundertvolt1 as well - he improved the config a lot!

As far as I understand, there were many changes in the marketing of Rademacher.

“Homepilot” is now their DIY brand, while Rademacher is the “professional” brand.

They renamed the Homepilot device to “SmartHomeBox”. It’s only different in what is printed on the case. Inside there is some Raspberry Pi board combined with a DuoFern radio module. This device is used for communication as well as automation.

Then, there is the low-cost variant “Gateway”. While I would actually doubt any hardware differences, its installed software allows communication only, but no or just very little automation. So this is acting as a remote control over IP without added intelligence. But as it uses the same cloud and app, it’s no surprise at all that the API is about identical.

I chose the full SmartHomeBox in order to distribute automation, to mitigate the risk of a single point of failure, and use OH mainly as extension and augmentation of all smart systems.

But if you use OH as the main automation instance and want to connect it to the Rademacher DuoFern system only, the Gateway box is your choice.

My setup is a bit different. I use from the beginning the Rademacher DuoFern Handzentrale 9493. This is a battery powerd remote control which runs also the automation of the blinds and lights depening on sunrise, timers,
 This is totally independent from my network and communicates only wih the actors directly.
The Homepilot/SmarthomeBox would do the same inside the network, but would be redundant for me. So I only needed the interface to get all the actors acessible from openhab, switch them manually, know their status,

Now I have some of the cheap Guition ESP32-S3-4848S040 with openhasp running as “switch”

Hi everyone,

I just wanted to announce that the update of the Smarthomebox to 5.9.13 is safe from the API point of view.

But not only that.

5.9.13 supports Matter for switches, rollershutters and lights. Pairing the Smarthomebox with the OH 5.0.1 Matter binding worked straight away on first try. It’s amazingly fast (switch statuses seem to be actively pushed instead of being pollied). I converted almost 40 items from HTTP binding to Matter. Way better performance. No reliability issues found so far.

Great work from the OH devs and from Rademacher, I’d say :+1::grinning_face:

Only one mini issue I found. If there are special characters in the device name in the Smarthomebox (Umlaute), the name does not get transferred through Matter. Dunno if this is due to something on the Smarthomebox side or on OH side (I informed the Rademacher support, anyway).

If that happens, it’s still no problem finding out which device it is. Add it as Thing, then look inside the device properties for

BridgedDeviceBasicInformation-serialNumber
What you see there is found as “uid” in the JSON data listing of the Rademacher API (See old posts above). Just search for it and you’ll see which device it is and you can adapt its description.

1 Like

perfect - thanks for letting us know :slightly_smiling_face:
regards, Kai

P.S.: we still need a binding :innocent:

Hehe, been thinking a lot about such thing. :wink:

The truth is, besides lack of time, that I don’t see any way to make a binding such good and flexible to cover the use cases. Complexity explodes.

Why?

  • If you just read the devices and if there is many of them, the API takes ages to respond. 5 to 10 seconds, if no other queries are pending. This is what brought me to OpenHAB as a beginner - I started with iobroker first, they have such a binding, and the only thing it produced for me were timeouts. Here, things ran waaaay better.
  • Sensors read faster, and using device groups in Homepilot with just the ones you need goes faster, but this means configuration changes on Homepilot before even connecting to the binding. Or the binding itself must be able to onfigure it over the REST API. Setup madness.
  • No matter what, this just polls the API. It’s slow and some seconds delay are very sensible when reacting to events. Pushing sensor or trigger events goes fast and efficient using the Hue emulation (described above). Even muxing over brightness levels is possible. But that’s third party dependence.
  • Need responsive reactions to actuator changes? That’s what works well with the brand new Matter connection. Even Homepilot itself cannot do this - almost real-time response to actuator status changes. But changing the configuration of an actuator (auto / manu mode) is not possible over Matter, and not all actuators are supported yet.

All of this is stuff I actually use. Complex, huh
 And any binding not capable of that would be of no real use for me. That’s the dilemma I see.

1 Like

Finding of the day:
Rademacher has a cashback action linked to the upgrade to Matter. They give you 40 Euros if you own a HomePilot of Generation 2 (black case) and buy one of the third gen at any seller of choice.

The second gen does not support Matter due to hardware limitations.

Here are the details

Thanks for that info!
Is it worth switching from the old black model to the new white one?

My shutters and cover does not use matter - or is that wrong? I only have this “duo-fern” devices.
When moving to a new bridge the openHAB config and the shutters and covers will still work seamless?

The only advantage I see: it could be integrated into Apple HomeKit more easily (via a HomePod or AppleTV), right?
But my Rademacher devices are already in HomeKit (using openHAB) :innocent:

Depends on your setup and which future plans you have. The new one is faster and will be supplied with updates, while the old one (AFAIK) does not receive any more updates.

None of any DuoFern devices uses Matter. The HomePilot acts as a DuoFern-to-Matter bridge and offers the opportunity to expose those devices you selected (and only those, max 50) to other ecosystems.

At the moment, they support switches, rollershutters and lights (I only could test switches and rollershutters). I asked the Rademacher support about sensors and heating controllers, and the answer was “We are planning to add support for more devices, but we cannot state which and when at this moment”.

To my best knowledge, yes. The REST API should be identical, and back at the time when I upgraded my HomePilot from 2 to 3, it really was like “plug it in, pull the latest updates, make a backup on the v2, switch v2 off, restore backup in v3, wait 5 minutes, all up and running”.

You might reduce the number of involved devices from 3 to 2, which is good for reliability, if all your exported devices are already supported for Matter. The video tutorial on the Rademacher homepage explicitely is for Apple ecosystem, so it should work :slight_smile:

By the way, the reason why I decided to replace my inactive v2 bridge with a v3 although I already run a v3 for long is to have an immediately ready replacement device if the productive one ever should fail. As I have a very complex setup and many devices which even make the v3 web interface sluggish, I need one with high performance, and as things got way faster with Matter, I need the functionality as well.