seime / openhab-esphome

ESPHome native API implementation for openHAB binding
MIT License
26 stars 6 forks source link

JK BMS not connection #19

Closed tistructor closed 3 months ago

tistructor commented 6 months ago

Hi, I was doing a test to detect a working esphome device in HA in openhab. I installed the binding and in INBOX I see the device detected. But when I try to do the thing it gives me a link problem.

The esphome device is JK's BMS, I also set the encryption key but the connection doesn't happen.

I just installed OpenHab and I'm a beginner.

seime commented 6 months ago

I would need some logs and screenshots to understand what you are meaning.

If you go to openhab home, choose "Settings", then under "Addon settings" select "ESPHome Binding". On the next page, set log level to DEBUG.

CleanShot 2024-04-30 at 12 57 37@2x

seime commented 3 months ago

If you are referring to https://github.com/syssi/esphome-jk-bms then the problem is uniqueness of channels. In the OH binding there is an attempt to use easy-to-understand channel names instead of the bloated "unique" entity ids coming from ESPHome. But in HA you can have identical names with different entity types. The problem in the config above is the <name> charging and <name> discharging channel which is duplicated both as a switch and a binary sensor. Ie https://github.com/syssi/esphome-jk-bms/blob/d557cc83dc685bf01631084da0402eabd91950a1/esp32-example.yaml#L68 and https://github.com/syssi/esphome-jk-bms/blob/d557cc83dc685bf01631084da0402eabd91950a1/esp32-example.yaml#L247

Suggested workaround: Update the config for the binary_sensor from

    charging:
      name: "${name} charging"
    discharging:
      name: "${name} discharging"

to

    charging:
      name: "${name} is charging"
    discharging:
      name: "${name} is discharging"
seime commented 3 months ago

No response from user