X
The twitter
notification platform uses X
Setup
Make sure you have a developer account registered with X, then go to X Apps
App permissions
If you do not perform this step, your application will only receive read permissions and will not be able to post tweets on behalf of your account on X.
- Visit Settings of the application.
- Select
Set up
under User authentication settings. - Check the box for
OAuth 1.0a
. - Set the app permission to
Read and write
. - Enter a
callback
andwebsite
URL and click save.
It does not matter for the integration what you enter as a callback or website URL.
Generate tokens and secrets
- Visit Keys and tokens of the application.
- Select
Regenerate
under Consumer keys to get your Consumer Key and Consumer Secret. - Select
Regenerate
under Access Tokens and Secret to get your Access Token and Access Token Secret.
Configuration
To add X to your installation, add the following to your configuration.yaml
configuration.yaml 文件是 Home Assistant 的主要配置文件。它列出了要加载的集成及其特定配置。在某些情况下,需要直接在 configuration.yaml 文件中手动编辑配置。大多数集成可以在 UI 中配置。 [Learn more] file:
# Example configuration.yaml entry
notify:
- name: NOTIFIER_NAME
platform: twitter
consumer_key: YOUR_API_KEY
consumer_secret: YOUR_API_SECRET
access_token: YOUR_ACCESS_TOKEN
access_token_secret: YOUR_ACCESS_SECRET
Configuration Variables
Setting the optional parameter name
allows multiple notifiers to be created. The notifier will bind to the notify.NOTIFIER_NAME
action.
To use notifications, please see the getting started with automation page.