Line Notify with MicroPython on ESP32/ESP8266
MIT License
It is a MicroPython library for sending notifications to Line Notify,which can be used with ESP8266 and ESP32.
Can send both text messages, stickers and images.
Before you receive any messages, you need to install this library on your device.
by choosing one of the following methods:
Manual upload
Package Management in Thonny IDE
Login at https://notify-bot.line.me/en/.
At the top-right dropdown menu, select my page .
Scroll down the browser window to find Generate Token.
Enter your Notify Name then select chat or group.
Click Generate Token, and the token will be generated.
from linenotify import LineNotify
line = LineNotify('<token>')
line.notify('<message>')
Sticker List: https://developers.line.biz/en/docs/messaging-api/sticker-list/
line.notifySticker('<Sticker Package ID>','<Sticker ID>','<Message>')
line.notifyImageURL('<Image URL>','<Message>')
# Import Library
from linenotify import LineNotify
from network import WLAN,STA_IF
# Network Setup
ssid = '<ssid>'
password = '<password>'
wlan = WLAN(STA_IF)
wlan.active(True)
print('Connecting...')
wlan.connect(ssid,password)
while not wlan.isconnected():
pass
print(wlan.ifconfig())
# Set Line Token
line = LineNotify('<token>')
# Notify text message
line.notify('Hello World!')
# Notify sticker with message
line.notifySticker(3,240,'Nice Sticker')
# Notify image from URL with message
line.notifyImageURL('https://static.wikia.nocookie.net/chainsaw-man/images/1/1b/Pochita.PNG','Pochita')
https://developers.line.biz/en/docs/messaging-api/sticker-list/