Run_in is the worst part of appdaemon

Did you see the post I pasted from aimc above? That’s my issue. “entity” is a parameter name and can’t be used. All working as expected now.

Wow, that was frustrating, as anybody from the future reading this thread will probably deduce.

Ah my bad, forgot about this, I’m sorry.

self.run_in(self.future_off, 10, myentity=self.args.get("hold"))

This will probably give you an error if “hold” is not in your yaml config, because the get method will provide “None” if it can not find the “hold” in your config.

You can use lambda of Python:

self.run_in(lambda _: self.turn_off("light.mylight"), 60)
1 Like