Referenced entities are missing or not currently available

I’m kinda at a loss on this one. I have, what I think is, a pretty simple set up that isn’t working as I expect it to.

I have an input_boolean that I would like to turn on using an automation, delay for a period, and then turn it back off.

The problem is, my input_boolean entity is being reported as missing or unavailable when my automation is triggered.

This is my automation:

alias: Pause large loads
description: ""
triggers: []
conditions: []
actions:
  - action: switch.turn_on
    metadata: {}
    data: {}
    target:
      entity_id: input_boolean.prohibit_large_loads
  - delay:
      hours: 0
      minutes: "{{ states('input_text.force_mid_power_minutes') | float(30) }}"
      seconds: 0
  - action: switch.turn_off
    metadata: {}
    data: {}
    target:
      entity_id: input_boolean.prohibit_large_loads
mode: restart

When my automation is triggered (by a button entity), I get this in my logs:

2025-01-17 08:57:48.275 WARNING (MainThread) [homeassistant.helpers.service] Referenced entities input_boolean.prohibit_large_loads are missing or not currently available

If I use the search feature on my dashboard I can see the input_boolean.prohibit_large_loads entity just fine.

Could anyone give me some pointers to help me figure out why home assistant is telling me that the entity is missing or unavailable?

Thanks!

Wrong domain. You should try:

- action: input_boolean.turn_on
1 Like

Thank you!

I’m still feel really new at home assistant and things like this trip me up often.

1 Like

Hi johnwdailey,

If that’s a real automation, you also need a trigger. If you are doing something that does not need a trigger, that is a script which has a GUI editor as well.

Trying to build an automation without a trigger will make you sad.

It gets triggered by a button on my dashboard.

It needs a trigger statement. If it don’t have one, put that basically same code into the script editor and use the button to action the script.

OR

Add a trigger to that watching the button and when the button is pushed, the automation runs.

Are you sure? It’s working as is… I just verified that the boolean is updated when I hit the button on my dashboard.

Automatons without triggers are asking for trouble.
(Unless you put them in the script format.)

I do not recommend doing that.

2 Likes

Taking your advice and working on it, thanks!

Related question:
my script has a delay in it, and I want subsequent triggering of the script to restart the delay, so in my automation I had mode: restart… How would I handle that in a script?

Should work the same, but test it.

1 Like

Looks like it works!

Thanks for helping to save me from a future headache

1 Like