NodeMCU lua scripts for smart window blinds. Allows to control motorized window blinds via http get requests and set alarms to open\close blinds. The following modules are required in NodeMCU firmware: file, gpio, net, node, rtctime, sntp, tmr, uart, wifi.
Change your Wi-Fi hotspot name, password and ip settings in init.lua file.
Based on lightweight HTTP server NodeMCU-HTTP-Server.
Returns settings JSON object with up\down timings for each motor:
{"status": "success", "downLeft": 12000, "downRight": 12000, "upLeft": 15000, "upRight": 15000}
Setup timings for motors
Left or right
Up or down
Integer, time in ms
Command for opening window blinds
Command for closing window blinds
Command for stopping window blinds
Returns the current position of blinds
{"status": "success","position":"up"}
up or down
Resets current position of blinds
up or down
Returns JSON object containing alarms for opening\closing blinds
{"status": "success", "up": "-1", "down": "-1"})
-1 if alarm is not set or seconds since the Unix epoch otherwise. Alarm is repeated daily after it is triggered.
Setup the alarm for opening\closing blinds
up or down
Time is seconds since the Unix epoch. Alarm is repeated daily. If time is in past then it will be triggered tomorrow.