Centralite Elegance - Integration error: centralite - Integration 'centralite' not found

Hello,

I am trying to add the centralite custom component provided by @kohai-ut. I followed the instruction given in the readme file in the project “GitHub - kohai-ut/centralite_elegance: centralite eLite for home assistant”, but I am still getting the error : “Integration error: centralite - Integration ‘centralite’ not found.”

I have created the centralite folder under the custom_components, put all the files in GIT and checked that the folder and file rights are the same as other custom components.

Does anyone have an idea of how to solve it?

I am running Home Assistant Core Version 2021.12.3

Thanks in Advance
Etienne

Did you restart HA?
Also, be sure to restart before adding the configuration of this integration, or you will have to reboot.

I can’t tell from your description what the problem is. I would make sure your ~/centralite folder is in the right location (should be config/custom_components/centralite). Do you have any other logs for further detail? It may be helpful to see what you put in your configuration.yaml.

You may be the first person to try my custom integration. Hopefully I didn’t miss anything in the readme steps.

Looks like the manifest.json needs a version tag. I added a version tag and I am not getting the configuration is invalid error anymore

{

  "domain": "centralite",

  "name": "Centralite Integration",

  "documentation": "https://github.com/kohai-ut/centralite_eLite",

  "version": "0.0.0.0",

  "requirements": [],

  "dependencies": [],

  "codeowners": ["@pashar1", "@kohai-ut"]

}

After doing the change in the manifest I had to reboot as @koying suggested.

Tonight I will get by Serial to USB converter and will try to do some integrations.

Thanks @koying @kohai-ut a lot for your support

Yep, definitely needed.
@kohai-ut you definietely want to add that to your component, or nobody can use it really :wink:

My local version has it. I thought github had it as well but must not have been updated. Weird.

One comment on serial-to-usb. You can reference the port as (with your actual ttyUSBx)

port: /dev/ttyUSB1

or you can reference it by ID. As an example:

port: /dev/serial/by-id/usb-Prolific_Technology_Inc._USB-Serial_Controller_D-if00-port0

The upside of reference by ID is that if on reboot your usb moves from ttyUSB0 to ttyUSB1, referencing by ID doesn’t break your configuration. One warning is that if you have more than one serial-to-usb that are the same model, sometimes the manufacturer uses the same ID for every device so they aren’t unique.

You can find your usb settings from a command line:
dmesg |grep usb

update: I double checked my local repo versus the github copy. There is one possibly meaningful change I was debugging that isn’t on the github version but I’m not convinced it matters. If you have issue with lights let me know or message me.

Hello @kohai-ut

Thanks for your support. I got my cable finally :slight_smile: I connected the elegance to my pi. The scenes seems working, but I cannot see the lights. I can see that they are being added, but I cannot find them as an entity.

2021-12-27 15:55:13 DEBUG (SyncWorker_1) [custom_components.centralite]      LJDevice after get load name, self._name is L021

2021-12-27 15:55:13 DEBUG (SyncWorker_1) [custom_components.centralite] we are in class LJDevice

2021-12-27 15:55:13 DEBUG (SyncWorker_1) [custom_components.centralite]      LJDevice incoming name is L021

2021-12-27 15:55:13 DEBUG (SyncWorker_1) [custom_components.centralite]      LJDevice after get load name, self._name is L021

2021-12-27 15:55:13 DEBUG (SyncWorker_1) [custom_components.centralite.light]     Light loaded succesful:  L021

2021-12-27 15:55:13 DEBUG (SyncWorker_1) [custom_components.centralite.light] init of the light for 22

2021-12-27 15:55:13 DEBUG (SyncWorker_1) [custom_components.centralite.light]     init of the light self._name is L022

2021-12-27 15:55:13 DEBUG (SyncWorker_1) [custom_components.centralite] we are in class LJDevice

2021-12-27 15:55:13 DEBUG (SyncWorker_1) [custom_components.centralite]      LJDevice incoming name is L022

2021-12-27 15:55:13 DEBUG (SyncWorker_1) [custom_components.centralite]      LJDevice after get load name, self._name is L022

2021-12-27 15:55:13 DEBUG (SyncWorker_1) [custom_components.centralite] we are in class LJDevice

2021-12-27 15:55:13 DEBUG (SyncWorker_1) [custom_components.centralite]      LJDevice incoming name is L022

2021-12-27 15:55:13 DEBUG (SyncWorker_1) [custom_components.centralite]      LJDevice after get load name, self._name is L022

2021-12-27 15:55:13 DEBUG (SyncWorker_1) [custom_components.centralite.light]     Light loaded succesful:  L022

2021-12-27 15:55:13 DEBUG (SyncWorker_1) [custom_components.centralite.light] init of the light for 23

2021-12-27 15:55:13 DEBUG (SyncWorker_1) [custom_components.centralite.light]     init of the light self._name is L023

2021-12-27 15:55:13 DEBUG (SyncWorker_1) [custom_components.centralite] we are in class LJDevice

2021-12-27 15:55:13 DEBUG (SyncWorker_1) [custom_components.centralite]      LJDevice incoming name is L023

2021-12-27 15:55:13 DEBUG (SyncWorker_1) [custom_components.centralite]      LJDevice after get load name, self._name is L023

2021-12-27 15:55:13 DEBUG (SyncWorker_1) [custom_components.centralite] we are in class LJDevice

2021-12-27 15:55:13 DEBUG (SyncWorker_1) [custom_components.centralite]      LJDevice incoming name is L023

2021-12-27 15:55:13 DEBUG (SyncWorker_1) [custom_components.centralite]      LJDevice after get load name, self._name is L023

2021-12-27 15:55:13 DEBUG (SyncWorker_1) [custom_components.centralite.light]     Light loaded succesful:  L023

2021-12-27 15:55:13 DEBUG (SyncWorker_1) [custom_components.centralite.light] init of the light for 24

2021-12-27 15:55:13 DEBUG (SyncWorker_1) [custom_components.centralite.light]     init of the light self._name is L024

2021-12-27 15:55:13 DEBUG (SyncWorker_1) [custom_components.centralite] we are in class LJDevice

2021-12-27 15:55:13 DEBUG (SyncWorker_1) [custom_components.centralite]      LJDevice incoming name is L024

2021-12-27 15:55:13 DEBUG (SyncWorker_1) [custom_components.centralite]      LJDevice after get load name, self._name is L024

2021-12-27 15:55:13 DEBUG (SyncWorker_1) [custom_components.centralite] we are in class LJDevice

2021-12-27 15:55:13 DEBUG (SyncWorker_1) [custom_components.centralite]      LJDevice incoming name is L024

2021-12-27 15:55:13 DEBUG (SyncWorker_1) [custom_components.centralite]      LJDevice after get load name, self._name is L024

2021-12-27 15:55:13 DEBUG (SyncWorker_1) [custom_components.centralite.light]     Light loaded succesful:  L024

Furthermore, am I correct in saying that the switches are not supported yet?

Thanks a lot for your support!

Etienne

I just pushed my debug version of light.py to github. Pull down that version of light.py and try it out. I was having trouble at some point and in debuging made one change to get the lights to show up in the UI. As I’ve been modifying someone else’s code ot get this centralite working (and I’m not a python guru), I’m sometimes making best guesses. :slight_smile:

Switches aren’t working as I’m not sure where to put the call in the code to update status. My understanding of HA architecture is limited and I keep getting stuck. I’ll try to take a look at it. I’d like to get the switches working because I’d like to trigger automations off of button presses.

Hello @kohai-ut ,

It worked :slight_smile: I will try to have a look at the switches as well and also if we can actually use the dimmer functionality.

Do you have a guide of the codes that can be sent to centralite? I had it once, but I cannot find it

Thanks again

Regards
Etienne

In looking at the switch code, right now it is seeing ‘presses’ and ‘releases’. The UI doesn’t show much change as a press will turn on the toggle and the release will turn off the toggle. There is no concept of a press-and-hold to dimm. In HA, the code can just set the brightness level so I don’t think a press-and-hold concept is needed. Can you think of one? I guess if you want to press to dimm via the HA UI it would be helpful but I’m not sure if a switch entity can do that.

I never got the get_all_switch_states or get_all_load_states code working. I’m looking at that. I do have the PDF files for the programming codes. Here’s a link to my copies: http://vps2.tincreek.com/centralite/

I created a branch repo on my github for testing. In digging, I see a couple of problems with the code.

  1. The _sendrecv() function conflicts with the while loop that is reading the serial/RS232 input. The while loop always gets the response that the _sendrecv() is anticipating. The code I started with already had this design approach but due to this problem, today in my branch I’ve moved to letting the while loop recognize the hex status responses. I’ll probably move away from _sendrecv() and just use _send() unless I find a way to deal with that.

  2. I noticed that the hex2bin for load/lights is a different encoding scheme than it is for switches (according to Centralite docs). Wow. Anyway, I copied the hex2bin to a new function for switches, but I haven’t validated it is working right.

  3. The big odd thing… when asking my Centralite system (^G) for the load/light status, I get a hex string back as anticipated. BUT, when I ask the Centralite system for the switch status (^H), I only get back zeros. I get the right number of digits/characters but they are all zeros. It isn’t clear to me if this is only showing me which switches are being PRESSED at that moment or if it is supposed to be showing me which switches have a light on them.

  4. The hex status update functionality for lights/loads isn’t that important because the state of the lights are discovered on bootup. Then the centralite always reports to HA when it is changed. So, Centralite and HA stay in sync.

  5. The status of switches is more unknown. However, the code does report from Centralite to HA a pressed switch and a released switch. That is useful for triggering automations in HA, but the status/state is not tracked. HA can see that the light/load itself is on/off but it can’t tell that from the switch state. It works for programming in nodered, but it’s not elegant on the UI side.