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”
Openhasp1