Custom Component: PLCBUS

I didn’t have any plcbus device but can look at what’s wrong if you help

Cool , yes i’ve seen in Ha log. I post it when come back Home.
Thanx

WTF : it’s ok now !!!
I don’t know why …

I can see swtich in entity menu !!
Try tonight

1 Like

An error message:
Logger: homeassistant.components.switch
Source: components/switch/init.py:151
Integration: Interrupteur (documentation, issues)
First occurred: 16:20:13 (1 occurrences)
Last logged: 16:20:13

SwitchDevice is deprecated, modify PlcbusSwitch to extend SwitchEntity

And another:
Another Error:

Logger: root
Source: custom_components/plcbus/lib/PLCBusSerialHandler.py:138
Integration: plcbus ([documentation](https://github.com/tikismoke/home-assistant-plcbus))
First occurred: 16:32:31 (1 occurrences)
Last logged: 16:32:31

Uncaught thread exception

Traceback (most recent call last): File "/usr/local/lib/python3.9/threading.py", line 973, in _bootstrap_inner self.run() File "/config/custom_components/plcbus/lib/PLCBusSerialHandler.py", line 266, in run self._send(item) File "/config/custom_components/plcbus/lib/PLCBusSerialHandler.py", line 150, in _send explicit_frame = self.explicit_message(plcbus_frame) File "/config/custom_components/plcbus/lib/PLCBusSerialHandler.py", line 138, in explicit_message r["d_command"] = cmdplcbus[r["data"][4:6]] KeyError: 'c0'

I confirm it works:

I confirm it works:
Problem was in yaml: i put ’ her ‘01’

# Plcbus
switch:
  - platform: plcbus
    device: '/dev/ttyUSB1'
    user_code: '01'
    unit: [P1,P2,P3,P4,P5,P6,P7,P8]

Ok that’s seems easy to update the extend switch, I’ll have a look but next year :shushing_face::yum:

Are you sure you’re running the last version of the integration, 1.0.1?

I look at the code and it’s already extend switchentity instead of switchdevice

Many Thanx for reply and have à fabulous new year.
No i ve 0.0.2 version that is the last no ?

I have download all github repository and install it manually.
I’ve now good version and no error !!

Can you tell me how interrogate device to update their state : if someone manualy switch light on ?
Thanx

Many Thanx for reply and have à fabulous new year.
No i ve 0.0.2 version that is the last no ?

I have download all github repository and install it manually.
I’ve now good version and no error !!

Can you tell me how interrogate device to update their state : if someone manualy switch light on ?
Thanx

It polls all devices every minute if I remember correctly. So the state xill be automatically be update when someone switch manually

But yes it’s true !
It’s a little longer for me: a few minutes but not serious :slight_smile: Many thanx

Hello all,
Try to install plcbus over hassio home assistant 2023.5.2 I get an error when I check the configuration…it seams that we needs ‘pyudev==0.22.0’, ‘pyserial==3.4’
Error message is:
Platform error switch.plcbus - Requirements for plcbus not found: [‘pyudev==0.22.0’, ‘pyserial==3.4’].

How can we add this libs to plcbus or Hassio?

Thanks in advance
Hernan

Maybe try to install them manually or edit the requirements file to remove the version number, maybe some others block this.

As said all PullRequest are welcome, as I do no more own any plcbus device anymore it’s difficult to follow or update the code.