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!
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 ]]]
HI, where you able to resolve the issue?
Try
{{ states.person | selectattr( 'state', 'eq', 'home') | list | length }}
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.
Looking good!
Got it to work! I was just tried and forgot to add: states.person.kim_
Thanks for the help!
Will probably ask for more help soon!
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.
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 }}
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!
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;
]]]
Did you ever work the issue?
If so, would you mind sharing the template/yaml?
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
Hi Bavo. Saw your contribution in Github! Awesome work!
If I could, I would help out coding, but I canāt code