Wait for entity on HA start

I have automation that triggers on HA start but the issue is it needs entity from Danfoss Ally (zigbee) to work and from what errors says:

Unable to find referenced entities climate.danfoss_zig_thermostat

it’s not available at that moment. I know there are wait_for... things for action but I can find one that would wait until entity becomes available. Any clues?

You can try adding a wait for trigger action type like the below as the first action.
I dont know what is the state shown when the HA boots up, I assume it is either unavailable or empty. If that is so just use this.

action:
  - wait_for_trigger:
      - platform: template
        value_template: >-
          {{ states('climate.danfoss_zig_thermostat') != "unavailable" or
          states('climate.danfoss_zig_thermostat') != "" }}
    continue_on_timeout: false

If this doesnot work you can try the long version like below. This will check if the climate entity has any of the expected state before progressing.

action:
  - wait_for_trigger:
      - platform: template
        value_template: >-
          {{ states('climate.danfoss_zig_thermostat') == "heat" or
          states('climate.danfoss_zig_thermostat') == "cool" or
          states('climate.danfoss_zig_thermostat') == "off" or
          states('climate.danfoss_zig_thermostat') == "dry" or
          states('climate.danfoss_zig_thermostat') == "fan_only" or
          states('climate.danfoss_zig_thermostat') == "heat_cool" }}
    continue_on_timeout: false

Just a little correction - using the first approach you should put AND between the conditions, not OR.
In the described case the action will perform if the state will be unavailable, as the first condition will not be met, but the second one will be (unavailable is not equal “” and with OR one of conditions is met, so it triggers).

Thanks for suggestions! I’ll check if that will be enough for my setup today and let you know.
BTW How do you know what are possible states for entity? Is this because it’s thermostat type in this case?