I’m at my wits end with a trigger based sensor which is based on the same pattern as one that has been working for 6 months. They both have this structure:
- trigger:
- trigger: time_pattern
minutes: "8"
- trigger: time_pattern
minutes: "23"
- trigger: time_pattern
minutes: "38"
- trigger: time_pattern
minutes: "53"
action:
- service: rest_command.getgnss15
response_variable: gnss
- variables:
kalman: >
{%- set kalman = [pred_lo, [pred_hi, kalman_raw] | min] | max %}
{{ kalman }}
# there are a load of these a handful of which use attributes from the previous firing: like
this_t: >
{%- set prev = states.sensor.gnss15k2da.attributes if states.sensor.gnss15k2da is defined and states.sensor.gnss15k2da.attributes is defined else {} %}
{%- set prevt = prev.get('this_t') %}
{%- set this_t = feeds[1].created_at if feeds | length > 1 else prevt %}
{{ this_t }}
sensor:
- name: gnss15k2da
unique_id: gnss15k2da
state: >
{{ kalman | round(4) }}
state_class: measurement
unit_of_measurement: m
attributes:
fired_at: "{{ utcnow() | string }}"
The original sensor is gnss15 and fires every time. This derivative is more complex (a 2D kalman filter vs the original 1D filter), but the structure is the same. It fires exactly once after it is created (or renamed) then never again. In case it was a doom loop caused by using its previous attributes I created a separate trigger sensor to store its attributes 1 minute afterwards with its own attribute fired_at and that one also only ever fired the once. I can duplicate the original with a new name and that fires every time too. In case the times clash I’ve notused exactly the same time triggers.
There is nothing in the logs and the exact code shows no errors in developer tools.
I have spent several days on this, with and without the help of Claude AI and I’m completely stuck. Can anyone shed any light on what is going wrong?
I’m running HAos on an x286 miniPC with everything up-to-date.