Hi,
I started learning python last week and created my first custom component. I only completed basic python learning course and still learning. I will delete the post if the post is not appropriate.
My telegram notification component sometimes misses photo attachments from home assistant, probably due to slow internet speed at home, and I decided to try line notify API.
First you will need to download line app for Androidor iOS and create account using mobile phone number and email account.
After creating an account, go to Notify line API to create a service
Once you create a service, You will find client ID and client secret from the service.
Next, include your client id and callback URL from the service to the below address and copy it the address bar of your browser. Callback URL must on one of the addresses included in your service. I used https://google.com as callback URL for convenience.
https://notify-bot.line.me/oauth/authorize?response_type=code&client_id=[YOUR CLIENT ID]&redirect_uri=[CALL BACK URL]&scope=notify&state=NO_STATE
It will direct you to agree and connect to the service you created.
Once you agree, you will be redirected to call back URL address and you will see the code on your address bar.
Next is to install Postman from the link.
Include the code from the address bar, callback id, client id and client_secret and send via http post and you will be given an access token.
configuration example
notify:
- name: line_notification
platform: notify_line
access_token: 'your access code from postman'
example: Automation
Automation:
- data:
data:
file: /config/tmp/test.jpg
url: https://www.google.com.au/logos/doodles/2018/world-cup-2018-day-4-6231253740158976-5721036024709120-ssw.png
stkpkgid: 1
stkid: 2
message: Front gate snapshot 3
service: notify.line_notification
if you provide both file and url, file takes precedence and url will be ignored.
My understanding is that Line notify API only supports message, image and sticker at the moment.
Both stkpkgid and stkid should be present from sticker list in order to use the stickers.
Sorry if this is confusing, I will delete the post if the post does not follow the home assistant guidelines.
Thank you.