Casambi Binding in Development

Hello world,

In case anyone is interested. I am currently developing a Casambi binding. It can be found at

https://github.com/hpo13/Casambi-OpenHAB-Simple

Currently lights can be controlled (brightness, color etc.) and there is discovery (manual).

If you want to use it, you will have to compile (with the OpenHAB development setup) and install it yourself. You will also have to get a Casambi developer key etc. (see README.md).

The binding is not yet ready for inclusion into to OpenaHAB source tree, but some day I hope to get it ready.

Comments and suggestions are welcome.

Regards, Hein

1 Like

Some news here: Added a ‘jar’ file to the git repository (in the ‘target’ folder). This can be added to the ‘addons’ directory of an OpenHAB installation. This allows for testing the driver without compiling it.

Hello,

I recently installed a casambi luminary and wanted to have a go. I installed the app on an Android and put the jar in addons. Unfortunately Casambi doesn’t provide API keys for the moment, either new ones or renawals since this is part of their beta programme which is full.

Bob

Hi,

I am sorry to hear that. No wonder there has not been a lot of feedback for the driver.

Come to think of it, the Casambi people made some remarks about charging for the use of the API in the future. They seem to be aiming more at commercial installations than at private individuals. I got the impression that they were planning to go productive sometime this year

The driver could more testing as I only have a small number of luminaries myself.

Regards,

Hein

I suppose the API keys are bound to an email address and can’t be shared?

Best regards

Bob

Hi Hein,

they opened up the bèta programme again so I got hold of an API key.
I succeeded in configuring the bridge but it doesn’t find my luminary automatically.
In the logs I get:

2022-05-20 10:37:31.607 [ERROR] [nal.driver.CasambiSimpleDriverSocket] - ping: Error - Socket not open.
2022-05-20 10:37:31.608 [WARN ] [l.handler.CasambiSimpleBridgeHandler] - sendKeepAlive: exception ping: Error - Socket not open.. Continuing.
2022-05-20 10:37:34.499 [ERROR] [andler.CasambiSimpleDiscoveryService] - doDiscoveryScan: exception java.util.concurrent.RejectedExecutionException: HttpClient@3b5cd5f{STOPPED} is stopped. Exiting.

I can configure it manually but then it doesn’t have any channels.

Any hints?

cheers

Bob

Hi,

just a quick update.
It detected the luminary and the associated scenes now.
It shows 2 channels (dimmer and color temperature). There is no on/off switch apparently? The reason I ask, is because the luminary has 2 led strips that are coupled and that can be adjusted seperately. If I turn it on by hand it just goes to the last state.
I need to test some more to get a feel for what works.

The scenes are also displayed as a dimmer although I should expect this to be on/off.

The android phone that I use as a bridge doesn’t seem to work as expected. I tried another phone with success but it is not an ideal situation.

cheers

Bob

Hi all, I am also interested in the binding, we plan to install in our garden a pergola which has blinds and lights controlled by a casambi system. Are you both working with a phone as gateway? I am planning to buy a dedicated gateway (ethernet or wifi based) any experience with that?

I assume there is no way to directly communicate with the casambi devices over BLE instead of going over the casambi REST interface?

Hi Bob,

sorry for taking so long to reply. I pursued other projects and lost track of this one.

I am glad the driver works for you. You probably have found al the answers yourself by now, but here are my thoughts about your questions.

The Casambi API does not provide for switching devices on and off. Off is just a brightness of zero. This makes it more difficult to have the lights go back to the last state after switching on. This functionality would have to be implemented in the driver. Implementing this is not all that easy as there are dependencies between luminaries, scenes and groups. Also one would have to think about what to do if brightness has been changed directlly with the Casambi App (not with OpenHAB). I don’t think I will work on that in the near future.

Scenes are the same thing. They can be dimmed between 0 and 100 percent. Zero percent is off. This allows you to set different brightnesses for the luminaries in a scene and then fade that in and out. Implementing on/off functionality for scenes is yet more involved as one has to consider the case that one device within a scene has been changed individually. The question then is, what to do if a scene is switched on again.

Casambis use of mobile phones as gateways is not ideal, but for someone with a small setup it is still better than having to buy an expensive gateway device.

Regards,

Hein

Hi Simon,

I saw dedicated gateway devices advertised but I am not sure if they are available yet nor how much they cost. The way the Casambi System is setup the driver should be able to use a gateway device without change. Reliability should be rather better than with a mobile phone.

Once you have Casambi controlled blinds I would be glad if you let me know. I am interested in obtaining the messages that are being send by the system for the blinds. It is quite probable that a couple of (small) modifications will be needed in the driver in order to enable it to control blinds.

As for direct BLE communication with the devices I have not found anything. I would expect that to be pretty much locked up in order to prevent unauthorized control of the lights.

Regards, Hein

I just pushed a small update to github. This fixes a luninary/scene/group initialization failure due to a changed data type (integer to float). This seens to have come up during migration from 3.2.0 to 3.3.0.

The JAR file has also been updated.

1 Like

Hold your horses…

I just sent an email to Casambi to get an API key. The answer is the following:

Please note that currently API keys are made valid until end of year, after which the key can be available against a fee. The exact details have not been released yet around the API key pricing.

So depending what “fee” means, it might become expensive to drive Casambi directly from their API :frowning:

however, this might be good news, even if I don’t get yet what it really means: