Zigbee2mqtt automation not triggering pairing

I’ve installed the addon successfully and added a few devices, but I can’t get the “Allow devices to join” automation to trigger as described in the github instructions. If I trigger the automation manually, I can pair devices no problem, but I can’t see what’s wrong with the automation:

- id: enable_zigbee_join
  alias: Enable Zigbee joining
  hide_entity: true
    platform: state
    entity_id: input_boolean.zigbee_permit_join
    to: 'on'
  - service: mqtt.publish
      topic: zigbee2mqtt/bridge/config/permit_join
      payload: 'true'
  - service: timer.start
      entity_id: timer.zigbee_permit_join

The input_boolean entity exists and manually setting that to on fails to trigger the automation also.
Any ideas?

Find the automation in the dev-states menu (looks like <>), select the button next to it (looks like entity_box ) then push TRIGGER

If that doesn’t work, then it means the action is wrong in some way.

That’s the strange thing. If I do that the automation runs and I can add devices.
Setting the input_boolean.zigbee_permit_join to on thein either via Lovelace or manually does not trigger the automation.

Are you sure ‘on’ is the correct state for input_boolean.zigbee_permit_join? Perhaps ‘true’ ?

Yes, thanks I checked that. However, after a few glasses of wine and a good night’s sleep I realised that the automation needed initial_state: on added to it before it would run.
Sorted, thanks for the help.

To be technical it does not need initial state on. But you do need to turn it on.

initial state tells home assistant what to do on startup

initial_state: on - whenever home assistant starts the automation wil be turned on

initial_state: off - whenever home assistant starts the automation will be turned off

initial_state not set - whenever home assistant is started the automation will resume the on/off state that it was in before the restart - this is what most people actually want. If you set initial _state to on, if you turn an automation off because it is doing weird shit, or you simply don’t need it at the moment, then restart HA, it will be turned on again, contrary to expectation.

Thanks Nick for the clarification. I hadn’t realised there was a not set option, I’ll use that instead.