SgtBatten / HA_blueprints

Somewhere to store automation blueprints
151 stars 55 forks source link

[Config Support]: Notification Group or Android/Fire TV (Optional) #191

Closed abeksis closed 4 weeks ago

abeksis commented 3 months ago

Describe the problem you are having or the outcome you are trying to achieve.

Notification Group or Android/Fire TV (Optional)

Do I need to provide the full address? Like notify.frigate_mobile_notify?

And under Base URL (Optional) should I provide the full articles plus https?

Version

Frigate Notifications (0.12.0.3d)

Automation config

alias: Frigate Notifications to Mobile Tv
description: ""
use_blueprint:
  path: SgtBatten/Beta.yaml
  input:
    camera: camera.front_gate
    notify_group: notify.frigate_mobile_notify
    message: >-
      {{ label }} detected - {{ camera_name }} at
      {{event['after']['start_time']|timestamp_custom('%H:%M')}}
    attachment: snapshot.jpg?bbox=1
    zone_filter: false
    zones: []
    tv: true
    tv_position: bottom-left
    notify_device: 0f960a98a486e2df944fb7d70d303fc8
    tv_interrupt: true
    labels:
      - person
    tv_transparency: 25%
    url_1: "{{base_url}}/lovelace"
    tap_action: "{{base_url}}/api/frigate{{client_id}}/notifications/{{id}}/snapshot.jpg"
    alert_once: false
    update_thumbnail: false
    base_url: frigate.abeksis.site
    sticky: true
    debug: true
    video: ""
    color: "#f44336"
    ios_live_view: camera.front_gate

Frigate Config

No response

Any other information that may be helpful

No response

SgtBatten commented 3 months ago

Do I need to provide the full address? Like notify.frigate_mobile_notify?

I think it does work if you include notify at the start but the minimum is just the group name

And under Base URL (Optional) should I provide the full articles plus https?

Yes it needs to be the full url, but it needs to be to home assistant, not frigate.

abeksis commented 3 months ago

For me, the frigate sits at a different address and I made a link to HA with the help of integrations.

Is it possible to run it manually? When I run it manually I get no data.

SgtBatten commented 3 months ago

For me, the frigate sits at a different address and I made a link to HA with the help of integrations.

It doesn't matter, we aren't connecting to frigate. We are connecting to HA.

Is it possible to run it manually? When I run it manually I get no data.

If you send fake Mqtt messages yes. If you just want to press run in home assistant, No.

abeksis commented 3 months ago

I can't figure out why it doesn't work. Everything I do doesn't work, I even went back to the stable version.

                      message: |
                        DEBUG: 
                          Info:
                            fps: {{fps}}, 
                            frigate event id: {{id}}, 
                            object (formatted): {{object}} ({{label}}),
                          Config: 
                            camera(formatted): {{camera}}({{camera_name}}), 
                            Base URL: {{base_url}}, 
                            critical: {{critical}}, 
                            alert once: {{alert_once}}, 
                            Update Thumbnails: {{update_thumbnail}}, 
                            Target: {{'group (input/formatted): ' + group + '/' + group_target + ', ' if group else 'Mobile Device'}}
                            cooldown: {{cooldown}}s, 
                            loiter timer: {{loiter_timer}}s,
                            color: {{color}}, 
                            sound: {{sound}},
                            Title: {{title}}, 
                            Message: {{message}},
                            tap_action: {{tap_action}}, 
                            button 1 Text/URL: {{iif(button_1, button_1, 'unset')}} ({{url_1}}), 
                            button 2 Text/URL: {{button_2}} ({{url_2}}), 
                            button 3 Text/URL: {{button_3}} ({{url_3}}), 
                            icon: {{icon}}
                            tv: {{tv}}, 
                            tv_position: {{tv_position}}, 
                            tv_size: {{tv_size}}, 
                            tv_duration: {{tv_duration}}, 
                            tv_transparency: {{tv_transparency}}, 
                            tv_interrupt: {{tv_interrupt}}, 
                          Filters: 
                            Zones: 
                              zone filter toggle on: {{zone_only}}, 
                              Multi Zone toggle on: {{zone_multi}}, 
                              Required zones: {{input_zones}}, 
                              Entered Zones: {{initial_entered_zones}}, 
                              Zone Filter TEST: {{'PASS (Multi)' if zone_multi_filter else 'PASS' if ( not zone_only or not zone_multi and zones|select('in', initial_entered_zones)|list|length ) else 'FAIL (Multi)' if zone_multi else 'FAIL' }}, 
                            Required objects TEST: 
                              Input: {{input_labels}}, 
                              TEST: {{'PASS' if not labels|length or object in labels else 'FAIL'}}
                            presence entity (not home):
                              Entity: {{presence_entity}}
                              TEST:  {{'PASS' if not initial_home else 'FAIL'}}, 
                            disabled times: {{disable_times}}, 
                            State Filter: 
                              state filter toggle on: {{state_only}}, 
                              state filter entity: {{input_entity}}, 
                              required states: {{input_states}}, 
                              State Filter TEST: {{'PASS' if not state_only or states(input_entity) in states_filter else 'FAIL' }},

image

SgtBatten commented 3 months ago

You need to enable debug and look at the output. That's just the input you posted.

Instructions here: https://github.com/SgtBatten/HA_blueprints/blob/main/Frigate%20Camera%20Notifications/Guide%3A%20Debug%20Option.md