Skip to content

Instantly share code, notes, and snippets.

@Didgeridrew
Created January 1, 2021 19:15
Show Gist options
  • Save Didgeridrew/31d77f5f0c5b3f0666708947f32671f8 to your computer and use it in GitHub Desktop.
Save Didgeridrew/31d77f5f0c5b3f0666708947f32671f8 to your computer and use it in GitHub Desktop.
HA template sensor and automation help
binary_sensor:
- platform: template
sensors:
gatos_aviso_binary:
friendly_name: "Gatos Suelo Binary Sensor"
value_template: >-
{% if states('sensor.temperature_gatos_suelo') == 'unknown'
or states('sensor.temperature_gatos_suelo') == 'unavailable'
or (utcnow() - states.sensor.temperature_gatos_suelo.last_updated).total_seconds() | round(0) > 60 %}
off
{% else %}
on
{%endif%}
- id: gatos_aviso
alias: Gatos aviso sensor suelo no actualiza
description: ''
trigger:
- platform: state
entity_id: binary_sensor.gatos_aviso_binary
to: 'off'
for: 30 min
condition: []
action:
- service: notify.mobile_app_mi_9t_pro
data:
title: Atencíon
message: Sensor Gatos suelo no actualiza desde hace a menos media hora
mode: single
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment