Howto create battery alert without creating a template for every device

Any idea to make this excellent code as an Addon?
This way HA will display when a new version is published and the update is done with a button.

Just some wishful thinking.
Cheers.

1 Like

I like the way you’re thinking. That’s an awesome idea. It should be pretty easy to do.

Its normally genereated by the same entity, but its not the same entity every time.
It seems its related to zwave battery powered devices.
Example:

Thanks for the very fast update.
I will get that integrated during the next days.
Will let you know how it works out.

The automations only trigger on state changes. There must be reason why that device is updating it’s state so often. Can you look to see why that z-wave device is sending so many state changes?

Release 1.0.9 is available now. I finally figured out how to automatically create a group that contains all battery entities. If you created a Battery Status group manually, you can remove that from your config.

Installed version 1.0.10 (Hassio 0.71.0) and I am not getting a “group.update_battery_status_group_members” in my DT-Sates overview.
Should I?

I can see the “Update Battery Status Group Members” option in the “group.battery_alert”-view in my HA.

The group should have an entity_id of group.battery_status and friendly name of “Battery Status”.

My bad!

I had named my prevoius (version 1.0.8) group for the battery level sesnor
“group.battery_status”. And this mixed up my setup. All smile now.

1 Like

I installed your package and it seems working good except the customize section.
I want to disable the creation of some sensors and added the customize section regarding this in this way:

homeassistant:
  customize:
    sensor.sensore_illuminazione_corridoio_battery:
      battery_sensor_creation_disabled: true
    sensor.sensore_illuminazione_studio_battery:
      battery_sensor_creation_disabled: true
    sensor.fha_zanzito_battery:
      battery_sensor_creation_disabled: true
    sensor.maurizio_zanzito_battery:
      battery_sensor_creation_disabled: true
    sensor.umidita_balcone_battery:
      battery_sensor_creation_disabled: true
    sensor.umidita_camera_letto_battery:
      battery_sensor_creation_disabled: true
    sensor.umidita_salotto_battery:
      battery_sensor_creation_disabled: true
    sensor.presa_1_battery:
      battery_sensor_creation_disabled: true
    sensor.presa_2_battery:
      battery_sensor_creation_disabled: true
    sensor.presa_3_battery:
      battery_sensor_creation_disabled: true
    sensor.pressione_balcone_battery:
      battery_sensor_creation_disabled: true
    sensor.pressione_camera_letto_battery:
      battery_sensor_creation_disabled: true

I added this firstly to my customize.yaml and it did not work, then i added these entries directly to the package, but it seems not working the same as those sensors i want to not be created are still on my battery status group. How to not have those sensors displayed in that group and where to put that customize section?

battery_sensor_creation_disabled should be applied to the entity that has the battery attribute. Since you already have the battery sensors created, you’ll need to clear those retained mqtt topics after you update your customize section to the right entities.

Hmmm… Can you tell me how to do what you advice me? How to clear the mqtt topics? Sorry but really newbie here…

The easiest option is to uninstall and reinstall the Mosquitto add-on.

Too complicated for me… I give up…:rofl:

Interesting, I see exactly the same issue even though I added them to customise and then cleared the topics (sending an empty payload) but they keep being created.
If I click on one of them, even the battery_sensor_creation_disabled is showing as true
I am puzzled by that now.

battery_sensor_creation_disabled needs to be set on your Pressure Upstairs entity, not Pressure Upstairs Battery entity.

Thanks.
I’ve tried every single entity ID and can’t make it work.
Everything with humidity/pressure I just added it customise , cleared the topics and it’s still showing up.
Pretty sure I am doing something wrong but can’t find what.

Can you go to the States panel (http://hassio.local:8123/dev-state), search for Pressure Upstairs in the attributes column, then post a screenshot? It should look something like the screenshot below.

Sure thing, here you go:

Add this to your customize section, restart Home Assistant, clear the retained topics, then restart Home Assistant one more time.

homeassistant:
  customize:
    sensor.pressure_158d0001a21e25:
      battery_sensor_creation_disabled: true