MQTT Corsair iCUE control

I have multiple Corsair iCUE devices and wanted to control them along side my HUE led strips. I could not find any existing way of doing this so I have put together a simple Windows service that starts with the system and exposes control of the iCUE devices over MQTT.

https://github.com/tobinbrooke/icue2mqtt

I hope this helps

Update: just released a update to allow multiple iCue devices with same model and to allow re-connecting MQTT client on broker restart

4 Likes

This sounds interesting. I’ve been looking for a way to sync my corsair stuff and hue stuff.

Once you get the option to disable and allow iCue to regain control, I’ll look into this. Maybe an option to set a timeout period. I don’t know if this would be worth it, do the colours set by this remain after it has relinquished control?

I wonder if this is something that you might be willing to build as an addon for IoTLink?

https://iotlink.gitlab.io/

1 Like

Unfortunately, it seems that when the iCue SDK releases control, it immediately reverts back to the last colour set by the iCue software. I tried various things like setting different layer priorities. The only thing I can think of is to expose another MQTT switch which will allow control of the iCue devices to be turned off to revert to being controlled by the iCue software. If anyone has any suggestions about how to get the LEDs to show the colour last set regardless of it coming from iCue or SDK, it would be appreceated

Yep happy to have a look into the add-on structure of IoTLink

2 Likes

@tobinbrooke is it possible to read what profile is he has loaded? If so, that could be handy to be able to have HA change other lights depending on what you have iCue doing. Also handy as iCue has the profile switching feature based on what program you have running. Personally I’d prefer this if possible…

Unfortunately, according to the forums, the iCue SDK does not expose any methods for accessing profiles. I have tried playing around with the Layer priority more which is supposed to allow shared clients. The main iCue software runs on a priority level of 127, if I set my implementation to use 127 or higher I get the problem where any changes made from the SDK will override the core software. If I set it lower it will not display the MQTT colours. If I try setting it high, changing the colour then setting low it just flickers before the iCue software overrides it. The only solution I can see is to expose another switch to allow home assistant to relinquish control

I’ve just pushed up some changes using a different MQTT client lib which seems more stable and now reconnects on home assistant restart

Well, that’s just annoying. I just want to be able to pick an iCue profile and have my Philips Hue strip lights change accordingly. Maybe a feature request to Corsair, but who knows if and when that might happen.

I appreciate what you are doing. I’ll give this a go when I get a chance. Maybe I’ll find another way of doing what I want to achieve.

If you use Home Assistant why not simply set it up to control your hue and iCue LEDs, then create buttons that do more or less what your profiles do but set the colour of both on click? Then you can use these new buttons instead of the iCue profiles. Unless you are also changing some other none-SDK available settings in the profiles such as key mappings.

That’s what I’m thinking, but I do have some profiles set to change based on program/game being, so set keyboard lights to highlight set keys in games, etc. Also, I’m assuming that this wont allow profiles with effects to work. I like to have a suttle colour change sometimes while I’m working, or sometimes have it real flashy just because. LOL.

I can’t get the service to start. I had the error that’s in the GitHub issues, but re-ran and no error. Everything else seems to go fine until I start the service. This is the alert I get.

Not sure I know what I’m doing wrong.

mmc_jBKkJ3jihD

Hi, sorry I added logging to event viewer under the applications and services log. It may mean that the first time it runs it will require admin privileges to allow it to create the log topic. If that is the case you should be able to see some error log entry under windows logs about permissions.

Also I have just checked in a change that adds a switch with the name “iCue control” when it starts up this defaults to on. If you turn it off it allows the iCue software to regain control and turning it on again restores the MQTT control

Also did you set your properties file?

Yes. The error is that ther is no MQTT broker URL. I have added this in the credentials, so not sure what’s going on there. Have I done it correct??

  <data name="mqttCredentialsPwd" xml:space="preserve">
    <value>password</value>
  </data>
  <data name="mqttCredentialsUser" xml:space="preserve">
    <value>username</value>
  </data>
  <data name="mqttUrl" xml:space="preserve">
    <value>192.168.1.195:1883</value>
  </data>
</root>

This is the default MQTT port. It is expecting a URL without a port. I suspect this is the cause

so I should have mqtt://192.168.1.195 as the URL?

just use 192.168.1.195 as the url

Ok, I thought that was the case. I have tried everything and just cannot get the service to launch.

In Event Viewer I have a entry under “Applications and Services Logs” for icue2mqttLog which has a heap of Information errors.

The error message there is No MQTT broker URL. Stopping

There is a url, I’ve tried it many different ways. It’s currently just the IP address. Any ideas?

If they are information messages they are just put in there for information about what is happening and are not a concern.

The error one is a bit confusing. Have you checked the Properties/Resource.resx in the folder you deployed the service to to ensure the mqttUrl in that file is definitely set? If you used the example path from the instructions, this would be C:\icue2mqttRelease\Properties.

Also it might be worth checking you have the latest version as I added quite a lot over the weekend