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

2 Likes

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:

Hello World,

I am interested in integrating casambi devices in openhab.

is the Binding in an useful state?

what do i have to do to use it?

Thanks

Best regards Rainer

Moin Rainer,

the binding should be working as is. There is a binary in the target directory that you can put into the openhab addons directory. Openhab should then load the binding automatically. Once you have done the setup, you can do a scan for your lights. You will however need an Android device with the casambi app installed and opened and a Casambi API key which you can get from Casambi.

Most everything is described in the documentation.

I may upload a couple of fixes and a new binary (built with OH 4.2) in the next couple of couple of days.

Let me know if anything does not work.

Best regards, Hein

Moin Hein,

I put copied the jar file in the addons directory, but Openhab does not find the binding.

i use Openhab V4.1.1 on an raspberry-pi 4.

what do I wrong?

Best regards

Rainer

You can check if the binding has been loaded by logging into to the openhab console with: “ssh -p 8101 openhab@localhost” with the default password “habopen” (from your raspberry)

You can then list the the loaded modules with “bundle:list”. For me the Casambi-binding is listed as “openHAB Add-ons :: Bundles :: simple Casambi Binding” with a state “Active”.

If that is the case the binding should show up when you hit the “+” to add a new thing in the openhab web-interface.

thanks for the hint: in the openhab console i find the casambi binding active

301 │ Active │ 80 │ 3.4.0.202310291558 │ openHAB Add-ons :: Bundles :: simple Casambi Binding

but when try to add it as a new thing i do not find the casambi binding in the openhab web interface. any hint?

I remember having a similar problem a while ago. Not sure how I solved.

Anyway, I just uploaded the current version of the driver together with a new jar-file that currently works for me. Maybe that helps.

Hello Hein,

now the simple casambi binding is present.

i tried to get the API Key from Casambi support, but they give no API Keys to consumers at this time. And there is no timeline when this will be happen.

do you have any idea?

best regards

Rainer

Unfortunately not. I have had my my API-key for a couple of years now. In the beginning it needed to be renewed annually and Casambi mentioned that keys would have to be paid for at some point. But nothing has happened in the last two or three years. Casambi have probably decided to concentrate on their commercial business. I am not currently in contact with them.