Integration with XComfort Bridge

it’s working now as well, much appreciated. :slight_smile:

Have a good one…!

Jan,

Er det noen mulighet for at du kan få sett litt til på ‘cover’ delen? Jeg har kommet et stykke lengre på egenhånd, men nå står jeg fast.

‘Down’ og ‘Stop’ virker, men ikke ‘Up’ eller ‘Position’.

Mvh
Øyvind

Har brukt denne integrasjonen en ukes tid nå, og har fungert veldig bra. Nå byttet jeg router, har satt statisk IP på home assistant samt xComfort Bridge, men allikevel så får jeg ikke xComfort-integrasjonen til å virke lenger. Har endret til den nye IP`en i HA også, altså “renamet” integrasjonen. Er det noe mer jeg må gjøre? Setter veldig stor pris på hjelp!

Verdt å nevne i det nye oppsettet så har jeg Google Nest WiFi Pro ->unmanaged switch → unmanaged switch → både xcomfort og HA Yellow tilkoblet til siste switchen. Tidligere var alt koblet i forrige router, men det er ikke så lett med det nye oppsettet.

Får følgende feilmelding:

"Logger: homeassistant.config_entries
Source: custom_components/xcomfort_bridge/hub.py:51
Integration: Eaton xComfort Bridge (documentation, issues)
First occurred: 18:30:00 (3 occurrences)
Last logged: 18:34:28

  • Error setting up entry 192.168.86.25 for xcomfort_bridge
  • Error setting up entry 192.168.86.100 for xcomfort_bridge

Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/config_entries.py”, line 387, in async_setup
result = await component.async_setup_entry(hass, self)
File “/config/custom_components/xcomfort_bridge/init.py”, line 36, in async_setup_entry
await hub.load_devices()
File “/config/custom_components/xcomfort_bridge/hub.py”, line 51, in load_devices
devs = await self.bridge.get_devices()
File “/usr/local/lib/python3.10/site-packages/xcomfort/bridge.py”, line 399, in get_devices
await self.wait_for_initialization()
File “/usr/local/lib/python3.10/site-packages/xcomfort/bridge.py”, line 389, in wait_for_initialization
await asyncio.sleep(0.1)
File “/usr/local/lib/python3.10/asyncio/tasks.py”, line 605, in sleep
return await future
asyncio.exceptions.CancelledError"

I’ve finally had some time to play with this. Great work, @jankrib!

I’ve made a PR to xcomfort-python to address issues I had with triggering changes to shades, as well as add support for setting direct shade positions: Update shade support by alexbrasetvik · Pull Request #11 · jankrib/xcomfort-python · GitHub

Related PR to the HA-component that use these and makes it work with 2023.5: Fix cover/shade support by alexbrasetvik · Pull Request #21 · jankrib/ha-xcomfort-bridge · GitHub

My dev setup was not great and VSCode wanted to auto-format everything, but hope things work after unentangling that and trying to make the PR small. :slight_smile:

@Viking I think we might be neighbours and have the same hardware, so mind having a quick look at those changes? :smiley:

Hi Alex,
I’m on a business trip this week (back Thursday). I’ll have a look at it then. Let’s talk when I get back.

Rgds
Øyvind

While I can’t speak for Jan, I found that the official app is a Cordova app with some webpacked Javascript in the app bundle. Not quite the API docs some Xcomfort people I spoke to last year said were coming, but it wasn’t too terrible to find the right commands to send.

Nice work @alexbrasetvik !

The contribution is much appreciated. I don’t have xcomfort shades, so it’s nice that somebody who has them can help.

I have merged the PRs and updated the pypi package so hopefully everything is working.

@Viking Does this also solve your issue?

Hi @jankrib - good to see you alive and kicking :blush::+1:
And yes, I just downloaded the repository, deleted the whole xcomfort_bridge folder in custom_components and added everything fresh - and now it works:

I’m not sure what Open -155% means, but for the time being - I don’t care :hugs:

I made a issue for this. See:
Shade position is not cerrectly calculated · Issue #23 · jankrib/ha-xcomfort-bridge (github.com)

1 Like

Hi all,

thanks for putting in all the effort!
I got my bridge this afternoon and I was testing this component.
I noticed that @alex_w has added the xcomfort switches (thanks for this, it works). Could you also add this to your component @jankrib, because that’s what I was missing.
Right now they show up in Home Assistant as switches. I would like to see them as a momentary switch (push button). This makes the automations a lot easier. I will look into this myself later this week.

Thanks for all the work!
Ron

What “smart switches” are you referring to that Alex has added to the xComfort integration?
How do I implement his code?

I’m referring to these kind of switches:
https://datasheet.eaton.com/datasheet.php?model=126031

With @jankrib’s component, these switches aren’t added to Home Assistant. With @alex_w’s updated code, they are added.

However, my switch (the CTAA-04/04) has 8 buttons. This will be added to Home Assistant as 4 switches. Each switch has two buttons assigned, one button for switching the switch on and one button for off. So 4 switches * 2 buttons, makes 8 buttons in total.

What I want to accomplish is to add these 8 buttons as individual push buttons to home assistant. This way it’s a lot easier to create automations based on the buttons pressed.

Many thanks for your reply.
@Alex_w branch is apparently 9 commits ahead and 15 commits behind jankrib:ha-xcomfort-bridge:master.
What (if anything) will I “loose” by choosing this branch instead of the upstream master?

You’re welcome :slight_smile:
I’ve no clue what the differences are, all I’ve done so far is trying them out.
I only have the switches, so that’s all I have focused on.

I’ve just realized something. Home Assistant registers everything that happens, so also the button presses. I’ve checked, every time a button is pressed, an event is registered. This event can be used for automations. :relieved:

So, are you currently using Alex_w’s version or Jankrib’s version?

Alex_w’s.
Jankrib’s won’t work, as no entities are being registered (for me)

? Now, why is that - I wonder…
So far, I myself have been using Jankrib’s version, and almost everything he did has worked quite well. Especially after @alexbrastevik fixed the ZIP-Screen part and had that merged into the upstream master.

So how can you say that “no” entities are being registered for you? I assume what you mean by that is that no xComfort entities from the Bridge shows up in your HA ? Is that right? None? Whatsoever?
But when you use Alex_w’s branch, it all shows up? I mean - you must have a number of xComfort devices, right? Not just a switch or two, but several, plus a matching number of paired actuators, right?

If so, you seem to imply there’s something fundamentally wrong with Jankrib’s master? Something that Alex_w managed to correct in his version (at least for your setup)? So how come Alex_w’s branch was never merged back into Jankribs master? Or was it?

I’m not suggesting anything - I’m just curious to understand the whole picture. Right now, I’m very confused. Please help me understand.

You’re assuming wrongly :wink:

I only have the one switch, CTAA-04/04 and the xComfort Bridge. That’s all I have.

I’ve bought the switch to control Home Assistant, as the looks are identical with the other switches in my house and this switch has 8 buttons.

So yes, I’ve tried out Jankrib’s version, the switch didn’t show up as entities in Home Assistant. With Alex_w’s, the switch’s entities do show up.

Like I said before, I don’t know for other Eaton devices, as I don’t have any.
But if you look at the code, you can clearly see that Alex_w has added this switch and this code isn’t part of Jankrib’s version.

I hope this clarifies! :slight_smile:

Who knows, I might even buy more Eaton devices

That’s amazing! So you actually bought a bridge just to use one 4-pole switch ?!
And then you discovered that Jankrib’s code didn’t support switch events…
Luckily you came across Axel_w’s code then.
I wonder why his excellent contribution was never merged into Jankrib’s upstream master?
Is there anything we can do?

I don’t want to swap Jankrib’s code out with Axel_w’s because I do not know what I might potentially loose. After all, it is listed as 15 commits behind (!)
But I’d very much like to have the added benefit of his functionality, though…

Sorry for the late reply.
Haha, yes that summarizes it pretty well!

I don’t know what the differences are either…
Now, almost 2 months later, the switch stopped working though… very unfortunate.
I don’t know if it’s just as simple as the battery (which should last for years…) or something else. I still need to debug. Anyways, for me it’s not reliable enough.

I bought this switch, as it’s the only 4 way switch I could find that looks the same as the Busch-Jaeger balance series. Preferably I would have a main power powered switch instead of this one.