Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 95462

Sensor template with string format, automatic state change after 5 mn

$
0
0

@Christophe_Beaucourt wrote:

Hi all,

I have added a new sensor (using template).

When my HA received a new specific email (imap integration works fine with HA) from a provider, I set the sensor value to “PersonInside”. This email contains the alarm sensor that just switch to “PersonInside” state.

Unfortunnetly, the alarm system is not able to send “NoPersonInside” state later…

So, I would like to set the state “NoPersonInside” after 3 ou 5 minutes for example.

Can you provide me the “setState” piece of code ? I’m not able to find an automation service to set the value of a sensor.

The sensor is defined as follow with the value “PersonInside” defined when an email is received :

presence_couloir:
friendly_name: “Présence Couloir”
value_template: >
{% if state_attr(‘sensor.tahoma_mail’, ‘body’)
| replace (’\n’,’’) | replace (’"’,’’) | replace ("=","")
| regex_match (‘TaHoma alerte : .*, votre condition Pr Couloir’, ignorecase=FALSE) %}
PersonInside
{% endif %}

I know that is possible to trigger a change in automation after a specific period of time, but my problem is that I don’t have the line to set the state of “presence_couloir” to “NoPersonInside”.

Many thanks for your help.

Christophe

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 95462

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>