Configuration of the Homematic Binding for RaspberryMatic

I use the Homematic Binding to connect Openhab 4.3.5 to the RaspberryMatic. I have installed the WeatherSensor HmIP-SWO-PL and all the values are displayed in my RaspberryMatic Installation.
In RaspberryMatic I see two values for sunshine Duration. These are “Sunshine Duration today” and “Sunshine Duration Yesterday”. Where “Sunshine Duration yesterday” accumulates the overall sunshine duration. In Openhab there is only one channel called “sunshineduration”. This channel shows the sum of the two values from RaspberryMatic “Sunshine Duration today” and “Sunshine Duration yesterday”. Therefore it is completely useless. How can I change the interface between RaspberryMatic an Openhab ? Is the binding somehow configurable ?
Is it possible to create the items by items-file and avoid the discovery. But how to adress the channels in RaspberryMatic ?

No, this value shows sunshine duration since device is up or counter reseted by HomeMatic UI.

“Sunshine Duration today” and “Sunshine Duration yesterday” are HomeMatic internal values and not accessible by Openhab.

Two possible solutions:

  1. Find out the internal name of the variables and mirror them with a HomeMatic rule to system values. These are accessible by Openhab. I have done this with my HomeMatic energy counter which has the same problem.
  2. Use OpenHab rules to calculate the daily values based on the overall counter

I have created the following Program. It is from the german hometic Forum. And it is tested and should work. But it does nothing. I can not see the new SysVars and don’t know how to address them from the openhab bridge. And in the discovery it does not see the new sysvars.

object chn = dom.GetObject(‘1656’);
object oSysVarSunshineCounterToday = dom.GetObject(‘svHmIPSunshineCounterToday_1656’);
object oSysVarSunshineCounterYesterday = dom.GetObject(‘svHmIPSunshineCounterYesterday_1656’);
object oSysVarRainCounterToday = dom.GetObject(‘svHmIPRainCounterToday_1656’);
object oSysVarRainCounterYesterday = dom.GetObject(‘svHmIPRainCounterYesterday_1656’);
! Namen der SysVar auf die eigenen Bedürfnisse anpassen, Typ Zahl
object oSysVarRegenGestern = dom.GetObject(‘RegenmengeGestern’);
object oSysVarRegenHeute = dom.GetObject(‘RegenmengeHeute’) ;
object oSysVarSonnenscheinGestern = dom.GetObject(‘SonnenscheinGestern’);
object oSysVarSonnenscheinHeute = dom.GetObject(‘SonnenscheinHeute’);
!
if (oSysVarSunshineCounterYesterday && oSysVarSunshineCounterToday) {oSysVarSunshineCounterYesterday.State(oSysVarSunshineCounterToday.Value());}
if (oSysVarSunshineCounterToday) {oSysVarSunshineCounterToday.State(0);}
!
if (oSysVarRainCounterYesterday && oSysVarRainCounterToday) {oSysVarRainCounterYesterday.State(oSysVarRainCounterToday.Value());}
if (oSysVarRainCounterToday) {oSysVarRainCounterToday.State(0);}
! Kopieren der internen Sysvar mit der Regenmenge des Vortages in die selbst angelegte SysVar
oSysVarRegenGestern.State(oSysVarRainCounterYesterday.Value());
oSysVarRegenHeute.State(oSysVarRainCounterToday.Value());
oSysVarSonnenscheinGestern.State(oSysVarSunshineCounterYesterday.Value());
oSysVarSonnenscheinHeute.State(oSysVarSunshineCounterToday.Value());

Can you see the SysVars in HomeMatic ?
If so, add “homematic:GATEWAY-EXTRAS…” thing from openHAB inbox.
Then add the SysVars Items from the “homematic:GATEWAY-EXTRAS…” thing

I have created the SysVars manually in Einstellungen->Systemvariablen. But I don’t see that my script copies one of the current values into the new SysVars.
And even if I execute the script instantly in Programme & Verknüpfungen, it does not copy the internal values into my new SysVar. They stay on the value 0
I’m not shure whether I have addressed the new sysvars correctly in my script

Definition of the SysVar “SonnenscheinHeute”. I access this variable in the script by “object oSysVarSonnenscheinHeute = dom.GetObject(‘SonnenscheinHeute’);”

And for openhab

I have an GATEWAY-EXTRAS thing, but I don’t know how to add channels/items for the new SysVars.

Same way as any items:

Model
Create Equipment from Thing
Thing
Seach GATEWAY
select homematic:GATEWAY-EXTRAS…
check your SysVar SonnenscheinHeute
add to model

But you can not add channels. You have to delete the thing GATEWAY-EXTRAS, scan und re-add it from inbox.

I have the same device and will check your script later today.

Troubleshooting HomeMatic scripts isn’t pleasant because they don’t display error messages. Therefore, keep the script as simple as possible.
Here is the script for sunshine that works for me:

object oSysVarCounterToday = dom.GetObject(‘svHmIPSunshineCounterToday_27902’);
dom.GetObject(“SonnenscheinHeute”).State(oSysVarCounterToday.Value());

object oSysVarCounterYesterday = dom.GetObject(‘svHmIPSunshineCounterYesterday_27902’);
dom.GetObject(“SonnenscheinGestern”).State(oSysVarCounterYesterday.Value());

your TODO:

  1. create a rule sunshine similar to my energy counter example
    image
  2. copy the script in this rule.
  3. Check the ’ (single quote) in the script, sometimes they are changed in the forums block texts
  4. Replace my Object ID 27902 to your sunshine object ID
  5. repeat 1 to 4 with raining. Don’t forget to adjust the variable names accordingly to rain

One more note about the different values, which are a bit confusing:
There a four different sunshine values:

sunshine minutes from device start → this is the device channel shown in openHAB but not shown in HomeMatic

sunshine minutes from pairing with HomeMatic
sunshine minutes today
sunshine minutes yesterday
These are HomeMatic internal values, shown in H:M in the UI.

So don’t be surprised that what HomeMatic shows and what openHAB shows don’t match.

habe ich so gemacht. Die Skripte funktionieren auch und exportieren die Werte in die neuen , manuell angelegt SystemVariablen.

Allerdings nur wenn ich die Skripte explizit manuell ausführe. Bei einer Änderung in der Systemvariablen “svHmIPSunshineCounterToday_1656” wird das Skript scheinbar nicht ausgeführt.

Ich habe aber bei der Konfiguration des Skriptes die Bedingung
Screenshot_20250714_155121
“bei Aktualisierung der Systemvariablen svHmIPSunshineCounterToday_1656” angegeben

I dont’t know if a trigger on an internal value works. I’ve never tried it.
Use the device value as in my energy example this will work
image

I configured it exactly as you told me. Geräteauswahl “HmIP-SWO-PL 001822698FA14A:1”. “bei Änderung von Sonnenscheindauer”. But it still doesn’t work. What is the difference between “bei Änderungen auslösen” and “bei Aktualisierung auslösen”. I have tried both but without any effect. Do the new sysvars need a channel assignment? the other sysvar have an assigment to the weatherchannel “HmIP-SWO-PL 001822698FA14A:1”. Gibt es irgendeine Möglichkeit im Log zu sehen, was da passiert ?

Before we switch to openHAB, we need to be sure that everything is working on the HomeMatic side.
Check if the value of SonnenScheinHeute updates in the HomeMatic UI:
Einstellung → Benutzerverwaltung → Systemvariable hinzufügen → SonnenscheinHeute → auswählen
Back to HomeMatic start screen there is now on the right side the value SonnenscheinHeute. Does this update each minute of sunshine ? Maybe you need to reload the start page.

“Bei Änderungen auslösen” triggers the rule on value change of the device
“bei Aktualisierung auslösen” tiggers the rule even the device sends the same value

Of course, but not as channel of the device. It is a channel of the GATEWAY-EXTRAS.

I have changed the trigger to time control. I have configured the time module to an interval once in every minute and this works. The trigger of change (neither “Aktualisierung” nor “Änderung”) by “Geräteauswahl” and by “Systemvariable” still don’t work

And very, very strange: Since the new SysVars “SonnenscheinHeute”, “SonnenscheinGestern”,“RegenHeute” and “RegenGestern” are visible in Geräte->HmIP-SWO-PL 001822698FA14A:1 at the bottom of the screen, openhab shows in “Sunshineduration” the Value of “SonnensheinHeute” from RaspberryMatic. But I don’t see the new variables in GATEWAY_EXTRAS.

post your script

It shouldn’t be like that

I have an idee whats’s wrong:
image
no “Kanalzuordnung”

I deleted the channel assinment. Now the new sysvars don’t have any channel assigment. But it changed nothing.

The values in openhab still show the values from “svHmIPRainCounterOldVal_1656” and “svHmIPSunshineCounterOldVal_1656”. Maybe I wait one day and see which values it shows tomorrow.

I didn’t change any of the existing programs “prgDailySunshineRainCounter_1656”, “prgRainCounter_1656_001822698FA14A:1” and "prgSunshineCounter_1656_001822698FA14A:1"which copy from today to yesterday and which handle initialization and overflow

It was my fault yesterday. I repowered and restarted the device and thus the internal counter and Sonnenscheindauer heute are the same within the first 24 hours. After 24 hours of operation and reset of my new sysvar SonnenscheindauerHeute openhab shows the value since powerup of the device and SonnenscheindauerHeute is different from that. HmIP-SWO-PL works as expected. Only the update of the new sysvars doesn’t work by the Aktualisierunds- or Änderungstrigger. Conrolled by the time control every two minutes works

I had the same problem and could not retrieve an internal system variable via binding, but by removing the check mark “systeminternal” it then became visible in openHAB :slight_smile:

image

Now I can call the variable like this:

Number:Volume                 homematic_gateway_extras_ccu2_ccu2_gwe00000000_1_svenergycounter_6510_003fa2698ab19b_2    "svenergycounter_6510_003fa2698ab19b_2"                          (gPersistEveryChange, gPersistMidnight)                                                                  {unit="m³", channel="homematic:GATEWAY-EXTRAS-HOMEMATICOH:HomematicOH:GWE00000000:1#svEnergyCounter_6510_003FA2698AB19B_2"}