Enable Javascript


Last Arduino/ESP8266 project (click to open)

User Rating: 5 / 5

Star ActiveStar ActiveStar ActiveStar ActiveStar Active
 

Article Index

How to create or change a unit record
Open simpleHomeSwitch.html (included in download) and click the sHS commands list button.
All the function 1 commands create a new record with default values (simpleDB.ino->void newRecord()).
   A new record is added or, if the key already exists, just overwritten (no warning!).
All the function 2 commands (over)write only the respective default values.

Example set on Node03 a record key to switch pin D3 every day: 080:00 ON and 20:30 OFF. toID func cmd data1 data2 data3 data4 03 1 3 pump D3 -1 set the key and pin D2 (data3: -1? see "Explanation Pin setup") 03 2 1 pump 08:00 20:30 ON 8:00, OFF 20:30 03 2 0 pump 1 set auto time 1 action mode TIME 03 0 0 pump 0/1 manual OFF/ON (Web Browser or App) Example set on NodeWS a record key to switch OLD KaKu (CoCo) every day on sunRISE or sunSET. toID func cmd data1 data2 data3 data4 WS 1 0 lamp 118124 322 set the key, KaKu code and KaKu period WS 2 1 lamp 06:30 23:00 mode 4: ON time (OFF=sunrise+offset), mode5:(ON=sunSet-offset) OFF time WS 2 5 lamp 15 15 mode 4: +offset sunRise, mode5: -offset sunSet WS 2 0 lamp 4 or 5 set auto time action, mode 4: sunRISE or mode 5: sunSET WS 0 0 lamp 0/1 manual OFF/ON (Web Browser or App) Example set on Node04 a record key to switch a boiler on time and temperature. By example: Sonoff TH16 WiFi Smart Switch + Sonoff TH Sensor DS18B20 ON: if TimeON&&TempON OFF: if TimeOFF||TempOff toID func cmd data1 data2 data3 data4 04 1 3 blr1 D6 -1 set the key and (Sonoff)relay pin 04 2 1 blr1 06:30 23:00 mode 10: ON time, mode10:OFF time 04 2 4 blr1 58 62 mode 10: ON temp, mode10:OFF temp 04 2 0 blr1 10 set auto TimeTemp action, mode 10 04 0 0 blr1 0/1 manual OFF/ON (Web Browser or App) Example set on Node00 a record key to switch a sun screen on room temperature and luminance with button bridge optocouplers. DOWN: if Lux>=LuxDOWN && Temp>=TempDOWN && YoYo
UP: if Lux<=BadWeatherLux
UP: if (Lux<LuxUP || Temp<TempUP) && YoYo Bridged remote control buttons from Wireless Tubular Sun Screen Motor. toID func cmd data1 data2 data3 data4 00 1 3 scrn D3 D4 set the key, DOWN D3 and UP D4 optocoupler pins 00 2 3 scrn 380 60 LuxDOWN 380, LuxUP 60 (room luminance) 00 2 4 scrn 21.5 21 TempDOWN 21.5, TempUP 21 (room temperature, default *C or set *F) 00 2 6 scrn 10 delay time 10 minutes to prevent the Yo-Yo effect 00 2 7 scrn 4 500 repetitions 4, delay 500 Millis (two momentary button actions) 00 2 8 scrn 30 BadWeatherLux 30 (quick UP) 00 2 0 scrn 6 set auto sun 6 action mode SUN 00 0 0 scrn 1/0 manual DOWN/UP (Web Browser or App)