github andrew-codechimp/HA-Battery-Notes 2.3.2

latest releases: 2.3.10, 2.3.9, 2.3.8...
one month ago

What's Changed

🚀 Ability to add battery notes to entity's as well device's.

When an entity does not have a device, or a device has multiple battery entities you can now manually add a battery note and choose the specific entity you want the battery note associated with.

Discovery will still work on a device level and guess the correct battery so with devices that have multiple battery entities you will have to add these manually.

  • Updated Greek translations, thanks Thunderstrike116 via crowdin

⚠️ Breaking change to automations

This new feature requires a change to the Set battery replaced service, which now takes both an optional source_entity_id and device_id, one must be specified and source_entity_id is used if both are specified. All events now have data for the source_entity_id as well, which means you can modify your automations based on the events to call the service with both source_entity_id and device_id.

This will not break existing automations, but unless you add the source_entity_id to data any entity associated battery notes will not trigger the battery replaced service.

If you are using notification_id with the device_id this should be changed to also include the entity_id to distinguish multiple battery notes for the same device, e.g. notification_id: "{{ trigger.event.data.device_id }}-{{ trigger.event.data.source_entity_id }}"

If you are using the blueprints there are updates available to these to support the entity based battery notes, reimport the blueprints to get the updates.

alias: Battery Replaced
description: Battery Replaced
trigger:
  - platform: event
    event_type: battery_notes_battery_increased
condition: []
action:
  - service: battery_notes.set_battery_replaced
    data:
      device_id: "{{ trigger.event.data.device_id }}"
      entity_id: "{{ trigger.event.data.source_entity_id }}"
mode: queued
alias: Battery Low Notification
description: Battery Low Notification with auto dismiss
trigger:
  - platform: event
    event_type: battery_notes_battery_threshold
    event_data:
      battery_low: true
    id: low
    alias: Battery went low
  - platform: event
    event_type: battery_notes_battery_threshold
    event_data:
      battery_low: false
    id: high
    alias: Battery went high
condition: []
action:
  - choose:
      - conditions:
          - condition: trigger
            id:
              - low
        sequence:
          - service: persistent_notification.create
            data:
              title: |
                {{ trigger.event.data.device_name }} Battery Low
              notification_id: "{{ trigger.event.data.device_id }}-{{ trigger.event.data.source_entity_id }}"
              message: >
                The device has a battery level of {{
                trigger.event.data.battery_level }}% {{ '\n' -}} You need {{
                trigger.event.data.battery_quantity }}× {{
                trigger.event.data.battery_type }}
      - conditions:
          - condition: trigger
            id:
              - high
        sequence:
          - service: persistent_notification.dismiss
            data:
              notification_id: "{{ trigger.event.data.device_id }}-{{ trigger.event.data.source_entity_id }}"
mode: queued

Don't miss a new HA-Battery-Notes release

NewReleases is sending notifications on new releases.