Möhlenhoff Alpha BUS - Solution

Just as an additional information, there is/was a bug in the label transformation. But it schould be fixed in future reaeases.
Thats why the transformation had to be done at the binding which is a better solution if the content of the xml is not needed anywhere else, imho.

Hey!

I´d like to receive the current tv show via xml, this expression would normaly return me the current running tv-show on that specific channel 'ARD':

string(/rss/channel/item[dc:subject='ARD']/title)

With the help of this post, I was able to create an Item which returns me the channel name as result, as expected. But how can I add the value that I´m searching for 'ARD' and the desired output value in the field <title>?

String      TV_Channel_ARD_CurrentShow      "Aktuell laeuft [%s]"     { http="<[http://www.texxas.de/tv/hauptsenderJetzt.xml:3600000:XPATH(/*[name()='rss']/*[name()='channel']/*[name()='item']/*[name()='dc:subject'])]"}

i have a similar problem:
i have this register:


whit this string:

String dato “Info [%s]” {http="<[http://192.168.1.115/7:6000:XPATH(/[name()=‘modbusregisters’]/[name()=‘register’]/*[name()=‘value’])]"}

but doesn’t work can anyone help me please?

Hi again,

now i want change the setpoint from the temperature in my rooms. I have think that i only must change the sign in my code but it don´t work. Can anybody help me. Thanks

Here my code that i can receive my actual temperatue

http="<[HeizungOG:10000:XPATH(/Devices/Device/HEATAREA[@nr=‘3’]/T_ACTUAL/text())]"

and that the code for change the setpoint

http=">[HeizungOG:10000:XPATH(/Devices/Device/HEATAREA[@nr=‘3’]/T_ACTUAL/text())]"

What it´s wrong ?

Sorry I have the exact same hardware for my floor heating and this is the first time I am using xpath.
Is there no function to return a number value from the xml?
<T_ACTUAL>20.8</T_ACTUAL>

cheers

Hi together, now Openhab 3 is here. How i can read now the infos from the xml file ?

Hi,

here is my Thing file for the Alpha 2:

Thing http:url:MoehlenhoffCacheStaticEG "MoehlenhoffCacheStaticEG" [ baseURL="http://192.168.1.3/data/static.xml", refresh=30]  {        
   Channels:  
      Type number : FBH_Wohnen_IST [ stateTransformation="XPATH:/Devices/Device/HEATAREA[@nr='1']/T_ACTUAL/text()", mode="READONLY" ]   
      Type number : FBH_WC_IST [ stateTransformation="XPATH:/Devices/Device/HEATAREA[@nr='7']/T_ACTUAL/text()", mode="READONLY" ]
	  	  
	  Type number : FBH_Wohnen_SOLL [ stateTransformation="XPATH:/Devices/Device/HEATAREA[@nr='1']/T_TARGET/text()", mode="READONLY" ]   
      Type number : FBH_WC_SOLL [ stateTransformation="XPATH:/Devices/Device/HEATAREA[@nr='7']/T_TARGET/text()", mode="READONLY" ]   
	  
	  Type number : FBH_Wohnen_STATE [ stateTransformation="XPATH:/Devices/Device/HEATCTRL[@nr='1']/HEATCTRL_STATE/text()", mode="READONLY" ]   
      Type number : FBH_WC_STATE [ stateTransformation="XPATH:/Devices/Device/HEATCTRL[@nr='7']/HEATCTRL_STATE/text()", mode="READONLY" ]
	  
	  Type number : FBH_Wohnen_ACTOR [ stateTransformation="XPATH:/Devices/Device/HEATCTRL[@nr='1']/ACTOR/text()", mode="READONLY" ]   
      Type number : FBH_WC_ACTOR [ stateTransformation="XPATH:/Devices/Device/HEATCTRL[@nr='7']/ACTOR/text()", mode="READONLY" ]
	  
	  Type number : FBH_Wohnen_ACTOR_PERCENT [ stateTransformation="XPATH:/Devices/Device/HEATCTRL[@nr='1']/ACTOR_PERCENT/text()", mode="READONLY" ]   
      Type number : FBH_WC_ACTOR_PERCENT [ stateTransformation="XPATH:/Devices/Device/HEATCTRL[@nr='7']/ACTOR_PERCENT/text()", mode="READONLY" ]
}

and here the Items for that:

// IST TEMPERATUREN FBH
Number FBH_Wohnen_IST "Wohnen [%s]" { channel="http:url:MoehlenhoffCacheStaticEG:FBH_Wohnen_IST" }
Number FBH_WC_IST "WC [%s]" { channel="http:url:MoehlenhoffCacheStaticEG:FBH_WC_IST" }

// SOLL TEMPERATUREN FBH
Number FBH_Wohnen_SOLL "Wohnen [%s]" { channel="http:url:MoehlenhoffCacheStaticEG:FBH_Wohnen_SOLL" }
Number FBH_WC_SOLL "WC [%s]" { channel="http:url:MoehlenhoffCacheStaticEG:FBH_WC_SOLL" }


//VENTIL AKTIV FBH
Number FBH_Wohnen_STATE "Wohnen [%s]" { channel="http:url:MoehlenhoffCacheStaticEG:FBH_Wohnen_STATE" }
Number FBH_WC_STATE "WC [%s]" { channel="http:url:MoehlenhoffCacheStaticEG:FBH_WC_STATE" }


//AKTOR AKTIV FBH
Number FBH_Wohnen_ACTOR "Wohnen [%s]" { channel="http:url:MoehlenhoffCacheStaticEG:FBH_Wohnen_ACTOR" }
Number FBH_WC_ACTOR "WC [%s]" { channel="http:url:MoehlenhoffCacheStaticEG:FBH_WC_ACTOR" }


//AKTOR OEFFNUNGSGRAD
Number FBH_Wohnen_ACTOR_PERCENT "Wohnen [%s]" { channel="http:url:MoehlenhoffCacheStaticEG:FBH_Wohnen_ACTOR_PERCENT" }
Number FBH_WC_ACTOR_PERCENT "WC [%s]" { channel="http:url:MoehlenhoffCacheStaticEG:FBH_WC_ACTOR_PERCENT" }
1 Like

edit:
The above is to READ from the base unit.
If you want to WRITE new Target Temps (Soll Temperatur) you can do this:

Thing:

Thing http:url:MoehlenhoffCacheChangesEG "MoehlenhoffCacheChangesEG" [ baseURL="http://192.168.1.3/data/changes.xml", commandMethod="POST", contentType: application/xml]  {        
   Channels:  
      Type number : FBH_Wohnen_SOLL [ commandTransformation="JS:Alpha2_FBH_Wohnen.js", mode="WRITEONLY"  ]   
      Type number : FBH_WC_SOLL [ commandTransformation="JS:Alpha2_FBH_WC.js", mode="WRITEONLY"  ]   
 	  
}

You can add a SECOND channel for the existing item that already READS the temp from the base unit - so this items now REPLACE the existing items from above post!
// SOLL TEMPERATUREN FBH

Number FBH_Wohnen_SOLL "Wohnen [%s]" { channel="http:url:MoehlenhoffCacheStaticEG:FBH_Wohnen_SOLL", channel="http:url:MoehlenhoffCacheChangesOG:FBH_Wohnen_SOLL"  }
Number FBH_WC_SOLL "WC [%s]" { channel="http:url:MoehlenhoffCacheStaticEG:FBH_WC_SOLL", channel="http:url:MoehlenhoffCacheChangesOG:FBH_WC_SOLL"  }

Finally you need the JS script from the thing in your conf/transform folder:

(function(i) {
  var str1 = "<?xml version=\"1.0\" encoding=\"UTF-8\"?> <Devices> <Device> <ID>YOUR_ID_HERE</ID> <HEATAREA nr=\"7\"> <T_TARGET>";
  var str3 = "</T_TARGET> </HEATAREA> </Device> </Devices>";
  result = str1 + i + str3;
  return result;
})(input)

I made one script per room. Probably you can also have a case statement somehow in the script to copy the correct “Heat Area”. I did not find out how to tell which item triggered the script.
If you improve that part … let me know.

By this you have a single Target Temp item per room. You can still READ a new target temp if it was changed by someone at the room controller. And you can WRITE from openhab to base unit. (remark: The base unit can take up to 10 mins until you see the change on the room controller!! - however when you access the webserver on the base unit you see instantly that your target temp was updated from openhab)

@Maddin2017 can you change the Title and Attributes of this Thread to something link Möhlenhoff Alpha BUS → and push it to the solutions section? So other users can better find and copy.

1 Like

@shorty707 Thanks for you solution. I have push it to the solutions section. I hope now other users can find it better.

@shorty707 and @Maddin2017

Hey guys, i really hope, you are still in touch with this :wink:
I tried to recreate what shorty707 wrote above, but I still can´t send values to my Alpha-Bus.
Here is, what i did, maybe you see my error?:

The log says:

2022-08-25 22:49:38.647 [WARN ] [.transform.SingleValueTransformation] - Transformation service JS for pattern Alpha2_FBH_WC.js not found!

My Thing/channel:

UID: http:url:d85bf36e84
label: TestHeizungSet
thingTypeUID: http:url
configuration:
  authMode: BASIC
  ignoreSSLErrors: false
  baseURL: http://192.168.178.22/data/changes.xml
  delay: 0
  stateMethod: GET
  refresh: 30
  commandMethod: POST
  contentType: application/xml
  timeout: 3000
  bufferSize: 2048
channels:
  - id: TestSetTempWC
    channelTypeUID: http:number
    label: Test Set Temp WC
    description: ""
    configuration:
      mode: WRITEONLY
      commandTransformation: js:Alpha2_FBH_WC.js

Here two steps i made, where i am not sure.

  1. I created a textfile in openHAB-conf → transform called Alpha2_FBH_WC.js, Here i copied, what shorty wrote above:
(function(i) {
    var str1 = "<?xml version=\"1.0\" encoding=\"UTF-8\"?> <Devices> <Device> <ID>HKV147</ID> <HEATAREA nr=\"8\"> <T_TARGET>";
    var str3 = "</T_TARGET> </HEATAREA> </Device> </Devices>";
    result = str1 + i + str3;
    return result;
  })(input)
  1. I installed the JSONpath transformation via the UI in “bindings”. Is there anything more i need to do? Scince the log says Transformation service JS not found.

EDIT: Here a part of the XML i get form my Alpha.

image

Thank you, guys!