setup automations.yaml, automations.yaml and lovelace.yaml as attachments.
after I run the automations, counter will add 1, but when I login, the counter did not work.
I try ti find the Doc but I have no idea what entity_id con use for when user login?
could you help me. thank.
# configuration.yam
counter:
user_login_count:
name: User Login Count
initial: 0
step: 1
icon: mdi:account-check
# automation:
- alias: Increment User Login Counter
trigger:
- platform: event
event_type: homeassistant_log
event_data:
message: 'Login attempt or success'
condition:
- condition: template
value_template: "{{ 'success' in trigger.event.data.message.lower() }}"
action:
- service: counter.increment
target:
entity_id: counter.user_login_count
# Lovelace UI
type: entity
entity: counter.user_login_count