Custom Component: PLCBUS

Hi all,

I’ve updated my old domogik plugin to control plcbus switch trough a 1141U usb device.

For now it allows only switch ON/OFF (no Dimmable, no Curtain, no Scenes)
it handle also only one-phase modules not 3.
scenes should be handle by Home Assistant neither it’s easier.
Note that due to a not found method for the moment it request all unit (making noise), going to use all_id_on_pulse to solve this but one of my unit module do not answer to those commands.

Still a lot to do, only basics are done for now (little more than just a POF :slight_smile: ).

Add it manually with HACS for now until i done more.

TODO:

  • Versionning
  • Test
  • Add to HACS
  • Need to create a real python lib on pypi
  • A day full home assistant components

Let me know help is welcome.

Hey, I recently started exploring home assistant and have a plcbus based system in my house.
. Although I am not yet familiar with the structure of home assistant, I have experience in python and managed to send commands to 3 phase system, create scene addresses etc using 1141.
Let me know if I can help (:

Of course.

Let’s have a look at the repo inside custom components. You’ll find the switch and the lib.

The lib as to be updated to allow 3 phases. Enjoy that you have once and somes competency :slight_smile:

I’m open to any help of course.
Note that I’m also new about 3 months of ha and not a great dev at all.

The 1st version is on good way.

3phases coming, Switch working, usb-serial adapter auto-discover, plcbus unit auto-discover too.

It’s now available directly in hacs as a custom integration :slight_smile:

Hi tikismoke, congratulations !!! and excelent work.
I use plcbus in my house I installed your plcbus custom component an I will try.
I saw that all the plcbus address that we configure in the configuration.yalm appears as switches. (A1, A2, etc…).
switch:

  • platform: plcbus
    device: ‘/dev/ttyUSB0’
    user_code: D1
    unit: [A1,A2,A3,A4,A5,A6,A7,A8]

unfortunally I can turn on/off my lights. it’s a message that says:
ERROR (Thread-4) [custom_components.plcbus.lib.PLCBusSerialHandler] WARN : Message 0205D10122000003 sent, but ack never received

I think that my serial connection is not configured correctly.
Is there something that I can do to troubleshoot it?

Thanks in advance
Hernan

Hi. Thanks

Are you sure about your house code d1?
What adapter and modules are you using?

Will look in the evening. I have some script that can help you to debug. You will have to open 2 ssh console and run some python code by hand to test.

What solution/software where your using before?

Hello Tikismoke,
I was using dianemo or linuxmce in the past - with them I could handle the dimmer function as well. by the way linuxmce is an opensource project and Hari was the developer of that plcbus module.
In the weekend I will check the model number of my adapters (I have dual module on/off and dual module dimmers) both are the mini version that can be installed inside the electricity box. My gateway is PLCBUS-1141.

I’m not shure about the D1 at all I installed this plcbus like 9 years ago, I will check that in the weekend.

If you can shared with me the script to test I will appreciate!!
Thanks
Best regards,
Hernan

Ok,
D1 house code it’s from 0 to 255 in hex 00 to FF so you could test them all, but it will take time :slight_smile:

Same gateway as mine so it will not be the problem. Dimmer will as i haven’t any of them.
Ido was working on 3 phase integration but no more news.

So has said you should refind your house code before any try (pretty sure it’s somewhere in linuxMce conf) and you will have to help me make dimmer works as i have nothing to test (hope you have some python knowledge :slight_smile: ).

Script example is here expect it’s bad truncated house code is D1 and 17 is the unit address (in fact 18-1):

So refind your house code and unit address and it will be easy for On/Off device.
Note that i upload all docs in the repo to help understand the protocols.

Hi Tikismoke,
Now I know that my house code is A1.
I tested it with plcbus.exe and for instance if I like to turn on A1 light the message that plcbus sends is “0205000022000003” and it works. but when I use home-assistance plugin it doesn’t work, (I’m testing with switch.plcbusswitch_a1_a1 from lovelace).

How I can debug this to know the message that plugin is sending?

Thanks
Hernan

Hi, you create yourself the switch?

Just add house code in the configuration y’all part.
It should poll the bus and show you all device available.
Or add directly A1 in the device list in config:

switch:

  • platform: plcbus
    device: ‘/dev/ttyUSB0’
    user_code: D1
    unit: [A1,A2,A3,A4,B6,B7,B8,B9]

In this case my house code is D1 it find all device automatically excepted A1 to A4 and b6 to b9.
I know those one exist and are the good one but they don’t answer to polling.

After that it will create all A,B and auto-discovered switch in ha.

Hello !!
I’m trying to install lcbus but i have a problem:
This is my parameters in configuration.yaml

'# Plcbus'
'switch:'
 ' - platform: plcbus'
'    device: '/dev/ttyUSB0''
'    user_code: 01'
'    unit: [A1,A2,A3,A4,B6,B7,B8,B9]  '

But i have this error:
Platform error switch.plcbus - Integration ‘plcbus’ not found.

Many thanx

did you install the integration with HACS?

Yes with HAcs? I’v ttied it again
I m newbie in Ha then i think i’ve lost something but …why :slight_smile:

i d’ont find the problem
Platform error switch.plcbus - Integration ‘plcbus’ not found.

Yaml must unclude custom_components no?

Not mine

On github somes are saying this have a try:

I just went through this error. In my case I had to install the files then restart the server management but do this before updating configuration.yaml. After that I made the configuration.yaml changes. The reason for this is that with the configuration.yaml changes in place the server manager saw the error and would not reboot.

Thanx but not.It’ not work
No error with 0.0.1 version

Where can i find: log and devices?

Thanx

plcbus seems no compatible with last HA versions …
No luck.

So you see something in HA logs?