I’m looking to control CASAMBI drivers with Home Assistant. Casambi website. Casambi uses bluetooth LE to control lights. Is this possible?
Hi. I see this was requested a long time ago. I cannot find any documentation that confirms if this is now integrated.
Status - 1 year later - Casambi recently updated their firmware to “evolution” grade release. This doesn’t mean that it is any shape or form talking to anything else than their own app. ;-((((
Statement - Casambi system is not compatible with any Smart Home systems such as Google Home, Alexa, Apple HomeKit etc. This means that Casambi enabled luminaires cannot be controlled with these solutions. At this point we are not looking into adding this possibility.
To all HAS developers - will Home Assistant be the first platform to support this?
I have been looking for something like this too.
Have also been in contact with a European importer for ‘all things Casambi’.
He advised me to use the Liga Air TAST4.240 or the Liga Air TAST4.12-24.
However I ordered the Casambi SC-TI-CAS.
That is the bluetooth transmitter to start/stop up to 4 scenes.
However, to fire things off relais (potential free) are needed to fire off a 0,5s pulse.
For that I ordered the Devantech dS378.
They are available in different types and sizes (1,2,4 etc relais, programmable, wifi, ethernet) but I chose this one.
Hope to build it together next week
Casambi released their Cloud API last month: https://casambi.com/news/functionality-cloud-API.html
Hope this is useful for any developers looking into adding Casambi support to Home Assistant.
I have a working PoC using the cloud api if there is any interested. Android phone acting Casambi gateway, raspberry pi running python daemon sending MQTT messages to home assistant. It works fine, but the Casambi gateway is a bit unstable.
I have not got around to build a integration yet, but I can turn on and off my Casambi lights with Google Home which was my end goal.
I’m very interested how you have it all setup. (Guessing by your name your a Swede?)
Care to share some of your doings?
Yes I am from Sweden, here you go https://github.com/olofhellqvist/casambimqttbridge
Its very rough and I am currently rewriting it and the library, so its more suitable for home assistant (building my own integration), but that’s a long way from done
Hope it helps!
I’m unfortunately not so good in programming but really interesting if you get it into a more easy integration directly in homeassistant.
Tried to get some things working on my unraid server where I have homeassistant docker running.
However dont even get pass the first step “pip install casambi”
“No matching distribution”.
I guess I need to add your github as a repository first. Havn’t had much time to test yet. Just did some quick look into it.
I am working on an integration, but it will take a while.
casambi is a python3 library, so try pip3 install casambi (its available on pypi, thats how I install it on my machine).
You will need to clone the other script, git clone https://github.com/hellqvio86/casambimqttbridge.git
I run it under a screen now, I have not bothered to turn it into a daemon yet since I am working on the integration…
You need to request api key directly from casambi support, I have a link in the project readme
Hope it helps!
I have written a custom integration for home assistant ( casambimqttbridge is no longer needed). Its my first module, so a long way from done, it sure is unstable, anyway I can dimm my lights and turn them on and off. All lights are auto discovered. So I will continue on with this integration and scratch the other project.
Hope it can help someone
Thanks alot for all your efforts!
I am not too familiar with homeassistant since I primarily have been using only casambi for home automation but want to try and connect more things which could make it possible with Casambi API.
Now I just need to learn HomeAssistant
Anyway I am not sure what the different credentials are refering to.
I added them to secrets.yaml but I get a warning in the log that it connects to casambi but it cannot login.
network_password - Is this network ADMIN password?
user_password - Is this network USER password
Trying to connect to classic network.
Or have you created a site user? (Seems a bit overkill just to reach one network?)
I had to create a site user for accessing the api, its needed for creating the user session, so its needed and thats the “user_password”, the network_password is your ordinary casambi network password that you are using for the app (thats for the network session).
But you need to create a new site and have a gateway connected to the site (android or iphone). But the hardest was to convince Casambi support to give me an api key though, It can take some time, so I would start with that
The error handling is a long way from flushed out so the experience might be a bit rough, I am sorry for that. Got it working in home assistant and was very happy with that
The Casambi lights state is sent over a websocket (long lived constant network connection), the same connection is used for turning devices on, off and for dimming them. My sessions has just been running for 1-2 days, so I dont know how stable the integration it, but I would not be surprised if restart of home assistant is needed from time to time.
But isn’t it enough to create a network session to control lights?
Havn’t checked documentation enough but that’s what I thought.
Anyway not so hard to create a site so I test later on. Thanks for help.
Might be enough, need to do some tests and test it out
Managed to get the lamps in Homeassistant but control is not working.
I turn a lamp on and 5-10 seconds later the toggle turn itself off again.
The light actually never turns on.
Gateway is up and running and I can control the network from other phone through wifi (Bluetooth turned off).
I see following error in log
First occurred: 10:11:27 (1 occurrences)
Last logged: 10:11:27
websocket: Unexpected error ‘details’
Its crashing when its processing message from the casambi api (its pushed to home assistant over websocket). Its hard to say where since the key “details” is used all over the place in the api.
Can you enable more verbose logging and share the log? Please omit credentials
I am not too familiar with what sensitive information is in the log (in general, not just casambi credentials).
I have the log and I can see Casambi credentials which I will remove. But are there other things I should omit?
I basically have not setup anything but weather and chromecast units.
I have not seen the response that is generating the exception, so only the Casambi related logs, but I would not be willing to share my network session, user session, api_key, user_password, network_password, casambi unit names, hardware addresses. Basically I would mask everything Replace it with FF or something like foobar
Hopefully I can get the same response on my side and fix the handling, I have not seen it yet thou
See log in private message.