Skip to content

hitochan777/denki-line-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Electricity price alert to LINE

Sends notifications to a LINE channel when electricity (denki) price is gets high or low.

I gave up making a LINE account public because broadcasting messages on LINE is costy.
So you need to prepare infrastractures like LINE account etc by yourself.

Architecture

A scheduled function on Cloudflare fetches electricity prices from an external API every 30 mins (You can customize the frequency if you want).
If the price is on alert (expensive) o cheap, it sends a message to a LINE channel.

Note that information from the external API only contains prices from Japanese electricity companies.

Requirements

  • Cloudflare account
  • LINE Channel access token / Channel secret
  • Node.js (>= 16.x)
  • pnpm

Installation

pnpm add -g wrangler # Run only if you do not have wrangler installed
pnpm i --frozen-lockfile
wrangler secret put CHANNEL_ACCESS_TOKEN <LINE Channel access token>
wrangler secret put CHANNEL_SECRET <LINE Channel secret>

Deployment

wrangler publish

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published