Sports tracking - Home Assistant Automations

Поділитися
Вставка
  • Опубліковано 21 жов 2024

КОМЕНТАРІ • 12

  • @davidegiorgi1672
    @davidegiorgi1672 Місяць тому

    hi . i have a question , template must be configurated in configuration.yaml?

    • @brenvelm
      @brenvelm  Місяць тому

      You use yaml within automation itself, not the configuration.yaml

  • @CookieCreative-ir2ii
    @CookieCreative-ir2ii 2 місяці тому

    I'm having major issues with this - would you mind pasting the entire automation yaml please?

    • @brenvelm
      @brenvelm  2 місяці тому

      Most The automation follows the following logic (replace square brackets with angled ones):
      alias: Sports Football Teams
      description: ""
      trigger:
      - platform: state
      entity_id:
      - sensor.man_city
      attribute: team_score
      id: Mancityscored
      - platform: state
      entity_id:
      - sensor.mu
      attribute: team_score
      id: Manuscored
      condition:
      - condition: or
      conditions:
      - condition: state
      entity_id: sensor.man_city
      state: IN
      - condition: state
      entity_id: sensor.mu
      state: IN
      action:
      - choose:
      - conditions:
      - condition: trigger
      id:
      - Mancityscored
      sequence:
      - data:
      title: Man City scored
      message: >-
      [[ state_attr('sensor.man_city', 'team_name') ]]
      [[state_attr('sensor.man_city', 'team_score') ]] :
      [[state_attr('sensor.man_city', 'opponent_score') ]]
      [[state_attr('sensor.man_city', 'opponent_name') ]]
      action: notify.mobile_app_w_iphone_15_pro
      - conditions:
      - condition: trigger
      id:
      - Mancityopponentscored
      sequence:
      - data:
      title: Man City conceded
      message: >-
      [[state_attr('sensor.man_city', 'team_name') ]]
      [[state_attr('sensor.man_city', 'team_score') ]] :
      [[state_attr('sensor.man_city', 'opponent_score') ]]
      [[state_attr('sensor.man_city', 'opponent_name') ]]
      action: notify.mobile_app_w_iphone_15_pro
      - conditions:
      - condition: trigger
      id:
      - Manuscored
      sequence:
      - data:
      title: Man U scored
      message: >-
      [[state_attr('sensor.mu', 'team_name') ]]
      [[state_attr('sensor.mu', 'team_score') ]] :
      [[state_attr('sensor.mu', 'opponent_score') ]]
      [[state_attr('sensor.mu', 'opponent_name') ]]
      action: notify.mobile_app_w_iphone_15_pro
      - conditions:
      - condition: trigger
      id:
      - Manuopponentscored
      sequence:
      - data:
      title: Man U conceded
      message: >-
      [[state_attr('sensor.mu', 'team_name') ]]
      [[state_attr('sensor.mu', 'team_score') ]] :
      [[state_attr('sensor.mu', 'opponent_score') ]]
      [[state_attr('sensor.mu', 'opponent_name') ]]
      action: notify.mobile_app_w_iphone_15_pro

  • @benmathews1086
    @benmathews1086 9 місяців тому

    Thanks for the video! How updated is this info? Would love to create an automation to flash some lights if my team scores. Is that possible?

    • @brenvelm
      @brenvelm  9 місяців тому

      In my experience it’s pretty much instant. And I am sure you can use it automation the way you want - will try myself actually - great shout!

    • @kylegurney8610
      @kylegurney8610 8 місяців тому

      Also interested in the light show. As far as the attributes go what displays when the team scores? Or what would you use to trigger the automation to flash the lights?

    • @brenvelm
      @brenvelm  8 місяців тому

      @@kylegurney8610 I’d say you should either use TeamScore or OpponentScore attribute. Or both actually. You can set each of them as separate triggers and then assign actions accordingly (flash red for opponent, flash whatever for your team)

    • @kylegurney8610
      @kylegurney8610 8 місяців тому

      Got it, has there been any breaking changes to this? It keeps asking me to add a 2-character language code to use for the API call. Or is that only for leagues not native to the integration?

    • @brenvelm
      @brenvelm  8 місяців тому

      Probably... have you tried to enter EN for the language code?

  • @stephan02071971
    @stephan02071971 8 місяців тому

    Its a bit to slow explained and very nice music.

    • @brenvelm
      @brenvelm  8 місяців тому

      Thank you for your feedback!