Skip to content

Instantly share code, notes, and snippets.

View jlpouffier's full-sized avatar

JLo jlpouffier

View GitHub Profile
@jlpouffier
jlpouffier / conditions.yaml
Last active August 5, 2023 20:42
Home Assistant Hot Tip of the day: home occupancy
# This condition will be true if your home is empty
condition:
- condition: state
entity_id: zone.home
state: "0"
# This condition will be true if your home is occupied
condition:
- condition: numeric_state
entity_id: zone.home
@jlpouffier
jlpouffier / configuration.yaml
Created August 5, 2023 20:41
Home Assistant Hot Tip of the Day: Home Occupancy Sensor
# https://www.home-assistant.io/integrations/template/
template:
- binary_sensor:
- name: home_occupied
unique_id: home_occupied
state: "{{states('zone.home')|int > 0}}"
device_class: occupancy
attributes:
is_home_full: "{{states('zone.home')|int == expand(states.person)|list|count}}"
@jlpouffier
jlpouffier / script.yaml
Created August 6, 2023 18:29
Home Assistant Hot Tip of the Day: Run vs Turn on Script
turn_on_kitchen_lights_and_wait_3_seconds:
alias: Turn on Kitchen Lights and Wait 3 seconds
sequence:
- service: light.turn_on
data: {}
target:
entity_id: light.kitchen_lights
- delay:
hours: 0
minutes: 0
@jlpouffier
jlpouffier / irrigation.yaml
Created August 8, 2023 11:49
Irrigation.yaml
- id: '1688129246113'
alias: Irrigation intelligente - Calculer fin arrosage
description: ''
trigger:
- platform: state
entity_id:
- switch.irrigation_switch
to: 'on'
from: 'off'
condition:
@jlpouffier
jlpouffier / card.yaml
Created August 9, 2023 09:20
Home Assistant Hot Tip of the Day: A Navigation Card to declutter your side bar
type: entities
entities:
- type: button
icon: mdi:format-list-bulleted-type
name: Journal
action_name: NAVIGER
tap_action:
action: navigate
navigation_path: /logbook
- type: button
type: horizontal-stack
cards:
- type: tile
entity: sensor.living_room_temperature
name: Home
vertical: true
color: primary
icon: mdi:home
tap_action:
action: navigate
@jlpouffier
jlpouffier / automation.yaml
Created August 17, 2023 15:48
Home Assistant Hot Tip of the Day: Sentence Trigger
alias: Raise The Desk
trigger:
- platform: conversation
command: raise the desk
action:
- service: button.press
target:
entity_id: button.standing_desk_move_desk_to_position_1
mode: single
@jlpouffier
jlpouffier / available_updates.yaml
Created August 18, 2023 07:26
Home Assistant Hot Tip of the Day: Available Updates
template:
- sensor:
- name: pending_updates
unique_id: pending_updates
state: |
{{
expand(states.update)
| selectattr('state', 'eq', 'on')
| list
| count
@jlpouffier
jlpouffier / script.yaml
Created August 22, 2023 17:56
Home Assistant Hot Tip: Dynamic Scene
alias: Flash Ceiling lights Red
sequence:
- service: scene.create
data:
scene_id: previous_ceiling_lights_state
snapshot_entities:
- light.ceiling_lights
- service: light.turn_on
data:
rgb_color:
@jlpouffier
jlpouffier / card_android.yaml
Created September 7, 2023 07:57
Supercharged Mushroom Person card
type: horizontal-stack
cards:
- type: custom:mushroom-template-card
primary: JL
secondary: |-
{% if is_state("person.person_1", "home") -%}
Présent
{%- elif is_state("person.person_1", "not_home") -%}
{{ state_attr("sensor.person_1_android_geocoded_location", "locality") }}{% if not is_state_attr("sensor.person_1_android_geocoded_location", "iso_country_code", "FR") %} - {{ state_attr("sensor.person_1_android_geocoded_location", "country") }}{%- endif %}
{%- else -%}