Entity not found in namespace

Hi Everyone,

I’m facing a weird issue with AppDaemon, and specifically with NightMode app

During init or run, the app raise a bunch of warning about entities which aren’t found in ‘default namespace’

However, when I check the default namespace entities in AppDaemon’s admin UI, these entities are actually part of it (they even exist 3 times each, and I have no idea why) :

The point is I don’t understand how they can be part of the default namespace and still having NightMode app unable to “find them” in this same namespace…

Anyone had a similar issue with any app ?

Additionnal information, I’m able to work with these entities in other AppDaemon apps, just got the issue with ‘NightMode’ app

Thanks for reading me

I believe you are seeing duplicate entities due to an issue with the UI. If you try to refresh it will probably only show one.

The behavior of AD when using set_state() is to create an entity when it doesn’t exist. When the entity is created you will see that message about the entity not existing.

Hi prodige,

Thanks for your reply !

According to your infos, the entities are actually not found because they exists but they are created by the apps trying to call set_state on them. That would make sense.

However, I can actually modify their state via other apps, so they must actually exists and it works.
Still when NightMode is turned on (which is supposed to limit the brightness of my light bulb during night) some lights does dim down, but the ones “not existing” according to the apps logs doesn’t.

Super weird that I can modify the state of these entities with my other apps while “nighmode” cannot… and throw an non existing warning…

Ah ok, I see what the problem is then. If these are existing entities that are created by integrations in home assistant, you shouldn’t be trying to use set_state() on them. Instead, you should be using call_service() or you can use the HASS integration helpers like turn_on() and turn_off(). You only use set_state() on entities that aren’t part of an integration such as sensors or binary_sensors that you are creating yourself from within AD. Even with helper entities such as input_boolean, you would still use call_service(), turn_on() and/or turn_off(). I hope you find that helpful.

Hi Proggie,
Thank you for your reply. I didn’t had the time to give it a try yet and I’ll follow up once I did !
Still wanted to say your help is really appreciated :slight_smile:

No problem, thanks for the heads up. :+1:t2: