CASAMBI BLE Light Support

Hi Dirk,

I think I encountered the same.
I initially tried to setup a network in casambi with the admin account and then created another user with access to these networks to use in the HA integration.

That did not work for me.
What worked for me was to create everything with the admin account regeistered to the api key, and use that one in the HA integration. Only way I got it to work in HA

You can clone either GitHub - hellqvio86/aiocasambi: aio library for Casambi lights or GitHub - hellqvio86/casambi: Python code for controlling Casambi lights and look at the config.yaml.example, the integration uses aiocasambi.

I think you have missed to setup a site, step:

Setup a site: How to create a Site : Casambi Support

Anyway its probably easier to debug it through the test cases in: GitHub - hellqvio86/casambi: Python code for controlling Casambi lights

Does the Casambi integration support scenes? From the GitHub documentation I had the impression not, but would like to verify…

The home assistant component does not, how ever the API is fairly straight forward and the python api casambi (not aiocasambi) has some level of support, but then you need to map it to something in home assistant and I don’t see the need of having it since I do the automation (scenes) with home assistant.

Thanks for your reply. Are there any plans to support shutters?

No I am not planning to support it sadly, I don’t have any hardware, but I am happy to accept PRs.

Hallo,

A soon to be owner of lights with Casambi BLE and looking for a solution to integrate into home assistant. I came across this eWeLink device: Home Assistant Interface - Casambi

Any tried this? Does it do the trick?

Thanks!

Most are using the cloud api.

So old phone or tablet → cloud api → Home assistant.

https://github.com/hellqvio86/home_assistant_casambi (cloud api integration)

Integration also exist for homebridge:

I know of people that have bought https://casambi.intelligent-lighting.de/ then you can talk MQTT to Casambi, but I don’t think an integration exist. But I would personally go with that if I wanted a local integration. But it will require some tinkering to get it working.

Thanks for the quick reply, I will look into the plugin but I was hoping for something that doesn’t require an old phone / tablet around.

Anybody that has experience with Lithernet Casambi Gateway and share how to integrate?

Cheers!

I know of people that have bought https://casambi.intelligent-lighting.de/ then you can talk MQTT to Casambi, but I don’t think an integration exist. But I would personally go with that if I wanted a local integration. But it will require some tinkering to get it working.

Any idea how much they paid for it?
I found out my old android devices (android 4.4.2) are all a little too old, they run the Casambi app but can’t actually control the devices.
Aimotion just quoted me aprox 700 euros + shipping for a Casambi internet gateway, made up of two devices (?)

I have never seen end user prices of the gateway, but I am pretty sure that they didn’t pay 700 euro, so you will pay a markup and you will need to implement the mqtt translation on your own.

I am running the casambi application on a old galaxy s8 phone and I have been running it on a nexus 5 phone, both works fine as a casambi gateway.

I have also been running the application on my personal phone, android phone for 200 euro, one year old and I would probably buy a phone like that before going to with the gateway.

But then again casambi is making the api into a premium api, some kind of subscription fee, pri e is not known yet and that might make me rethinking the decision. But 700 euro is to much for a gateway for personal use imo.

Many hits result from a “Casambi Gateway” Google search. For example:

Are these gateways also using the api or are they communicating directly? If directly, my follow up question would be, how, and why do we then need the api? On the other hand, if they are using the api, how will these gateway manufacturers deal with casambi charging for its use? I realize that you are not a casambi oem, I was just wondering if you had any thoughts on this.

Casambi Gateway X-Moment seem to talk BLE directly with the Casambi network, that’s what I get after reading the description. And of course the API for that communication over BLE is probably also well documented, probably only shared to Casambi partners. And of course that protocol can be reverse engineered, a similar efforts has already been done for Plejd (Plejd is more popular then Casambi here in Sweden) GitHub - klali/ha-plejd: Plejd component for Home Assistant

Aimotion finally clarified, there was a little confusion. Turns out the Ethernet gateway is a little over 300 euros. Which is still too expensive for me, in that case it’ll be cheaper to replace my devices for Fibaro alternatives, or purchase a cheap (second hand) android tablet.

I’ve been watching tutorials on YouTube and it’s looking more and more attractive to reverse engineer the Casambi BLE protocol. Has anyone ever attempted that for Casambi?

I have not found any previous work.

I think the cloud api works good enough for most and the user base that run casambi is quite small (tinkers that run homeassistant, home bridge etc).

Hi Olof, I am currently looking into adding support for a slider feature which enables controls of up/down fading e.g. for Occhio Sento light fixtures. I think it also need some addition to aiocasambi. Can you tell me, how I can access and edit the files in my devcontainer? In the HACS installation folder I only get the casambi component itself.

Right now aiocasambi is doing the heavy lifting, the home assistant plugin is more or less just reading the state, what you need to do is to add the functionality into aiocasambi.

Easiest is to start with a none Asynchronous api like GitHub - hellqvio86/casambi: Python code for controlling Casambi lights, add the functionality, then do the necessary changes in aiocambi (make a pr etc.)

This is a good asynchronous programming in home assistant: Asyncio 101 | Home Assistant Developer Docs

You also need to read up on the light entity (choose the right mode if it exists): Light Entity | Home Assistant Developer Docs

I am already working in my local devcontainer and applying changes to the light entity as well as your casambi integration. This way I can test everything in a running environment.

Is there no way to access the aiocasambi files in a HA installation? Or at least integrate a new version outside the official release process? Ideally I can to do functional testing on aiocasambi as well before I PR to your repository.

Edit: Ah, I did not see casambi is different from home_assistant_casambi. I will look into it later.

I fear I do not understand how you want me to use the casambi library.

Just in case there was some misunderstanding: I am running a docker container with HA on my computer. In this I am editing source code in the light integration and in the custom_component casambi (your home_assistant_casambi repository). Now I am reaching the limit because I cannot pass on additional control to aiocasambi. Instead of calling set_unit_value it might be almost done if I was able to use set_unit_target_controls which exists in your casambi repository but not in aiocasambi. That way I think I am able to change the “Dimmer” as well as the “Vertical” value.

If you still recommend using the none asynchronous API I guess I am in need of some help…

The easiest way to do it is to add the functionality ( set_unit_target_controls) to aiocasambi and I am happy to accept pull requests.

Just to be clear the library is asynchronous, so the function needs to be that as well, thats the way the communication over the websocket works :slight_smile: