Every minute mqtt publish automation does not work

I am a brand new user in home-assistant, but have years in other domotica solutions.
I want to send every minute the state of a sensor to my mosquitto mqtt host. Below is only one of the many sensor values I want to send (but you have to start with the first).
From the development I manually do:

service: mqtt.publish
data:
  topic: homeassistant/woonkamer/heating
  payload_template: '{{ states(''sensor.woonkamer_heating'') }}'

That works great.

But I want to do it automatically every minute to be able to create nice graphs:
In automations.yaml I have:

  trigger:
    platform: time
    minutes: '/60'
    seconds: 00
  action:
     - service: mqtt.publish
       data:
         topic: homeassistant/woonkamer/heating
         payload_template: '{{ states(''sensor.woonkamer_heating'') }}'

But I do get an error that my configuration in automations.yaml is not correct.

It would be useful to know the specific error.

This,
minutes: '/60'
Should be:
minutes: '/1'

If you want it to occur every minute.

Edit: also what Troon said below.

1 Like

Your trigger should be a time_pattern platform, not time: docs.

Thanks all. It is now working fine.
I don’t get a config error anymore (and sorry for not posting that one).

I changed time to time_pattern (I copied time from another post) and changed the '/60' to '/1'
My config is now (as example for others):

  trigger:
    platform: time_pattern
    minutes: '/1'
    seconds: 00
  action:
     - service: mqtt.publish
       data:
         topic: homeassistant/woonkamer/heating
         payload_template: '{{ states(''sensor.woonkamer_heating'') }}'
3 Likes