Skip to content

Releases: andrew-codechimp/HA-Battery-Notes

2.3.10

01 Jul 08:50
cd7c6d6
Compare
Choose a tag to compare
2.3.10 Pre-release
Pre-release

What's Changed

  • Battery plus will now restore state for sleeping devices
  • Update Greek translation (thanks Thunderstrike116 via Crowdin)
  • Increased minimum HA version to 2024.4

2.3.9

13 Jun 13:11
a2a2d25
Compare
Choose a tag to compare

What's Changed

  • Fix service call null device/entity id issue #1750
  • Updated Russian translation, thanks LordArrin via Crowdin
  • Updated French translation, thanks tunisiano187 via Crowdin
  • Added Serbian (Latin) translation, thanks @darkobg79

Sorry for the repeated releases, localisation is hard!

2.3.8

13 Jun 09:50
2fe616d
Compare
Choose a tag to compare

What's Changed

  • Fix service call null device/entity id issue #1750
  • Updated Russian translation, thanks LordArrin via Crowdin
  • Updated French translation, thanks tunisiano187 via Crowdin
  • Added Serbian (Latin) translation, thanks @darkobg79

2.3.7

13 Jun 09:00
Compare
Choose a tag to compare

What's Changed

  • Fix service call null device/entity id issue #1750
  • Updated Russian translation, thanks LordArrin via Crowdin
  • Updated French translation, thanks tunisiano187 via Crowdin
  • Added Serbian (Latin) translation, thanks @darkobg79

2.3.6

12 Jun 07:32
defea52
Compare
Choose a tag to compare

What's Changed

  • Fix service call null device/entity id issue #1750
  • Updated Russian translation, thanks LordArrin via Crowdin
  • Added Serbian (Latin) translation, thanks @darkobg79

2.3.5

04 Jun 07:36
79252b7
Compare
Choose a tag to compare

What's Changed

  • Fix blocking file io warning in HA 2024.6
  • Remove attributes from recorder
  • Updated Slovak translation, thanks Sonics007 via Crowdin

2.3.4

01 Jun 08:28
7b7f8ad
Compare
Choose a tag to compare

What's Changed

  • Fix blocking file io warning in HA 2024.6

2.3.3

30 May 11:16
6ad5771
Compare
Choose a tag to compare
2.3.3 Pre-release
Pre-release

What's Changed

  • Fix blocking file io warning in HA 2024.6

2.3.2

12 May 12:12
3bd94eb
Compare
Choose a tag to compare

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

2.3.1

11 May 08:03
8b59302
Compare
Choose a tag to compare
2.3.1 Pre-release
Pre-release

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 these will not be updated until the official release, whilst in beta create your own automations or modify the blueprint manually.

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