Hi,
I would like to repost my first article which was for openHAB 2.x - but this time I changed it for openHAB3.
I used text-based configuration (instead of GUI) - because new Rademacher devices can be integrated much faster this way.
This post is a summary of all above how to integrate Rademacher Homepilot into openHAB 3. You can control Rademacher hardware like:
- Roller Shutters, Blinds, Marquee,
- Closing Contacts (Model 9431)
- Sun Sensors (Model 9478)
- Radiator Thermostat (Model 9433-1)
- UWS (“Umweltsensor” 9475)
It was not necessary to use a workaround with FHEM or MQTT.
Prerequisites:
- Rademacher HomePilot
- Rademacher DuoFern shutters, blinds, sun sensors, UWS (see above)
- openHAB http-Binding
- openHAB JSONPath Transformation (you will find it in openHAB “other add-ons”)
First of all you need to find out your Rademacher device ID (=DID) of every single device.
The “DID” can be found for roller shutters:
http://-your-HomePilot-IP-/v4/devices
(e.g. http://192.168.1.55/v4/devices)
The URL for sensors (closing contact, sun sensor, UWS) is:
http://-your-HomePilot-IP-/v4/devices?devtype=Sensor
(e.g. http://192.168.1.55/v4/devices?devtype=Sensor)
Depending how your Browser shows JSON data you will see something like this:
If you found the DID of your Rademacher device(s) you could use this text based config files - and change it according to your landscape:
/things/rademacher.things
Thing http:url:HomePilot1 "HomePilot1" [
baseURL="http://192.168.1.55/", //your HomePilot IP
authMode="BASIC",
ignoreSSLErrors="true",
refresh=5,
commandMethod="PUT",
stateMethod="GET",
contentType="application/json",
timeout=3000,
bufferSize=2048,
delay=0
]
{
Channels:
Type switch : Kueche_Abzugshaube [ // Rademacher plug DID=27
mode="WRITEONLY",
commandExtension="/devices/27",
onValue="{\"name\":\"TURN_ON_CMD\"}",
offValue="{\"name\":\"TURN_OFF_CMD\"}"
]
// -----------------------------------------------
Type rollershutter : AZ_Rollladen_links [ //DID=46
mode="WRITEONLY",
commandExtension="/devices/46",
stopValue="{\"name\":\"STOP_CMD\"}",
downValue="{\"name\":\"POS_DOWN_CMD\"}",
upValue="{\"name\":\"POS_UP_CMD\"}"
]
Type number : AZ_Rollladen_links#position [
stateExtension="/v4/devices/46",
stateTransformation="JSONPATH:$.device.statusesMap.Position",
commandTransformation="JS:RollerShutterPositionJSON.js",
commandExtension="/devices/46"
]
// -----------------------------------------------
Type rollershutter : AZ_Rollladen_rechts [ //DID=24
mode="WRITEONLY",
commandExtension="/devices/24",
stopValue="{\"name\":\"STOP_CMD\"}",
downValue="{\"name\":\"POS_DOWN_CMD\"}",
upValue="{\"name\":\"POS_UP_CMD\"}"
]
Type number : AZ_Rollladen_rechts#position [
stateExtension="/v4/devices/24",
stateTransformation="JSONPATH:$.device.statusesMap.Position",
commandTransformation="JS:RollerShutterPositionJSON.js",
commandExtension="/devices/24"
]
// -----------------------------------------------
Type number : WC_Heizung_Battery_Percent [ // Radiator Thermostat DID=51
stateExtension="/v4/devices/51",
stateTransformation="JSONPATH:$.device.batteryStatus"
//commandExtension="/devices/51"
]
Type string : WC_Heizung_Battery_Low [
stateExtension="/v4/devices/51",
stateTransformation="JSONPATH:$.device.batteryLow"
//commandExtension="/devices/51"
]
Type number : WC_Heizung_Regler_Position [
stateExtension="/v4/devices/51",
stateTransformation="JSONPATH:$.device.statusesMap.Position",
commandTransformation="JS:RollerShutterPositionJSON.js",
commandExtension="/devices/51"
]
Type number : WC_Heizung_actTemp [
stateExtension="/v4/devices/51",
stateTransformation="JSONPATH:$.device.statusesMap.acttemperatur"
//commandExtension="/devices/51"
]
// -----------------------------------------------
// ****** Sensors ******
// -----------------------------------------------
Type string : WCFensterkontakt [ //clothing contact DID=54
stateExtension="/v4/devices?devtype=Sensor",
stateTransformation="JSONPATH:$.meters[?(@.did==54)].readings.contact_state"
]
Type number : WCFensterBattery [
stateExtension="/v4/devices?devtype=Sensor",
stateTransformation="JSONPATH:$.meters[?(@.did==54)].batteryStatus"
]
Type string : WCFensterLowBattery [
stateExtension="/v4/devices?devtype=Sensor",
stateTransformation="JSONPATH:$.meters[?(@.did==54)].batteryLow"
]
// -----------------------------------------------
Type string : Sonnensensor [ // sun sensor DID=20
stateExtension="/v4/devices?devtype=Sensor",
stateTransformation="JSONPATH:$.meters[?(@.did==20)].readings.sun_detected"
]
// -----------------------------------------------
Type number : UWStemp [
stateExtension="/v4/devices?devtype=Sensor",
stateTransformation="JSONPATH:$.meters[?(@.did==43)].readings.temperature_primary"
]
// -----------------------------------------------
Type string : UWSregen [
stateExtension="/v4/devices?devtype=Sensor",
stateTransformation="JSONPATH:$.meters[?(@.did==43)].readings.rain_detected"
]
// -----------------------------------------------
Type number : UWSelevation [
stateExtension="/v4/devices?devtype=Sensor",
stateTransformation="JSONPATH:$.meters[?(@.did==43)].readings.sun_elevation"
]
// -----------------------------------------------
Type number : UWSazimut [
stateExtension="/v4/devices?devtype=Sensor",
stateTransformation="JSONPATH:$.meters[?(@.did==43)].readings.sun_direction"
]
// -----------------------------------------------
Type number : UWSwind [
stateExtension="/v4/devices?devtype=Sensor",
stateTransformation="JSONPATH:$.meters[?(@.did==43)].readings.wind_speed"
]
// -----------------------------------------------
Type number : UWSlux [
stateExtension="/v4/devices?devtype=Sensor",
stateTransformation="JSONPATH:$.meters[?(@.did==43)].readings.sun_brightness"
]
// -----------------------------------------------
}
/items/rademacher.items
//Rademacher Plug
Switch Abzugshaube "Abzugshaube [%s]" [ "Switchable" ] {channel="http:url:HomePilot1:Kueche_Abzugshaube"}
//shutter
Rollershutter RollladenAZl_Strg "AZ Rollladen links, Steuerung" {channel="http:url:HomePilot1:AZ_Rollladen_links"}
Number RollladenAZl "AZ Rollladen links, Position [%d %%]" {channel="http:url:HomePilot1:AZ_Rollladen_links#position"}
Rollershutter RollladenAZr_Strg "AZ Rollladen rechts, Steuerung" {channel="http:url:HomePilot1:AZ_Rollladen_rechts"}
Number RollladenAZr "AZ Rollladen rechts, Position [%d %%]" {channel="http:url:HomePilot1:AZ_Rollladen_rechts#position"}
//radiator thermostat
Number WCheizungBattery "WC Heizung Battery Percent [%d %%]" {channel="http:url:HomePilot1:WC_Heizung_Battery_Percent"}
String WCheizungLowBattery "WC Heizung Battery Low" {channel="http:url:HomePilot1:WC_Heizung_Battery_Low"}
Number WCheizungReglerPosition "WC Heizung Regler Position" {channel="http:url:HomePilot1:WC_Heizung_Regler_Position"}
Number WCheizungAktTemp "WC Heizung akt. Temp. [%d]" {channel="http:url:HomePilot1:WC_Heizung_actTemp"}
Number WCheizungAktTemp_converted "WC Heizung aktuelle Temp. converted [%d]"
//clothing contact
String WCFensterkontakt "WC Fenster" {channel="http:url:HomePilot1:WC_Fensterkontakt"}
Number WCFensterBattery "WC Fenster Battery [%d %%]" {channel="http:url:HomePilot1:WCFensterBattery"}
String WCFensterLowBattery "WC Fenster Low Battery" {channel="http:url:HomePilot1:WCFensterLowBattery"}
//sun sensor
String Sonnensensor "Sonnensensor meldet Sonne?" {channel="http:url:HomePilot1:Sonnensensor"}
//UWS
Number UWStemp "Temp Balkon [%.1f °C]" [ "CurrentTemperature" ] {channel="http:url:HomePilot1:UWStemp"}
String UWSregen "Regnet es?" {channel="http:url:HomePilot1:UWSregen"}
Number UWSelevation "Elevation (UWS) [%.1f °]" {channel="http:url:HomePilot1:UWSelevation"}
Number UWSazimut "Azimut (UWS) [%.1f °]" {channel="http:url:HomePilot1:UWSazimut"}
Number UWSwind "Wind (UWS) [%.1f m/s]" {channel="http:url:HomePilot1:UWSwind"}
Number UWSlux "Helligkeit (UWS)" {channel="http:url:HomePilot1:UWSlux"}
to control blinds and shutters this small js-file is needed:
/transform/RollerShutterPositionJSON.js
(function(position){
try{
var obj = {name: "GOTO_POS_CMD", value: parseInt(position)};
return (JSON.stringify(obj));
} catch(e) {
return null;
}
})(input)
That’s it.
I would like to thank you guys here in this forum - you helped a lot to make it perfect!
@Markus_Stein @roednix @Felix_Schneider @serg_003 @Rondo @callmed24 @danil
if you see errors, typos or improvements - please let me know. I will keep this post updated.
regards,
Kai