sander1988 / Indego

Home Assistant Custom Component for Bosch Indego Lawn Mower
Apache License 2.0
95 stars 29 forks source link

Alert attributes are removed each 10 minutes #224

Closed Albert994 closed 5 months ago

Albert994 commented 5 months ago

I want to create an automation which sends a notify message to my smartphone when a new alert occurs. Therefore I use following trigger:

platform: state
entity_id:
  - binary_sensor.indego_xxx_alert
attribute: last_alert_date

Unfortunately the automation gets triggered each 10 minutes, because the attributes are removed shortly:

This is the first state change where the attribute are "removed"

this:
  entity_id: automation.indego2_problem
  state: 'on'
  attributes:
    id: '1711376097352'
    last_triggered: '2024-06-02T15:02:23.998593+00:00'
    mode: single
    current: 0
    friendly_name: Indego2 Problem
  last_changed: '2024-06-02T15:53:15.899850+00:00'
  last_reported: '2024-06-02T15:53:15.899850+00:00'
  last_updated: '2024-06-02T15:53:15.899850+00:00'
  context:
    id: 01HZCTFBBVYPM0NY797VMPBDES
    parent_id: null
    user_id: 7e8a1cbf114b4af6b5f9e8f8e8408cf2
trigger:
  id: '0'
  idx: '0'
  alias: null
  platform: state
  entity_id: binary_sensor.indego_xxx_alert
  from_state:
    entity_id: binary_sensor.indego_xxx_alert
    state: 'on'
    attributes:
      alerts_count: 10
      last_alert_error_code: '104'
      last_alert_message: >-
        Stopptaste wurde betätigt. Die Stopptaste wurde betätigt. Bitte folgen
        Sie den Anweisungen im Display des Mähers.
      last_alert_date: '2024-06-01 21:02:35'
      last_alert_read: unread
      device_class: problem
      friendly_name: Indego alert
    last_changed: '2024-06-02T15:52:20.723717+00:00'
    last_reported: '2024-06-02T16:02:20.739751+00:00'
    last_updated: '2024-06-02T15:52:41.192786+00:00'
    context:
      id: 01HZCTE9F8AS99TJC5XZ364A47
      parent_id: null
      user_id: null
  to_state:
    entity_id: binary_sensor.indego_xxx_alert
    state: 'on'
    attributes:
      alerts_count: 10
      device_class: problem
      friendly_name: Indego alert
    last_changed: '2024-06-02T15:52:20.723717+00:00'
    last_reported: '2024-06-02T16:02:42.315010+00:00'
    last_updated: '2024-06-02T16:02:42.315010+00:00'
    context:
      id: 01HZCV0MGB8ZBRPNNFHJ0BWTJX
      parent_id: null
      user_id: null
  for: null
  attribute: last_alert_date
  description: state of binary_sensor.indego_xxx_alert

and directly afterwards the attributes "come back":

this:
  entity_id: automation.indego2_problem
  state: 'on'
  attributes:
    id: '1711376097352'
    last_triggered: '2024-06-02T16:02:42.316097+00:00'
    mode: single
    current: 1
    friendly_name: Indego2 Problem
  last_changed: '2024-06-02T15:53:15.899850+00:00'
  last_reported: '2024-06-02T16:02:42.316317+00:00'
  last_updated: '2024-06-02T16:02:42.316317+00:00'
  context:
    id: 01HZCV0MGB915YBW18NB940RAC
    parent_id: 01HZCV0MGB8ZBRPNNFHJ0BWTJX
    user_id: null
trigger:
  id: '0'
  idx: '0'
  alias: null
  platform: state
  entity_id: binary_sensor.indego_xxx_alert
  from_state:
    entity_id: binary_sensor.indego_xxx_alert
    state: 'on'
    attributes:
      alerts_count: 10
      device_class: problem
      friendly_name: Indego alert
    last_changed: '2024-06-02T15:52:20.723717+00:00'
    last_reported: '2024-06-02T16:02:42.315010+00:00'
    last_updated: '2024-06-02T16:02:42.315010+00:00'
    context:
      id: 01HZCV0MGB8ZBRPNNFHJ0BWTJX
      parent_id: null
      user_id: null
  to_state:
    entity_id: binary_sensor.indego_xxx_alert
    state: 'on'
    attributes:
      alerts_count: 10
      last_alert_error_code: '104'
      last_alert_message: >-
        Stopptaste wurde betätigt. Die Stopptaste wurde betätigt. Bitte folgen
        Sie den Anweisungen im Display des Mähers.
      last_alert_date: '2024-06-01 21:02:35'
      last_alert_read: unread
      device_class: problem
      friendly_name: Indego alert
    last_changed: '2024-06-02T15:52:20.723717+00:00'
    last_reported: '2024-06-02T16:02:50.740615+00:00'
    last_updated: '2024-06-02T16:02:42.320909+00:00'
    context:
      id: 01HZCV0MGGHAN37G8Z8W0DZERD
      parent_id: null
      user_id: null
  for: null
  attribute: last_alert_date
  description: state of binary_sensor.indego_xxx_alert

I tested it with version 5.6.1 and the newest beta version 5.7.0b1. The behavior is the same.

sander1988 commented 5 months ago

Thanks for reporting. I understand why (side effect of another fix), will try to resolve it within a couple of days.

sander1988 commented 5 months ago

The fix is on the develop branch and I also created a new beta (5.7.0b2). Please test if it's resolved.

Albert994 commented 5 months ago

Thanks, I will test it and give feedback.

Albert994 commented 5 months ago

It's running since yesterday w/o issues. Thanks a lot for fixing it!