This will switch on or off a fritz power plug according to the price of the electricity company awattar: https://www.awattar.de/tariffs/hourly
Using the fritzapi by andig -> https://github.com/andig/fritzapi
git clone https://github.com/moritzmair/plugswitch.gitcd plugswitchnpm installcp config.json.example config.jsonnano config.json(enter your login data here)
node index.js
It is a good idea to use this script on a raspberry pi, to run it you could use pm2:
npm install pm2pm2 startup(to autostart pm2 on boot)pm2 start index.jspm2 save(to save that the line above should always be started on startup)- view logs with
pm2 log
Please use the Issue tracker on github: https://github.com/moritzmair/plugswitch/issues