šŸŒ» Lovelace UI ā€¢ Minimalist

If your not going to use the guests sensor just use the chip_icon_state template instead of the chip_presence_detection. Btw, check first in dev tools if the sensor you made shows the correct state (x people homeā€¦).

It did show 2 at home first! But now its not showing 0.
Maybe I f@cked it up! Getting late/early here so Iā€™ll have a look at it tomorrow!
Millions thanks for all the help for far! :heart_eyes:

I modified the aircondition template a bit and use it as thermostat.
Basically two minor (but time at the time consuming) changes were required. I added a short statement for to calculate the new temperature with 0.5 steps and ā€˜triggers_update: allā€™ was required to keep the current temperature updated:

triggers_update: all
temperature: > 
                                    [[[ var temp = (states[variables.entity].attributes.temperature)-0.5;
                                        return temp ]]]

Screenshot_2

HI, where you able to resolve the issue?

Try

{{ states.person | selectattr( 'state', 'eq', 'home') | list | length }}
1 Like

Cool idea with the charging icon. Had to make a small adjustment to your template because on some devices the status is output as ā€œcharingā€ and not ā€œCharingā€.

Also adjusted the default battery template so that an alarm is displayed when the battery falls below a certain threshold.

ezgif-7-a337909705c0

6 Likes

Looking good! :slight_smile:

Got it to work! I was just tried and forgot to add: states.person.kim_ :joy:
Thanks for the help! :slight_smile:
Will probably ask for more help soon! :laughing:

1 Like

No, need to specify each person in an array. When using the code I posted above it works dynamically with all persons youā€™ve specified.

1 Like

This is the correct solution. I have the same in my configuration. Works perfectly!

Edit, my config:

template:
  - sensor:
      - name: "People home"
        state: >-
           {{ states.person | selectattr('state', 'eq', 'home') | list |count }}
1 Like

Oh!

Had no idea.

- platform: template
  sensors:
    my_residents_counter:
      friendly_name: "my_residents_counter"
      value_template: >-
        {{ [states.person.kim_lidberg, states.person.nattz_lidberg]
        | selectattr('state', 'eq', 'home')
        | list | count }}

I just did this and now its workingā€¦

Btw @klidberg

Youā€™re still using the legacy template style. Not really wrong but something to keep in mind.
More info here: Template - Home Assistant

Can you tell me which card is this one with the weather info?

Thanks! I will have a look at it! :slight_smile:

Itā€™s the Welcome Card With Weather but slightly changed things to make it only display the weather, i did exactly the same with mine. You can take the code to get the same result.

custom_card_paddy_welcome_with_weather:
  template:
    - ulm_custom_card_paddy_welcome_language_variables
  show_icon: false
  show_name: false
  show_label: false
  styles:
    grid:
      - grid-template-areas: '"item1" "item2"'
      - grid-template-columns: 1fr
      - grid-template-rows: min-content min-content
      - row-gap: 1px
    card:
      - height: 70px
      - border-radius: var(--border-radius)
      - box-shadow: var(--box-shadow)
  custom_fields:
    item2:
      card:
        type: weather-forecast
        tap_action:
          action: none
        entity: "[[[ return variables.ulm_custom_card_paddy_welcome_weather_provider; ]]]"
        show_forecast: false
        name: ""
        card_mod:
        style: |
          ha-card.type-weather-forecast {
            border-radius: 14px;
            box-shadow: none;
            margin-top: -25px;
          }
          ha-card.type-weather-forecast .state {
            text-align: left;
            font-size: 18px;
            font-weight: bolder;
            margin-top: 2px;
          }
          ha-card.type-weather-forecast .name {
            text-align: left;
            font-size: 14px;
          }
          ha-card.type-weather-forecast .temp-attribute {
            text-align: right;
          }
          ha-card.type-weather-forecast .temp {
            text-align: right;
            font-size: medium;
            font-weight: bolder;
            margin-right: 16px;
          }
          ha-card.type-weather-forecast .temp span {
            text-align: right;
            font-size: medium;
            font-weight: bolder;
          }
          ha-card.type-weather-forecast .attribute {
            text-align: right;
            font-size: smaller;
          }

How do you do the 2/2 for presence detection?

Just using the chip_presence_detection:

          - type: 'custom:button-card'
            template: chip_presence_detection
            variables:
              ulm_chip_presence_counter_residents: sensor.people_presence
              ulm_chip_presence_counter_guests: sensor.my_guests_counter

And these are my sensors (I hardcoded the guests for 2, this way means there is 2 people home out of two:

      people_presence:
        friendly_name: People Presence
        value_template: >-
          {{ states.person|selectattr('state','equalto','home')|list|length }}


      my_guests_counter:
        friendly_name: Guests Presence
        value_template: >-
          {{ 2 | int }}

And this is the chip template:

chip_presence_detection:
  template: chips
  triggers_update:
    - "[[[ return variables.ulm_chip_presence_counter_residents; ]]]"
    - "[[[ return variables.ulm_chip_presence_counter_guests; ]]]"
  label: |
    [[[
      var guests = states[variables.ulm_chip_presence_counter_guests].state ? ' / ' + states[variables.ulm_chip_presence_counter_guests].state : '';
      return 'šŸ  ' +  states[variables.ulm_chip_presence_counter_residents].state + guests;
    ]]]
2 Likes

Did you ever work the issue?
If so, would you mind sharing the template/yaml?
:slight_smile:
Edit: never mind, my bad, saw that your where working on it now on Github. Keep up the great work!

It is still under active development. But any help is appreciated.
More info can be found in the pull request

2 Likes

Hi Bavo. Saw your contribution in Github! Awesome work!
If I could, I would help out coding, but I canā€™t code :joy: