Homematic IP Batterylevels

I want Home Assistant to send me a notification when a device at home reports a low battery. This already works great for Ring cameras and various other devices. The problem is with Homematic IP devices. We have quite a few of them in the house—from window sensors to wall thermostats and heating thermostats, all the way to a gate control system. All Homematic IP devices are connected to the cloud via an access point, and I can control all devices in the Homematic IP app and check their current status.

I have now integrated this access point using the standard integration in Home Assistant. For most devices, I can also see a battery. The status is displayed as “Normal.” However, two devices with batteries are offline. This matches what the Homematic IP app reports.

Unfortunately, the charge level isn’t displayed as a percentage, but only as “Normal,” whatever that means. I recently discovered via a Google search that you can enable an inactive entity called “Operating Voltage” under Devices > Diagnostics. But… none of the devices have a “Diagnostics” section, nor do they have any inactive entities or an operating voltage. Why is that, and what can I do about it?

Another tip recommended installing “Battery Notes.” I did that. But now it’s showing me a total of 6 Homematic IP devices that are at 0%. I think that could only be true for the 2 devices (the two that are no longer accessible). I’m now getting warnings for devices whose batteries are definitely full (or at least “Normal”). So I’ve uninstalled “Battery Notes” again.

How can I get relatively accurate values for the batteries? I want the warning to be sent only when the battery charge level drops below 15%.

BTW: Is there a way to communicate with the access point locally, without using the cloud, or do I need something else for that?

There are a couple of blueprints that the community have written to do this.
Search the blueprint exchange here to use one or to reference how they are doing it by referencing their code.

and here are some more ideas:

alias: "@Battery check at 18:00"
description: >-
  Check batteries daily and send a notification when any sensor battery is below
  10% and include the name of sensor and battery level. Unwanted sensors are
  excluded.
triggers:
  - at: "18:00:00"
    trigger: time
conditions:
  - condition: template
    value_template: "{{ message_to_send | trim | length > 0 }}"
actions:
  - action: notify.mobile_app_myphone
    data:
      message: "{{ message_to_send }}"
      title: "Battery check"
mode: single
variables:
  excluded:
    - sensor.myphone_battery
    - sensor.mycar_battery
    - sensor.myups_battery
  threshold: 10
  message_to_send: >-
    {% set ns = namespace(result=[]) %}
    {%- for s in states.sensor
       | selectattr('entity_id', 'match', 'sensor\..*battery*')
       | rejectattr('entity_id', 'in', excluded)
       | selectattr('state', 'is_number') %}
      {%- if s.state | int(0) < threshold | int(0) %}
        {%- set ns.result = ns.result + [(s.name, s.state)] %}
      {%- endif %}
    {%- endfor %}
    {%- for name, state in ns.result %}
      {{ name }}: {{ state }} %
    {%- endfor %}

It’ll notify you whenever any sensor with battery’ in it is below 10% (except the ones excluded) and tell you which ones along with its current level.