Template syntax question actions at startup

Hello,
I want to check some values at hass startup and set some booleans.
If the ‘person.vorms’ is ‘home’ I will ste the boolean to true.
The first problem is that person.vorms is setted to ‘home’ if he is show by the nmap service.
So to be schur, the test must be delayed by one minute.
The second problem is the syntax to set the boolean to true only if the person is at home.

  • id: “Hass Startup Notification”
    alias: ‘Hass Startup Notification’
    trigger:
    • platform: homeassistant
      event: start
      action:
      service: notify.email
      data:
      title: “Home assistant”
      message: “Démarrage”

      delay: 60
      value_template:
      {% is_state_attr (‘person.vorms’ , ‘home’) %}
      turn_on:
      input_boolean.home_presence

Many thanks for your help and best regards

After delay…

service_template: >
  {% if is_state('person.vorms' , 'home') %} homeassistant.turn_on
  {% else %} homeassistant.turn_off {% endif %}
entity_id: input_boolean.home_presence
1 Like

many Thanks !

1 Like