its working perfectly.
If anyone else wants to re-create this ill post the final setup here.
You need to change the following bits to match your own:
- sensor.sm_a520f_last_notification <— the phone that You are using
- person 1 and person 2 <— names of the people on your facebook
- entity_id: light.wled <— the light you are using
alias: Facebook Notification Per Person
description: Adds a individual colour representation to your facebook friends
trigger:
- platform: state
entity_id: sensor.sm_a520f_last_notification
for:
hours: 0
minutes: 0
seconds: 0
condition:
- condition: template
value_template: |-
{% set pk = state_attr('sensor.sm_a520f_last_notification','package') %}
{{ 'com.facebook.orca' in pk }}
action:
- choose:
- conditions:
- condition: template
value_template: >-
{{ 'Person 1' in
state_attr('sensor.sm_a520f_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
- conditions:
- condition: template
value_template: >-
{{ 'Person 2' in
state_attr('sensor.sm_a520f_last_notification','android.title') }}
sequence:
- service: light.turn_on
target:
entity_id: light.wled
data:
rgb_color:
- 0
- 255
- 255
brightness_pct: 100
effect: Sine
- delay:
hours: 0
minutes: 0
seconds: 2
milliseconds: 0
- service: light.turn_off
target:
entity_id: light.wled
default: []
mode: single