Time pattern /10 not working on /0 and /30

I have two automation running with time_pattern at /10, which works for :10, :20, :40, :50, but somehow not for :0 and :30:. I checked the docs but I don’t understand why it won’t work. I also have automations with time_pattern at /30 that do trigger at :0 and :30.

Automation:

alias: Publish Itho to MQTT (/10)
description: ""
trigger:
  - platform: time_pattern
    minutes: /10
condition: []
action:
  - service: mqtt.publish
    data:
      topic: >-
        influx/temperaturev3/location/outside/room/supply/quantity/actual/source/itho_hru/value/state
      payload: "{{states.sensor.itho_hru_supply_temp.state}}"
  - service: mqtt.publish
    data:
      topic: >-
        influx/temperaturev3/location/outside/room/exhaust/quantity/actual/source/itho_hru/value/state
      payload: "{{states.sensor.itho_hru_exhaust_temp.state}}"
  - service: mqtt.publish
    data:
      topic: influx/systemv3/quantity/supply_fan_actual/source/itho_hru/value/state
      payload: "{{states.sensor.itho_hru_supply_fan_actual.state}}"
  - service: mqtt.publish
    data:
      topic: >-
        influx/environv3/location/home/room/itho_max/quantity/CO2/source/itho_hru/value/state
      payload: "{{states.sensor.itho_hru_co2.state}}"
mode: parallel
max: 10

Looking at the database storing the mqtt values, I see it works mostly, but not always.

> select * from environv3 where source='itho_hru' order by desc  limit 20
name: environv3
time                 board location quantity room     source   value
----                 ----- -------- -------- ----     ------   -----
2024-05-12T11:20:00Z       home     CO2      itho_max itho_hru 541
2024-05-12T11:10:00Z       home     CO2      itho_max itho_hru 948
2024-05-12T10:50:00Z       home     CO2      itho_max itho_hru 1067
2024-05-12T10:40:00Z       home     CO2      itho_max itho_hru 1049
2024-05-12T10:20:00Z       home     CO2      itho_max itho_hru 1013
2024-05-12T10:10:00Z       home     CO2      itho_max itho_hru 910
2024-05-12T09:50:00Z       home     CO2      itho_max itho_hru 969

Any idea why this can be? I’m puzzled.

That should work, try putting /10 in quotes. “/10”

Take a look at the automation traces, what do they show?

You should be using states(“sensor.my_sensor”) instead of accessing states.sensors.

Thanks, good point on the traces, could’ve thought of that myself. In the end it turns out I did have a backend problem where my mqtt to influxdb bridge crashed on some malformed values, so it works as expected again :slight_smile:

What do you mean with the following? Where can I find the ‘proper’ method?

Scroll down to the states section is this document.

1 Like