home-assistant.io/source/_components/notify.facebook.markdown
2017-02-06 14:02:05 +01:00

3.1 KiB

layout, title, description, date, sidebar, comments, sharing, footer, logo, ha_category, ha_release
layout title description date sidebar comments sharing footer logo ha_category ha_release
page Facebook Messenger Instructions how to add Facebook user notifications to Home Assistant. 2016-12-31 14:14 true false true true facebook.png Notifications 0.36

The facebook notification platform enables sending notifications via Facebook Messenger, powered by Facebook.

To use this notification platform in your installation, add the following to your configuration.yaml file:

# Example configuration.yaml entry
notify:
  - name: NOTIFIER_NAME
    platform: facebook
    page_access_token: FACEBOOK_PAGE_ACCESS_TOKEN

Configuration variables:

  • page_access_token (Required): Access token for your facebook page. Checkout Facebook Messenger Platform for more information.
  • name (Optional): Setting the optional parameter name allows multiple notifiers to be created. The default value is notify. The notifier will bind to the service notify.NOTIFIER_NAME.

{% linkable_title Usage %}

With Facebook notify service, you can send your notifications to your facebook messenger with help of your facebook page. You have to create a Facebook Page and App for this service. You can control it by calling the notify service as described here. It will send a message on messenger to user specified by target on behalf of your page. See the quick start guide for more information. The phone number used in target should be registered with facebook messenger. Phone number of the recipient should be in +1(212)555-2368 format. If your app is not approved by facebook then the recipient should by either admin, developer or tester for your facebook app. More...

# Example automation notification entry
automation:
  - alias: Evening Greeting
    trigger:
      platform: sun
      event: sunset
    action:
      service: notify.facebook
      data:
        message: 'Good Evening'
        target:
          - +919413017584
          - +919784516314

{% linkable_title Rich messages %}

You could also send rich messing (cards, buttons, images, videos, etc). Info to which types or messages and how to build them.

# Example script with a notification entry with rich message

script:
  test_fb_notification:
    sequence:
      - service: notify.facebook
        data:
          message: Some text before the quick replies
          target: 0034643123212
          data:
            quick_replies:
              - content_type: text
                title: Red
                payload: DEVELOPER_DEFINED_PAYLOAD_FOR_PICKING_RED
              - content_type: text
                title: Blue
                payload: DEVELOPER_DEFINED_PAYLOAD_FOR_PICKING_BLUE