How to properly setup HA with Homematic?

Hello,
I have a CCU2 at home and use it with a couple of Homematic devices (mostly light switches and dimmers).
I managed to get them show up in Home Assistant using the following config:

homematic:
  interfaces:
    wireless:
      host: 192.168.1.100
    ip:
      host: 192.168.1.100
      port: 2010

It basically works, but the dimmers are very slow. So when I f.e. turn them off using HA, the toggle goes to off, but then jumps to on again and then to off after 2-3 seconds. Is that normal?

Also when dimming: f.e. the brightness is currently at 100%. Then I set it using HA to let’s say 50%. HA will then show something like 95% and only after 2-3 seconds it will be at 50%.

Do I simply have a bad config? Or is the homematic integration buggy? Or my CCU2 just too slow?
I was using ioBroker before, at it was never a problem there…

I was having some issues with jumping values while dimming with the home-kit integration when using ioBroker, but that was easily fixed by using:

Level Datapoint: hm-rpc.1.MEQ1828729.1.LEVEL
Working Datapoint: hm-rpc.1.MEQ1828729.1.WORKING

Maybe that would help in HA as well? But no idea where I would set something like that…

@danielperna84 may I attract your attention by mentioning you? Afaik you know quite a bit about homematic and home-assistant, right?

Just yesterday I also noticed that the HomeKit integration cannot power off my dimmer light?!?
Regular lights (not dimmable ones) work fine.
And also when dimming using HomeKit, even when I go from let’s say 10% to 20% the lights dim up to what at least feels like 100% in-between. Is this “normal” or is there something wrong with my setup?

I would guess it’s the CCU2. I’ve switched to a RPI 3 B+ (running RaspberryMatic) and it’s so much faster.

I don’t have that many components (old and IP mixed), 5 outlet switches , 3 (multichannel) switches for lights, 2 motion sensors, 5 door sensors and 2 power meter sensors (HM-ES-TX-WM).

There are direct links between the motion sensors and some of the light switches, and 2 scripts for the power meter readers. That’s all that HomeMatic does, everything else is controlled/done by Home Assistant. No big delays and doesn’t make a difference if I use Siri/Alexa/HA.

Only real problem with this setup, if you restart RaspberryMatic Home Assistant does not automatically reconnect to RaspberryMatic.

@MarH Hm… I also don’t have that many components. A few lights and a thermostat.
I didn’t have any problems when I was using ioBroker, but Home-Assistant does not handle Homematic as good. But has so many other benefits…

Sorry for the delayed reply. My first thought is it you may be running Home Assistant via WiFi. In general you connection seems to be functional. So there’s now issue with your configuration. The odd behaviour of your devices could be cause by transmission errors or latency in general if the connection you’re using is unstable.

Of course the theory with the CCU2 being slow is not totally invalid. But back then when I had a CCU2 too, I did not experience such problems. So my initial advice would be to monitor the connection between your Home Assistant host and the CCU2. Something like a long running ping where you observe the response time and possible spikes.

Oh, and the first thing to do: restart your CCU2. Maybe there’s a stuck process that’s eating up performance. And maybe also your duty cycle keeps being exausted because of some other bad behaving device.

Hey @danielperna84 ,
thanks for your help! Hm… my RPi 4 is connected via ethernet and the average ping in the time I am testing was about 0.5ms. So I guess that’s fine?
I did restart my CCU2 now and will check if this changes things. The strange think is that ioBroker didn’t have those issues… Especially with the dimming via HomeKit.
Ok… just did some test after restarting my CCU2…
Still issues. Dimming is horrible. I am at like 5% and want to dimm to about 10% using HomeKit. Lights will go to what feels like 100% up, then back down to 10%… Not a great dimming experience :frowning:
Also… same dimmer. I switch it on using the HA-Web-UI and the switch will turn back to off, even though the light IS on. None of those issues are reflected in the CCU Interface. I can dim there without the flickering and also the state is correct over there…?!? Isn’t that strange?

Some more observations. Dimming my lights using the HA-UI is much better. It’s smooth there as well!
But… Lights are off. I dim them to 10% using the slider… the switch in HA still indicates off-state?? Is that normal?

To get this resolved please don’t take Homekit into account. If Homematic devices behave properly without Homekit, then the obvious source of the problem is Homekit, not Homematic. Other implementations may handle Homekit-specifics better than Homematic, but that doesn’t mean Homematic on it’s own isn’t working correctly.

Since I don’t have dimmers I don’t knoe how they worked previously. But until now I haven’t heard any complaints about them. What I would consider fairly normal is a small amount of freaky behaviour in the UI. The signal of applying a setting to any Homematic device first is applied to the UI element. Hence initially the element should switch to whatever you have set it to. Meanwhile the signal is being transferred to Home Assitant, from there to your CCU2, the CCU2 applies the change, then reports back to Home Assistant what the real new state is, and Home Assistant forwards this to the UI. With a simple on/off switch there’s not much room for wierd UI. But I can imagine this being different for lights where brightness (and possibly color) also are being transmitted.

To sum this up: if you interact via the UI, the device gets set correctly, and the UI eventually displays the correct state after about ~0.5-2 seconds, then that’s pretty much how it should be. If however the UI-state and the actual device state are out of sync, then there’s a problem. I currently have no idea what the cause for such a problem could be. You have ruled out connectivity issues, so it must be something else.

Another this you should try is to see how the devices behave when you control them via automations / service calls (compared to the UI).

Hey @danielperna84. Thanks again for your reply.
Hm… yes… I think I also experience the issues with one light it seems. I’ll have to do some further digging!
But again, thanks for your thoughts and help!
Cheers,
Georg