home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
69.03k stars 28.28k forks source link

Timers not reporting status correctly #116835

Open Tinker180z opened 1 week ago

Tinker180z commented 1 week ago

The problem

I have timer loop that's part of a dump load control system for my solar panels. It runs on a 5 minute loop and checks the state of the solar panels and supply before making a decision on the dump load switches. The timer then resets and the cycle starts again. On the first trigger of the timer the timer shows correctly when viewed on the helpers page but when the state goes to 'idle' it appears that the programmed restart doesn't happen. However, if the page is reloaded and I look again at the timer, it will correctly show that the next countdown is in progress. It appears that the automation is responding to the states correctly but it was very confusing doing diagnostics when the timer appeared not to be functioning in either the overview pane or the helpers area. This may be a new way of displaying timers but it wasn't the case in before 2024.5

What version of Home Assistant Core has the issue?

2024.5.1

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

No response

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

alias: Solar loop test
description: ""
trigger:
  - platform: state
    entity_id:
      - timer.solar_loop_timer
    id: Main loop timer goes to idle
    to: idle
  - platform: state
    entity_id:
      - input_boolean.test_toggle
    to: "on"
    id: Intitial start event
condition: []
action:
  - choose:
      - conditions:
          - condition: trigger
            id:
              - Main loop timer goes to idle
        sequence:
          - service: timer.start
            metadata: {}
            data:
              duration: "15"
            target:
              entity_id: timer.solar_loop_timer
      - conditions:
          - condition: trigger
            id:
              - Intitial start event
        sequence:
          - service: timer.start
            metadata: {}
            data:
              duration: "5"
            target:
              entity_id: timer.solar_loop_timer
mode: single

Anything in the logs that might be useful for us?

No errors - just the timer doesn't show it's actually running - I spent a couple of hours going around in circles before I realised that the timer is running but it's just invisible until the page is reloaded

Additional information

The timer loop YAML above is created only to show how I've got the timer loop running - it does create the same response from the point of view of the timer displaying only when the pages are reloaded Prior to reload image: image After reload image image

filslava commented 1 week ago

Timers are actively used in my configuration. In version 2024.5.0 and 2024.5.1 It is not possible to edit the properties of timers created in the "Helpers" tab. They can't be deleted now either. In addition, the timers created earlier work with errors. More precisely, their launch is accompanied by an error: Error executing script. Unexpected error for call_service at pos 1: 'NoneType' object has no attribute 'tzinfo'

Tinker180z commented 1 week ago

I've noticed that timers created on-the-fly within an automation are not deletable from within the companion app and remain visible from there even when they are not deleted and not visible within the main web interface to the helper page. On the app they show as "This entitiy ("timer.name") does not have a unique ID, therefore its settings cannot be managed from the UK. See documentation for more detail."

It doesn't cause an issue at the moment, it's just clutter on the helper page.