#Virtual HA Dashboard

1 messages · Page 1 of 1 (latest)

lavish marlin
#

First part registers a callback

#

Second part calls it to actually add it (in this case a lock, but it works the same for binary sensors)

#

Tedee actually has binary sensors… totally forgot

#

For the virtual devices

#

Maybe i'd just add them as Ha device

#

And set via_device to mark to which session/glasses they belong

ionic nexus
#

Oh, okay, so you are using the callback to keep having access to the async_add_entites method. Is there no way to call this function directly from the HASS object?

lavish marlin
#

No, also you don’t want to create arbitrary entities, but your entities, with your specifications

#

But I suggest you add a coordinator anyways, to have a proper place to do the websocket connection and callbacks

ionic nexus
#

Could work with the HASS object that is being supplied scoped to your integration only but maybe there was a reason for the way it currently is.

Do you know the reason why async_add_entities is nested into a function itself and not passed to the coordinatior directly?

Also, how would I remove an entity as I don't see a async_remove_entities function anywhere.

lavish marlin
#

because in that case I want to control the message signature

#

like in that case, I first fetch something from the coordinator based on lock_id

ionic nexus
lavish marlin
#

not sure tbh, but I don't think I've seen that outside of tests

#

for example, I don't know how those entities determine their state

#

that's what I meant earlier when I said you want entities from your class. Like you want a AreaBinarySensor that knows where to look for it's state based on it's id or something

ionic nexus
#

Oh okay yep, the params of the method seem a bit more complex than just passing a Instance of a Class into the function. Then I'll use the proper method. Thanks for the help, it's greatly appreciated! ❤️