This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Include this in the confiuration,yaml, or any yaml file where you have sensor data | |
sensor: | |
# This sensor will count how many times I was in the | |
# "Work" zone in the last 7 days | |
- platform: history_stats | |
name: Jeff Time at Work | |
entity_id: person.jeffrey # The Device/person entity | |
state: 'Work' # The name of the Zone | |
type: count # This will give you the count, use time if you want duration | |
end: '{{ now() }}' # When the count should End |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- id: '1662424449450' | |
alias: IFTT Wenhook Example | |
description: '' | |
trigger: | |
- platform: webhook | |
webhook_id: ifttt_webhook | |
condition: [] | |
action: | |
- choose: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mqtt: | |
device_tracker: | |
- name: phone1 | |
state_topic: "home/myphone" | |
- name: phone2 | |
state_topic: "home/yourphone" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
service: notify.alexa_media | |
data: | |
message: > | |
<voice name="{{ voice }}"> <amazon:auto-breaths> <prosody rate="medium"> I | |
know a Haiku. This one is called, | |
{{ [ | |
'Good Morning From The Cat', | |
'Tee Rex Hug.', | |
'It Fits.', | |
'Minecraft Creepers.' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create a lovelace card with these entities after addubg the above sensors and restarting home assistant | |
entities: | |
- entity: sensor.binary_sensor_count | |
- entity: sensor.tracker_count | |
- entity: sensor.lights_count | |
- entity: sensor.sensor_count | |
- entity: sensor.script_count | |
- entity: sensor.automation_count | |
- entity: sensor.entities_count |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias: Webhook Lock | |
description: "" | |
trigger: | |
- platform: webhook | |
webhook_id: door_lock | |
condition: [] | |
action: | |
- service: input_text.set_value | |
target: | |
entity_id: input_text.bedroom |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- cal_id: yourgooglecalemail@gmail.com | |
entities: | |
- device_id: mdl_holidays | |
name: MaisonDesLunes Holidays | |
search: "#mh" | |
track: true | |
max_results: 30 | |
- device_id: kid_events | |
name: Kid Events | |
search: "#se" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get State of entity | |
{{ states('light.desk_backlight')}} | |
# Get Attribute Value | |
{{ state_attr('light.desk_backlight','energy')}} | |
# Do Mathy stuff - remeber PEMDAS | |
{{ ((states('sensor.basement_air_device_temperature') | int - 32) / 1.8) | round }} | |
# Get list of cameras, remove unavailable ones, list them and count them |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template: # Not needed if you are saving this in a template.yaml. But required in configuration.yaml or a package | |
- sensor: | |
- name: sensor_1 # not required, but should be - used as entity_id and friendly_name | |
unique_id: sensor_1 # not required, but is if you want to be able to manage this via the UI | |
icon: mdi:cat # not required | |
device_class: none # Can be helpful when displaying state, if not included default is none | |
# All Device Classes -> https://www.home-assistant.io/integrations/sensor/#device-class | |
state: > # required | |
{{ states('sensor.cat_count') | int }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For more on these and more visit: https://ttl255.com/jinja2-tutorial-part-4-template-filters/ | |
# Covert Previous value to integter | |
| int | |
# Convert previous value to a decimal number, | |
# Replace 0 with number of decimals to include | |
| float(0) |