Play with states in Lovelace Custom Strategies

Hello community !

I’m working on an automated dashboard build from Lovelace Custom Strategies. I started from the full exemple of the documentation to build my dashboard.

Like in the exemple, I’m getting entities with the callWS method :

  const [areas, devices, entities] = await Promise.all([
    hass.callWS({ type: 'config/area_registry/list' }),
    hass.callWS({ type: 'config/device_registry/list' }),
    hass.callWS({ type: 'config/entity_registry/list' }),
  ]);

After that I can create my area’ view and adding some cards from the beautiful UI Lovelace Minimalist.

UI Lovelace Minimalist allow you to create chips cards to display some data. In my case, i’d like to create cards with all active entities from a domain like motions or doors.

Capture d’écran 2022-03-31 à 04.21.19

So i’m searching all motions entities with a state is on.

My problem is that the hass.states object is not refresh when a state change. So I need to refresh the page to get current state.

Is there a way to refresh states values from a socket or something else ?

Thanks a lot for your help.

Lou_Juicy

Hey @Lou_Juicy !
Do u still use this strategy?
If so is it something I could share the code for some inspiration?

Hey !

I’ve created a new dashboard using the mushroom-strategy as a foundation.

Hope it proves useful to you!