Skip to content

Commit

Permalink
Merge pull request #775 from jnewland/audio-improvements
Browse files Browse the repository at this point in the history
fix frigrate mqtt sensors
  • Loading branch information
jnewland authored Sep 5, 2023
2 parents d556c5f + f4c7117 commit ffd9d76
Show file tree
Hide file tree
Showing 3 changed files with 1,812 additions and 1,817 deletions.
110 changes: 30 additions & 80 deletions packages/frigate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,97 +7,47 @@ mqtt:
state_topic: "frigate/great_room/audio/rms"
unit_of_measurement: V
name: "Great Room Audio RMS"

- binary_sensor:
state_topic: "home-assistant/great_room/audio/whimper_dog"
name: "Great Room Audio Whimper Dog"
- binary_sensor:
state_topic: "home-assistant/great_room/audio/growling"
name: "Great Room Audio Growling"
- binary_sensor:
state_topic: "home-assistant/great_room/audio/bow-wow"
name: "Great Room Audio Bow Wow"
- binary_sensor:
state_topic: "home-assistant/great_room/audio/howl"
name: "Great Room Audio Howl"
- binary_sensor:
state_topic: "home-assistant/great_room/audio/yip"
name: "Great Room Audio Yip"
- binary_sensor:
state_topic: "home-assistant/great_room/audio/bark"
state_topic: "frigate/great_room/audio/bark"
name: "Great Room Audio Bark"
- binary_sensor:
state_topic: "home-assistant/great_room/audio/dog"
name: "Great Room Audio Dog"
- binary_sensor:
state_topic: "home-assistant/great_room/audio/pets"
name: "Great Room Audio Pets"
state_topic: "frigate/great_room/audio/speech"
name: "Great Room Audio Speech"
- binary_sensor:
state_topic: "home-assistant/great_room/audio/animal"
name: "Great Room Audio Animal"
- binary_sensor:
state_topic: "home-assistant/great_room/audio/smoke_detector"
state_topic: "frigate/great_room/audio/smoke_detector"
name: "Great Room Audio Smoke Detector"
- binary_sensor:
state_topic: "home-assistant/great_room/audio/fire_alarm"
state_topic: "frigate/great_room/audio/fire_alarm"
name: "Great Room Audio Fire Alarm"
- binary_sensor:
state_topic: "home-assistant/great_room/audio/doorbell"
state_topic: "frigate/great_room/audio/doorbell"
name: "Great Room Audio Doorbell"

binary_sensor:
- platform: template
sensors:
great_room_audio_detected:
friendly_name: Great Room Audio Detected
device_class: sound
value_template: >
{{ states('binary_sensor.great_room_audio_whimper_dog') == 'on' or
states('binary_sensor.great_room_audio_growling') == 'on' or
states('binary_sensor.great_room_audio_bow_wow') == 'on' or
states('binary_sensor.great_room_audio_howl') == 'on' or
states('binary_sensor.great_room_audio_yip') == 'on' or
states('binary_sensor.great_room_audio_bark') == 'on' or
states('binary_sensor.great_room_audio_dog') == 'on' or
states('binary_sensor.great_room_audio_pets') == 'on' or
states('binary_sensor.great_room_audio_animal') == 'on' or
states('binary_sensor.great_room_audio_smoke_detector') == 'on' or
states('binary_sensor.great_room_audio_fire_alarm') == 'on' or
states('binary_sensor.great_room_audio_doorbell') == 'on'
}}
- sensor:
state_topic: "frigate/front_door/audio/dBFS"
unit_of_measurement: dB
name: "Front Door Audio dBFS"
- sensor:
state_topic: "frigate/front_door/audio/rms"
unit_of_measurement: V
name: "Front Door Audio RMS"

sensor:
- platform: template
sensors:
great_room_audio_reason:
friendly_name: Great Room Audio Reason
value_template: >
{% if is_state('binary_sensor.great_room_audio_whimper_dog', 'on') %}
whimper dog
{% elif is_state('binary_sensor.great_room_audio_growling', 'on') %}
growling
{% elif is_state('binary_sensor.great_room_audio_bow_wow', 'on') %}
bow wow
{% elif is_state('binary_sensor.great_room_audio_howl', 'on') %}
howl
{% elif is_state('binary_sensor.great_room_audio_yip', 'on') %}
yip
{% elif is_state('binary_sensor.great_room_audio_bark', 'on') %}
bark
{% elif is_state('binary_sensor.great_room_audio_dog', 'on') %}
dog
{% elif is_state('binary_sensor.great_room_audio_pets', 'on') %}
pets
{% elif is_state('binary_sensor.great_room_audio_animal', 'on') %}
animal
{% elif is_state('binary_sensor.great_room_audio_smoke_detector', 'on') %}
smoke detector
{% elif is_state('binary_sensor.great_room_audio_fire_alarm', 'on') %}
fire alarm
{% elif is_state('binary_sensor.great_room_audio_doorbell', 'on') %}
doorbell
{% else %}
unknown
{% endif %}
- binary_sensor:
state_topic: "frigate/front_door/audio/bark"
name: "Front Door Audio Bark"
- binary_sensor:
state_topic: "frigate/front_door/audio/speech"
name: "Front Door Audio Speech"
- binary_sensor:
state_topic: "frigate/front_door/audio/smoke_detector"
name: "Front Door Audio Smoke Detector"
- binary_sensor:
state_topic: "frigate/front_door/audio/fire_alarm"
name: "Front Door Audio Fire Alarm"
- binary_sensor:
state_topic: "frigate/front_door/audio/doorbell"
name: "Front Door Audio Doorbell"

automation:
- alias: Notify about camera failures
Expand Down
21 changes: 18 additions & 3 deletions packages/puppy.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,25 @@
automation:
- alias: Puppy bark
id: 6fc7d655-2e09-4049-9392-9ac6820f70d5
trigger:
- platform: state
entity_id: binary_sensor.front_door_audio_bark
to: "on"
action:
- service: script.ack
data:
entity_id: script.noop
tag: binary_sensor.front_door_audio_bark
message: ❗️📢🐶
confirmation_message: is handling ❗️📢🐶, cool
decline_message: can't handle ❗️📢🐶 rn, can you?

- alias: Puppy bell
id: 050335c4-2f3d-4dbc-ac00-cf1f69759db7
trigger:
platform: state
entity_id: binary_sensor.front_door_puppy_tampering_product_cover_removed
to: "on"
- platform: state
entity_id: binary_sensor.front_door_puppy_tampering_product_cover_removed
to: "on"
condition:
condition: state
entity_id: lock.front_door
Expand Down
Loading

0 comments on commit ffd9d76

Please sign in to comment.