Update HAINTEGRATION.md

Made a change to BirdNET-Go Events Sensor. The sensor will now work if you have other triggers defined for other sensors not related to Birdnet
This commit is contained in:
thor0215
2024-10-03 07:16:20 -05:00
committed by GitHub
parent ff3a0f6c04
commit 00f35a975a

View File

@@ -87,6 +87,7 @@ Then create a new template sensor using the configuration below.
- trigger:
- platform: mqtt
topic: "birdnet"
id: birdnet
- platform: time
at: "00:00:00"
id: reset
@@ -96,14 +97,14 @@ Then create a new template sensor using the configuration below.
state: >
{% if trigger.id == 'reset' %}
{{ now() }}
{% else %}
{% elif trigger.id == 'birdnet' %}
{{ today_at(trigger.payload_json.Time) }}
{% endif %}
attributes:
bird_events: >
{% if trigger.id == 'reset' %}
{{ [] }}
{% else %}
{% elif trigger.id == 'birdnet' %}
{% set time = trigger.payload_json.Time %}
{% set name = trigger.payload_json.CommonName %}
{% set confidence = trigger.payload_json.Confidence|round(2) * 100 ~ '%' %}