Skip to content

Instantly share code, notes, and snippets.

View jlpouffier's full-sized avatar

JLo jlpouffier

View GitHub Profile
@jlpouffier
jlpouffier / card.yaml
Created June 11, 2024 10:00
🍄 Mushroom Voice Assistant Card
type: custom:mushroom-template-card
primary: HAL
secondary: |-
{% if is_state('binary_sensor.hal_assist_en_cours','on') %}
En écoute ...
{% elif is_state('switch.hal_use_wake_word','on') %}
Activé
{% else %}
Desactivé
{% endif %}
alias: Réveil intelligent - Démarrer la Musique
description: ""
trigger:
- platform: time
at: input_datetime.wake_up_time
condition:
- condition: state
entity_id: input_boolean.automation_wake_up
state: "on"
- condition: state
@jlpouffier
jlpouffier / automations.yaml
Created December 22, 2023 17:48
standing_desk automation
alias: Bureau - Standing Desk Autonome
description: ""
trigger:
- platform: time_pattern
minutes: "25"
- platform: time_pattern
minutes: "55"
condition:
- condition: state
entity_id: input_boolean.automation_meetings
@jlpouffier
jlpouffier / prompt.txt
Created November 9, 2023 18:13
Music Assistant AI Search Bot
You are an AI process that transforms a music search query into a structured JSON.
Here is the structured JSON that I expect in response {"media_id":"name", "media_type":"type", "artist":"name", "album":"name"}
"media_type" can be one of 3 different values: "track" if the search is about a specific track, "album" if the search is about an album, or "artist" if the search is about an artist.
media_type is mandatory
media_id is the most specific from track, album, and artist.
If the search is about a track: Then media_id is the track name.
If the search is about an album: Then media_id is the album name.
@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 -%}
@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 / 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 / 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
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 / 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