Notify username when someone home

Hello

What im trying to do is when a member of family comes home it just notifies that name I have tried different examples and nothing seems to work so im hoping that someone can help here.

  • alias: ‘Mobile Home’
    trigger:
    platform: state
    entity_id:
    • device_tracker.user1
    • device_tracker.user2
    • device_tracker.user3
      state: ‘home’

action:

  • service: switch.turn_on
    entity_id:
    • switch.bedroom_led_power_onoff
    • switch.green_led
  • service: notify.push_firestick
    data:
    message: “Someone is Home”

thanks

Try this:

- alias: 'Mobile Home'
  trigger:
    platform: state
    entity_id: device_tracker.user1, device_tracker.user2, device_tracker.user3
    from: 'not_home'
    to: 'home'
  action:  
    service: notify.push_firestick
      data:
        message: "Someone is Home"

Or even better:

- alias: 'Mobile Home'
  trigger:
    platform: state
    entity_id: device_tracker.user1, device_tracker.user2, device_tracker.user3
    from: 'not_home'
    to: 'home'
  action:  
    service: notify.push_firestick
      data_template:
        message: "{{  trigger.device_tracker.attributes.friendly_name  }} is Home"
1 Like

thank you for the fast response. Here the code i now have

- alias: 'Mobile Home'
  trigger:
    platform: state
    entity_id: device_tracker.user1, device_tracker.user2
    from: 'not_home'
    to: 'home'
  action:  
  - service: switch.turn_on
    entity_id: 
     - switch.bedroom_led_power_onoff
     - switch.green_led
  -  service: notify.push_firestick
     data_template:
       message: "{{  trigger.device_tracker.attributes.friendly_name  }} is Home"
  - service: persistent_notification.create
    data_template:
       message: "{{  trigger.device_tracker.attributes.friendly_name  }} is Home"

but now it doesn’t show any notifications

here my customize:

customize:
  device_tracker.user1:
    friendly_name: member1 Mobile
  device_tracker.user2:
    friendly_name: member2 Mobile

im i doing something wrong.

thanks

You may need single quotes round your names…

customize:
  device_tracker.user1:
    friendly_name: 'member1 Mobile'

I have been trying this for a few days now I still cant it to work.

If i change the data_template to data the message “is home” works. With data_template: nothing is pushed in message. Only option is to automation each user separate which i was going to avoid.
Anyone have anymore ideas

Thanks

Try the following…
You have an extra space between the - and service

  - service: notify.push_firestick
    data_template:
      message: "{{  trigger.from_state.attributes.friendly_name  }} is Home"

@aimwarlock did you try this?