neilimixamo / Home-Assistant-Quick-Look-Mobile

129 stars 6 forks source link

pir/door lock sensors not showing the status #39

Open duceduc opened 2 months ago

duceduc commented 2 months ago

Hi there. I have setup the security section with door locks and pir sensors. At one point, it was displaying the status of each sensors highlight in red area. The green highlight is working as you can see. Can you point me in the direction of what to look for?

IMG_0555

I have tried updating the security (v2.0.2).yaml in the github to my existing one.

Here is my 2.1_security_sensors (v2.0.0).yaml

    title: security_sensors
    path: security_sensors
    icon: mdi:cctv
    theme: Quick Look Mobile
    background: 'var(--theme)'
    type: custom:grid-layout
    layout:
      margin: -0.5vh 1vh 0vh
      grid-template-columns: auto
      grid-template-rows: 19.5vh 7.5vh 50vh 4vh 10vh 9vh
      grid-template-areas: |
        "header"
        "subheader"
        "main"
        "footer_title"
        "footer"
        "menu"
    cards:
      - type: custom:button-card # HEADER
        view_layout:
          grid-area: header
        template: header
        variables:
          view: 'security'
      - type: custom:button-card # SUBHEADER
        view_layout:
          grid-area: subheader
        template: subheader_1
        variables:
          subheader_1_title: Sensors #can be changed
          subheader_1_path: security_sensors
          subheader_2_title: Cameras #can be changed
          subheader_2_path: security_cameras
      - type: custom:layout-card # MAIN
        view_layout:
          grid-area: main
        layout_type: custom:vertical-layout
        layout:
          height: 50vh
          margin: 0vh 0vh 0vh
          padding: 0vh 0.4vh
        cards:
          # This is where you can customize this view to fit your system and devices.
          - type: custom:button-card # TITLE 01
            template: title_scrollable
            variables:
              title: Front Area
          - type: grid
            columns: 2
            square: false
            cards:
              - type: custom:button-card # ENTITY 01
                template: security # or choose 'security_expandable'
                variables:
                  name: Patio
                  contact:
                  occupancy: binary_sensor.motion_g2_occupancy
                  lock:
                  contact_battery:
                  occupancy_battery: sensor.motion_security_battery
                  lock_battery:
                  expand_to:
    .
    .
    .
    .
      - type: custom:button-card # FOOTER TITLE
        view_layout:
          grid-area: footer_title
        template: title_sticky
        variables:
          title: 'Sentry'
      - type: custom:button-card # FOOTER
        view_layout:
          grid-area: footer
        template: alarm_footer
        variables:
          entity: input_select.sentry_mode_status
      - type: custom:button-card # MENU
        view_layout:
          grid-area: menu
        template: menu

Ok. It's acting strangely. I have not done any edits and I noticed some pir sensors would stay on for quite sometime. The screen shot below, the pir sensor should not be on. IMG_0557

neilimixamo commented 2 months ago

Hi @duceduc

If I understand correctly, you are experiencing two issues:

1) Your binary_sensor.motion_g2_occupancy sensor called Patio doesn't show any presence, although you believe the sensor is active. However, the security tab in the header correctly counts 1 active presence.

2) Your Washer card displays a presence but it shouldn't and the security tab in the header doesn't show that presence.

Regarding these issues:

1) One limitation of the QLM dashboard is that any entity changes made to the cards must also be updated in the file custom_templates/quick_look_mobile_macros.jinja. Could you please verify that the entities listed under the # PRESENCES menu correspond to the entities used in your security cards, and ensure they are up-to-date and correct?

2) In principle, the QLM cards should not alter the status of an entity. If you suspect a status anomaly with your washer sensor in QLM, could you please check what status is shown in Home Assistant dev tool ?

duceduc commented 2 months ago

Hey. I am sorry to have taken up your time. It has been working all along and you have told me how the security card works before but I have forgotten. The sensor will not show active unless the page is refresh. It will be quite difficult to test this if the pir sensor is only active for 2 seconds which is how most of my sensors are setup.

neilimixamo commented 2 months ago

@duceduc

If your motion sensor status only updates with a manual refresh of the dashboard, you should look into /dashboards/quick_look_mobile/templates/cards/security.yaml

Does your file look like this ?

security:
  template: basic_card
  variables:
    contact:
    occupancy:
    lock:
    contact_battery:
    occupancy_battery:
    lock_battery:
    name:
  triggers_update: 
    - '[[[ return variables.entity; ]]]'
    - '[[[ return variables.contact; ]]]'
    - '[[[ return variables.occupancy; ]]]'
    - '[[[ return variables.lock; ]]]'
    - '[[[ return variables.contact_battery; ]]]'
    - '[[[ return variables.occupancy_battery; ]]]'
    - '[[[ return variables.lock_battery; ]]]'
  styles:
    card:

You could also try with this code :

security:
  template: basic_card
  variables:
    contact:
    occupancy:
    lock:
    contact_battery:
    occupancy_battery:
    lock_battery:
    name:
  triggers_update: all
  styles:
    card:
neilimixamo commented 1 day ago

Hi @duceduc , is your issue resolved ?