so i want a automation where if i recevie a message on whatsap my wled light turns on in a specific light color i got this code from here
but i cant get it to work this is what i have
alias: Whatsap Notification Per Person
description: Adds a individual colour representation to your facebook friends
trigger:
- platform: state
entity_id: sensor.a_fold_4_last_notification
for:
hours: 0
minutes: 0
seconds: 0
condition:
- condition: template
value_template: |-
{% set pk = state_attr('sensor.a_fold_4_last_notification','package') %}
{{ 'com.whatsapp' in pk }}
action:
- choose:
- conditions:
- condition: template
value_template: >-
{{ 'Brother' in
state_attr('sensor.a_fold_4_last_notification','android.title') }}
sequence:
- service: light.turn_on
target:
entity_id: light.wled
data:
rgb_color:
- 255
- 255
- 0
brightness_pct: 100
effect: Sine
- delay:
hours: 0
minutes: 0
seconds: 2
milliseconds: 0
- service: light.turn_off
target:
entity_id: light.wled
data: {}
- conditions:
- condition: template
value_template: >-
{{ 'Mom' in
state_attr('sensor.a_fold_4_last_notification','android.title') }}
sequence:
- service: light.turn_on
target:
entity_id: light.wled
data:
rgb_color:
- 255
- 0
- 255
brightness_pct: 100
effect: Sine
- delay:
hours: 0
minutes: 0
seconds: 2
milliseconds: 0
- service: light.turn_off
target:
entity_id: light.wled
data: {}
default: []
mode: single