neilimixamo / Home-Assistant-Quick-Look-Mobile

118 stars 6 forks source link

Header have no count and color when device is active #15

Closed kesm closed 1 year ago

kesm commented 1 year ago

Hello,

I guess I did the configuration wrong but I can't see what is missing. One of my light is configured this way:

cards:
          - type: custom:button-card # ENTITY 01
            template: light #or 'light_expandable'
            variables:
              entity: light.entree #required light.entity_id
              name: Entrée #optional
              expand_to: #required path if light_expandable template is used

and homeassistant/custom_templates/quick_look_mobile_macros (v2.0.0).jinja is configured this way

# LIGHTBULBS :
{% set light_entity_ids = [
  'light.entree',
] %}  

I tried to restart homeassistant and reload custom theme but it doesn't seem to work

image

Any idea of what is going on?

neilimixamo commented 1 year ago

Hi, your quick_look_mobile_macros (v2.0.0).jinja looks good.

Template sensors changed in v2.0.0, did you add /config/entities/quick_look_mobile_sensors.yaml, restart HA and refresh dashboard (not the theme) ?

If yes, can you try this template model an see if it returns "on" and "1" ?

      {% from 'quick_look_mobile_macros.jinja' import some_lights_are_on %}
      {{ some_lights_are_on().split(',')[0] }}

      {% from 'quick_look_mobile_macros.jinja' import some_lights_are_on %}
      {{ some_lights_are_on().split(',')[1] }}

image

kesm commented 1 year ago

it should be in entities/sensors or entities and should I rename them? image

Here is the result of the modele execution image

neilimixamo commented 1 year ago

I think I shouldn't have renamed quick_look_mobile_macros.jinja to quick_look_mobile_macros (v2.0.1).jinja". Could you please rename it back to quick_look_mobile_macros.jinja, restart, refresh dashboard and let me know the outcome?

kesm commented 1 year ago

image

and same behavior

neilimixamo commented 1 year ago

The quick_look_mobile_sensors (v2.0.0).yaml does not need to be renamed in my opinion by you can also rename it to quick_look_mobile_sensors.yaml to be sure

kesm commented 1 year ago

image same image

But I don't know which file has 813 lines

kesm commented 1 year ago

I tried with the file not modified and it returns

`off

  0`

I will check again my modification, it must come from me, sorry

kesm commented 1 year ago

Confirmed, it's ok now thank you

hAMMERlized commented 1 year ago

Post your solution please so someone with similar issues can find the solution here.

kesm commented 1 year ago

the solution was to copy the content of the initial file from github in my quick_look_mobile_macros.jinja file and modify the entities to match the ones on my homeassistant

hAMMERlized commented 1 year ago

Ok, so the header doesn't work for me either. Color is not changing, same for the badgets. Filled in my light entitie into the quick_look_mobile_macros.jinja without luck.

image

kesm commented 1 year ago

what happened if you do the model part described here? https://github.com/neilimixamo/Home-Assistant-Quick-Look-Mobile/issues/15#issuecomment-1619231504

hAMMERlized commented 1 year ago

Nevermind. Got it, was using a wrong path.