BM6 Battery Monitor ESPHome

I had the same problem as a lot of others, worked sometimes for a bit, then stopped.

I’m not a python guy, I spent way to many hours with chatgpt reworking the code. Mine seems to work well now, I have had it running a couple of days with two bm6’s and they don’t seem to be missing any packets. I’m doing 59 and 61 seconds for update rates.

I also added a counter with two automations, they reset it once an hour so I can quickly see if it’s doing ok.

My fork is here if you want to try it, I won’t be able to help if there are any issues. (ask chatgpt :slight_smile: )GitHub - bsrotten/BM6: Home Assistant integration for Battery Monitor BM6

The automations:

alias: BM6 - increment success counter
description: ""
triggers:
  - event_type: bm6_success
    trigger: event
actions:
  - target:
      entity_id: counter.bm6_success_hour
    action: counter.increment
mode: queued


alias: BM6 - reset hourly success counter
description: ""
triggers:
  - minutes: "0"
    trigger: time_pattern
actions:
  - target:
      entity_id: counter.bm6_success_hour
    action: counter.reset
mode: single