Homematic item with Duty cycle

Hey all,
I just came to know that with CCU2 firmware version 2.17 and greater the limitation on duty cycle was enforced. Since I’m having some troubles with not reahable devices I was looking for a way to get a number item in OH2 containing the DUTY_CYCLE value.
All information found on internet is about a CCU2 script using CUXd and writing a CCU2 variable. Thats not very comfortable so I was wondering if homematic binding already has an option to directly query a datapoint or something using GATEWAY-EXTRAS-CCU2 or similar.

Does anyone graph the duty cycle in OH2 already? Some advice would be really appreciated.
Thanks much.

Some german blog post I found about graphing duty cycle: Link

Hi Sebastian,
I have a script running on my CCU every 15min to send the current duty cycle to an InfluxDB. Together with Grafana I visualise the data in a graph:

! DutyCycle CCU mit HM Script und CUxD.exec (c) by Alchy v 0.1
dom.GetObject("CUxD.CUX2801001:1.CMD_SETS").State("echo 'load tclrpc.so; puts [xmlrpc http://127.0.0.1:2001/ listBidcosInterfaces ]'|tclsh |grep -o 'DUTY_CYCLE.[0-9]*.'");
dom.GetObject("CUxD.CUX2801001:1.CMD_QUERY_RET").State(1);
string duty_cycle = dom.GetObject("CUxD.CUX2801001:1.CMD_RETS").State().StrValueByIndex(" ",1);
! WriteLine(duty_cycle);
string curl_cmd = "/usr/local/addons/cuxd/curl -i -XPOST 'http://<IP>:<PORT>/write?u=>USER>&p=<PASSWORD>&db=<MEASUREMENT>' --data-binary 'duty_cycle,host=ccu2,type=CCU2,adress=<SOMETHING>,firmware=<VERSION> value=" #duty_cycle #"'";
dom.GetObject("CUxD.CUX2801001:2.CMD_SETS").State(curl_cmd);
dom.GetObject("CUxD.CUX2801001:2.CMD_QUERY_RET").State(1);
string curl_ret = dom.GetObject("CUxD.CUX2801001:2.CMD_RETS").State();
! WriteLine(curl_ret);

You can probably adopt this kind of approach to sent the data directly into a virtual item via OH REST-API and use a persistence service in OH.

PS: I also posted this approach on a thread in the homematic-forum.de (german)

Hey Matthias,
thanks much for you reply and idea. I’m using Influx as well as persistance storage. So the idea is to bind the DUTY_CYCLE value to an item in order to graph it.
At the end, I went for the following approach which does not rely on CUXd:

  • get the serial of your CCU2
  • Create a CCU2 system variable
  • copy script from the homematic-forum.de link above and adopt.
  • Now one has the duty cycle already as system-var in CCU2
  • add GATEWAY-EXTRAS-CCU2 homematic thing. This can read all CCU2 variables
  • create an number item for the duty cycle using the GATEWAY-EXTRAS-CCU2 thing (e.g. eg_wz_ccu2_dutycycle)
  • Variables are not pushed from CCU to OH in case they change, so one has to write a small rule to force a refresh.
import org.eclipse.smarthome.core.types.RefreshType

rule "Update CCU2 variables"
when
    Time cron "0 0/10 * * * ?"  // Every 10 mins
then
    eg_wz_ccu2_dutycycle.sendCommand(RefreshType.REFRESH)
end

Thats it

Hi, this is exactly what I am looking for, but unfortunately I cannot find the script (without CUxD) in the mentioned link anymore. Maybe, it is already too old. Can you send me an URL or post the script again here?
Many thanks
Ulrich

You don´t have to use any scripts if your ccu has a newer software.
There is a channel for it now:

Number	CCU_DutyCycle	"CCU-DutyCycle: [%s]"	<line>	{channel="homematic:bridge:CCU:DUTY_CYCLE_RATIO"}
1 Like

… many thanks! :grinning: