mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-26 22:22:16 +03:00
global change 1 mb working version
This commit is contained in:
BIN
data/edit.htm.gz
BIN
data/edit.htm.gz
Binary file not shown.
@@ -20,10 +20,8 @@
|
|||||||
20;0;bmp280-temp;id;anydataTemp;Сенсоры;Температура;order;addr[0x76];c[1]
|
20;0;bmp280-temp;id;anydataTemp;Сенсоры;Температура;order;addr[0x76];c[1]
|
||||||
21;0;impuls-out;id;na;na;na;order;pin
|
21;0;impuls-out;id;na;na;na;order;pin
|
||||||
22;0;count-down;id;anydata;Таймер;Обратный#отчет;order
|
22;0;count-down;id;anydata;Таймер;Обратный#отчет;order
|
||||||
23;0;modbus;id;anydata;Modbus;Регистр;order;addr[1];reg[0];c[1]
|
23;0;inoutput;id;anydata;Вывод;Вывод#uart;order
|
||||||
24;0;button-out;id;toggle;Кнопки;Освещение;order;type[UART]
|
24;0;logging;id;chart;Графики;История;order;val[any];int[60];cnt[100]
|
||||||
25;0;inoutput;id;anydata;Вывод;Вывод#uart;order
|
25;0;uptime;id;anydataTime;Системные;%name%#uptime;order
|
||||||
26;0;logging;id;chart;Графики;История;order;val[any];int[60];cnt[100]
|
|
||||||
27;0;uptime;id;anydataTime;Системные;%name%#uptime;order
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,46 +0,0 @@
|
|||||||
0;dallas-temp;t1;anydataTemp;Термостат1;Температура;1;pin[2];index[0];int[10]
|
|
||||||
0;logging;log1;chart;Термостат1;История;2;val[t1];int[60];cnt[100]
|
|
||||||
0;inoutput;tUp1;inputDigit;Термостат1;Верхний#порог;3
|
|
||||||
0;inoutput;tLow1;inputDigit;Термостат1;Нижний#порог;4
|
|
||||||
0;button-out;btn1;toggle;Термостат1;Нагрев;5;pin[12]*
|
|
||||||
0;dallas-temp;t2;anydataTemp;Термостат2;Температура;1;pin[2];index[0];int[60]
|
|
||||||
0;logging;log2;chart;Термостат2;История;2;val[t2];int[10];cnt[100]
|
|
||||||
0;inoutput;threshold;inputDigitTemp;Термостат2;Заданная#температура;3
|
|
||||||
0;button-out;heater2;toggle;Термостат2;Нагреватель;7;pin[12]
|
|
||||||
0;inoutput;time21;inputTimeClock;Расписание2;Утренний#период;8
|
|
||||||
0;inoutput;threshold1;inputDigitTemp;Расписание2;Температура;9
|
|
||||||
0;inoutput;time22;inputTimeClock;Расписание2;Дневной#период;10
|
|
||||||
0;inoutput;threshold2;inputDigitTemp;Расписание2;Температура;11
|
|
||||||
0;inoutput;time23;inputTimeClock;Расписание2;Вечерний#период;12
|
|
||||||
0;inoutput;threshold3;inputDigitTemp;Расписание2;Температура;13
|
|
||||||
0;inoutput;time24;inputTimeClock;Расписание2;Ночной#период;14
|
|
||||||
0;inoutput;threshold4;inputDigitTemp;Расписание2;Температура;15*
|
|
||||||
0;dht-hum;h3;anydataHum;Теплица3;Влажность;1;pin[2];type[dht11];c[1]
|
|
||||||
0;logging;log3;chart;Теплица3;История;2;val[hum];int[60];cnt[100]
|
|
||||||
0;inoutput;hUp3;inputDigit;Теплица3;Верхний#порог;3
|
|
||||||
0;inoutput;hLow3;inputDigit;Теплица3;Нижний#порог;4
|
|
||||||
0;button-out;hUp3;toggle;Теплица3;Полив;5;pin[12]*
|
|
||||||
0;button-out;btn41;toggle;Реле4;Освещение;1;pin[12]
|
|
||||||
0;button-out;btn42;toggle;Реле4;Освещение;2;pin[13]
|
|
||||||
0;inoutput;time41;inputTime;Реле4;Введите#время#включения;3
|
|
||||||
0;inoutput;time42;inputTime;Реле4;Введите#время#выключения;4*
|
|
||||||
0;button-out;btn51;toggle;Свет5;Выключить#все;1
|
|
||||||
0;button-out;btn52;toggle;Свет5;Гостинная;2;pin[12]
|
|
||||||
0;button-out;btn53;toggle;Свет5;Спальня;3;pin[13]
|
|
||||||
0;button-out;btn54;toggle;Свет5;Прихожая;4;pin[14]
|
|
||||||
0;pwm-out;pwm51;range;Свет5;Яркость;5;pin[15]
|
|
||||||
0;pwm-out;pwm52;range;Свет5;Яркость;6;pin[16]
|
|
||||||
0;inoutput;txt5;anydata;Свет5;Статус;7*
|
|
||||||
0;button-out;button;toggle;Таймер;Освещение;1;pin[12]
|
|
||||||
0;count-down;count;anydata;Таймер;Обратный#отчет;2
|
|
||||||
0;inoutput;input;inputDigit;Таймер;Введите#цифру;3*
|
|
||||||
0;inoutput;text;anydataAlarm;Сигнализация;Движение:;1
|
|
||||||
0;inoutput;time;anydataTime;Сигнализация;Время:;2
|
|
||||||
0;button-in;sensor;na;na;na;3;pin[0];db[20]
|
|
||||||
0;button-out;reset;toggle;Сигнализация;Сбросить;4*
|
|
||||||
0;button-in;sensor;na;na;na;1;pin[0];db[20]
|
|
||||||
0;button-out;light;toggle;Освещение;Освещение;2;pin[13]
|
|
||||||
0;count-down;count;anydata;Освещение;Обратный#отчет;3
|
|
||||||
0;inoutput;period;inputDigit;Освещение;Период#включения;4*
|
|
||||||
0;button-out;light;toggle;Кнопки;Освещение;1;pin[13]
|
|
||||||
0;button-in;switch;na;na;na;2;pin[0];db[20]*
|
|
||||||
@@ -1,84 +0,0 @@
|
|||||||
t1 > tUp1
|
|
||||||
btn1 0
|
|
||||||
telegram нагрев#выключен 1
|
|
||||||
end
|
|
||||||
t1 < tLow1
|
|
||||||
btn1 1
|
|
||||||
telegram нагрев#включен 1
|
|
||||||
end*
|
|
||||||
t2 > threshold+-2
|
|
||||||
heater2 0
|
|
||||||
end
|
|
||||||
t2 < threshold+-2
|
|
||||||
heater2 1
|
|
||||||
end
|
|
||||||
timenow = time21
|
|
||||||
threshold threshold1
|
|
||||||
end
|
|
||||||
timenow = time22
|
|
||||||
threshold threshold2
|
|
||||||
end
|
|
||||||
timenow = time23
|
|
||||||
threshold threshold3
|
|
||||||
end
|
|
||||||
timenow = time24
|
|
||||||
threshold threshold4
|
|
||||||
end*
|
|
||||||
h3 > hUp3
|
|
||||||
hUp3 0
|
|
||||||
telegram полив#выключен 1
|
|
||||||
end
|
|
||||||
h3 < hLow3
|
|
||||||
hUp3 1
|
|
||||||
telegram полив#включен 1
|
|
||||||
end*
|
|
||||||
timenow = time41
|
|
||||||
btn41 1
|
|
||||||
btn42 0
|
|
||||||
end
|
|
||||||
timenow = time42
|
|
||||||
btn41 0
|
|
||||||
btn42 1
|
|
||||||
end*
|
|
||||||
btn51 = 1
|
|
||||||
btn52 1
|
|
||||||
btn53 1
|
|
||||||
btn54 1
|
|
||||||
pwm51 200
|
|
||||||
pwm52 800
|
|
||||||
txt5 включено
|
|
||||||
end
|
|
||||||
btn51 = 0
|
|
||||||
btn52 0
|
|
||||||
btn53 0
|
|
||||||
btn54 0
|
|
||||||
pwm51 800
|
|
||||||
pwm52 200
|
|
||||||
txt5 выключено
|
|
||||||
end*
|
|
||||||
button = 1
|
|
||||||
count input
|
|
||||||
end
|
|
||||||
count = 0
|
|
||||||
button 0
|
|
||||||
end*
|
|
||||||
sensor = 1
|
|
||||||
text обнаружено
|
|
||||||
time %date%
|
|
||||||
telegram text обнаружено#движение 1
|
|
||||||
end
|
|
||||||
reset = 1
|
|
||||||
text не#обнаружено
|
|
||||||
time %date%
|
|
||||||
reset 0
|
|
||||||
end*
|
|
||||||
sensor = 1
|
|
||||||
light 1
|
|
||||||
count period
|
|
||||||
end
|
|
||||||
count = 0
|
|
||||||
light 0
|
|
||||||
end*
|
|
||||||
switch = 1
|
|
||||||
light change
|
|
||||||
end*
|
|
||||||
@@ -92,11 +92,9 @@
|
|||||||
"/set?addItem=20-ps": "20.Датчик давления bmp280",
|
"/set?addItem=20-ps": "20.Датчик давления bmp280",
|
||||||
"/set?addItem=21-ips": "21.Создать импульсы через заданный промежуток времени (управление шд)",
|
"/set?addItem=21-ips": "21.Создать импульсы через заданный промежуток времени (управление шд)",
|
||||||
"/set?addItem=22-cnt": "22.Таймер обратного отчета",
|
"/set?addItem=22-cnt": "22.Таймер обратного отчета",
|
||||||
"/set?addItem=23-mb": "23.Прочитать регистр modbus устройства",
|
"/set?addItem=23-txt": "23.Виджет для отображения информации полученной из uart, get-запроса, или по udp",
|
||||||
"/set?addItem=24-btn": "24.UART кнопка (шлет свое состояние в UART)",
|
"/set?addItem=24-log": "24.Логгирование и вывод в график любой величины",
|
||||||
"/set?addItem=25-txt": "25.UART виджет (позволяет вывести полученные данные в любой виджет)",
|
"/set?addItem=25-ut": "25.Отобразить время работы устройства"
|
||||||
"/set?addItem=26-log": "26.Логгирование и вывод в график любой величины",
|
|
||||||
"/set?addItem=27-ut": "27.Отобразить время работы устройства"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -52,6 +52,16 @@
|
|||||||
{
|
{
|
||||||
"type": "hr"
|
"type": "hr"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "checkbox",
|
||||||
|
"name": "uartEvents",
|
||||||
|
"title": "Включить отправку всех событий в UART",
|
||||||
|
"action": "/set?uartEvents=[[uartEvents]]",
|
||||||
|
"state": "{{uartEvents}}"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "hr"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "h4",
|
"type": "h4",
|
||||||
"title": "Скорость",
|
"title": "Скорость",
|
||||||
|
|||||||
BIN
doc/calculator.xlsx
Normal file
BIN
doc/calculator.xlsx
Normal file
Binary file not shown.
1
doc/old files/items/analog-adc.txt
Normal file
1
doc/old files/items/analog-adc.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
0;analog-adc;id;fillgauge;Сенсоры;Аналоговый;order;gol;map[0,1024,0,100];c[1]
|
||||||
1
doc/old files/items/bme280-hum.txt
Normal file
1
doc/old files/items/bme280-hum.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
0;bme280-hum;id;anydataHum;Сенсоры;Влажность;order;addr[0x76];c[1]
|
||||||
1
doc/old files/items/bme280-press.txt
Normal file
1
doc/old files/items/bme280-press.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
0;bme280-press;id;anydataPress;Сенсоры;Давление;order;addr[0x76];c[1]
|
||||||
1
doc/old files/items/bme280-temp.txt
Normal file
1
doc/old files/items/bme280-temp.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
0;bme280-temp;id;anydataTemp;Сенсоры;Температура;order;addr[0x76];c[1]
|
||||||
1
doc/old files/items/bmp280-press.txt
Normal file
1
doc/old files/items/bmp280-press.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
0;bmp280-press;id;anydataPress;Сенсоры;Давление;order;addr[0x76];c[1]
|
||||||
1
doc/old files/items/bmp280-temp.txt
Normal file
1
doc/old files/items/bmp280-temp.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
0;bmp280-temp;id;anydataTemp;Сенсоры;Температура;order;addr[0x76];c[1]
|
||||||
1
doc/old files/items/button-in.txt
Normal file
1
doc/old files/items/button-in.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
0;button-in;id;toggle;Кнопки;Освещение;order;pin;db[20]
|
||||||
1
doc/old files/items/button-out.inv.txt
Normal file
1
doc/old files/items/button-out.inv.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
0;button-out;id;toggle;Кнопки;Освещение;order;pin;inv[1]
|
||||||
1
doc/old files/items/button-out.npin.txt
Normal file
1
doc/old files/items/button-out.npin.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
0;button-out;id;toggle;Кнопки;Освещение;order
|
||||||
1
doc/old files/items/button-out.pin.txt
Normal file
1
doc/old files/items/button-out.pin.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
0;button-out;id;toggle;Кнопки;Освещение;order;pin
|
||||||
1
doc/old files/items/count-down.txt
Normal file
1
doc/old files/items/count-down.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
0;count-down;id;anydata;Таймер;Обратный#отчет;order
|
||||||
1
doc/old files/items/dallas-temp.txt
Normal file
1
doc/old files/items/dallas-temp.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
0;dallas-temp;id;anydataTemp;Сенсоры;Температура;order;sal;index[0];int[10]
|
||||||
1
doc/old files/items/dht11-hum.txt
Normal file
1
doc/old files/items/dht11-hum.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
0;dht-hum;id;anydataHum;Сенсоры;Влажность;order;thd;type[dht11];c[1]
|
||||||
1
doc/old files/items/dht11-temp.txt
Normal file
1
doc/old files/items/dht11-temp.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
0;dht-temp;id;anydataTemp;Сенсоры;Температура;order;thd;type[dht11];c[1]
|
||||||
1
doc/old files/items/dht22-hum.txt
Normal file
1
doc/old files/items/dht22-hum.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
0;dht-hum;id;anydataHum;Сенсоры;Влажность;order;thd;type[dht22];c[1]
|
||||||
1
doc/old files/items/dht22-temp.txt
Normal file
1
doc/old files/items/dht22-temp.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
0;dht-temp;id;anydataTemp;Сенсоры;Температура;order;thd;type[dht22];c[1]
|
||||||
1
doc/old files/items/impuls-out.txt
Normal file
1
doc/old files/items/impuls-out.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
0;impuls-out;id;na;na;na;order;pin
|
||||||
1
doc/old files/items/input-digit.txt
Normal file
1
doc/old files/items/input-digit.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
0;inoutput;id;inputDigit;Ввод;Введите#цифру;order
|
||||||
1
doc/old files/items/input-time.txt
Normal file
1
doc/old files/items/input-time.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
0;inoutput;id;inputTime;Ввод;Введите#время;order
|
||||||
1
doc/old files/items/logging.txt
Normal file
1
doc/old files/items/logging.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
0;logging;id;chart;Графики;История;order;val[any];int[60];cnt[100]
|
||||||
1
doc/old files/items/modbus.txt
Normal file
1
doc/old files/items/modbus.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
0;modbus;id;anydata;Modbus;Регистр;order;addr[1];reg[0];c[1]
|
||||||
1
doc/old files/items/output-text.txt
Normal file
1
doc/old files/items/output-text.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
0;inoutput;id;anydata;Вывод;Сигнализация;order
|
||||||
1
doc/old files/items/pwm-out.txt
Normal file
1
doc/old files/items/pwm-out.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
0;pwm-out;id;range;Ползунки;Яркость;order;pin
|
||||||
1
doc/old files/items/uart-button.txt
Normal file
1
doc/old files/items/uart-button.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
0;button-out;id;toggle;Кнопки;Освещение;order;type[UART]
|
||||||
1
doc/old files/items/uart-widget.txt
Normal file
1
doc/old files/items/uart-widget.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
0;inoutput;id;anydata;Вывод;Вывод#uart;order
|
||||||
1
doc/old files/items/ultrasonic-cm.txt
Normal file
1
doc/old files/items/ultrasonic-cm.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
0;ultrasonic-cm;id;anydata;Сенсоры;Расстояние;order;cin;map[0,500,0,100];c[1];int[10]
|
||||||
1
doc/old files/items/uptime.txt
Normal file
1
doc/old files/items/uptime.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
0;uptime;id;anydataTime;Системные;%name%#uptime;order
|
||||||
5
doc/old files/presets/1.c.txt
Normal file
5
doc/old files/presets/1.c.txt
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
0;dallas-temp;temp;anydataTemp;Термостат;Температура;1;pin[2];index[0];int[10]
|
||||||
|
0;logging;log;chart;Термостат;История;2;val[temp];int[60];cnt[100]
|
||||||
|
0;inoutput;inputU;inputDigit;Термостат;Верхний#порог;3
|
||||||
|
0;inoutput;inputL;inputDigit;Термостат;Нижний#порог;4
|
||||||
|
0;button-out;button;toggle;Термостат;Нагрев;5;pin[12]
|
||||||
8
doc/old files/presets/1.s.txt
Normal file
8
doc/old files/presets/1.s.txt
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
temp > inputU
|
||||||
|
button 0
|
||||||
|
telegram нагрев#выключен 1
|
||||||
|
end
|
||||||
|
temp < inputL
|
||||||
|
button 1
|
||||||
|
telegram нагрев#включен 1
|
||||||
|
end
|
||||||
12
doc/old files/presets/2.c.txt
Normal file
12
doc/old files/presets/2.c.txt
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
0;dallas-temp;temp;anydataTemp;Термостат;Температура;1;pin[2];index[0];int[60]
|
||||||
|
0;logging;log;chart;Термостат;История;2;val[temp];int[10];cnt[100]
|
||||||
|
0;inoutput;threshold;inputDigitTemp;Термостат;Заданная#температура;3
|
||||||
|
0;button-out;heater;toggle;Термостат;Нагреватель;7;pin[12]
|
||||||
|
0;inoutput;time1;inputTimeClock;Расписание;Утренний#период;8
|
||||||
|
0;inoutput;threshold1;inputDigitTemp;Расписание;Температура;9
|
||||||
|
0;inoutput;time2;inputTimeClock;Расписание;Дневной#период;10
|
||||||
|
0;inoutput;threshold2;inputDigitTemp;Расписание;Температура;11
|
||||||
|
0;inoutput;time3;inputTimeClock;Расписание;Вечерний#период;12
|
||||||
|
0;inoutput;threshold3;inputDigitTemp;Расписание;Температура;13
|
||||||
|
0;inoutput;time4;inputTimeClock;Расписание;Ночной#период;14
|
||||||
|
0;inoutput;threshold4;inputDigitTemp;Расписание;Температура;15
|
||||||
18
doc/old files/presets/2.s.txt
Normal file
18
doc/old files/presets/2.s.txt
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
temp > threshold+-2
|
||||||
|
heater 0
|
||||||
|
end
|
||||||
|
temp < threshold+-2
|
||||||
|
heater 1
|
||||||
|
end
|
||||||
|
timenow = time1
|
||||||
|
threshold threshold1
|
||||||
|
end
|
||||||
|
timenow = time2
|
||||||
|
threshold threshold2
|
||||||
|
end
|
||||||
|
timenow = time3
|
||||||
|
threshold threshold3
|
||||||
|
end
|
||||||
|
timenow = time4
|
||||||
|
threshold threshold4
|
||||||
|
end
|
||||||
5
doc/old files/presets/3.c.txt
Normal file
5
doc/old files/presets/3.c.txt
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
0;dht-hum;hum;anydataHum;Теплица;Влажность;1;pin[2];type[dht11];c[1]
|
||||||
|
0;logging;log;chart;Теплица;История;2;val[hum];int[60];cnt[100]
|
||||||
|
0;inoutput;inputU;inputDigit;Теплица;Верхний#порог;3
|
||||||
|
0;inoutput;inputL;inputDigit;Теплица;Нижний#порог;4
|
||||||
|
0;button-out;button;toggle;Теплица;Полив;5;pin[12]
|
||||||
8
doc/old files/presets/3.s.txt
Normal file
8
doc/old files/presets/3.s.txt
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
hum > inputU
|
||||||
|
button 0
|
||||||
|
telegram полив#выключен 1
|
||||||
|
end
|
||||||
|
hum < inputL
|
||||||
|
button 1
|
||||||
|
telegram полив#включен 1
|
||||||
|
end
|
||||||
4
doc/old files/presets/4.c.txt
Normal file
4
doc/old files/presets/4.c.txt
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
0;button-out;button1;toggle;Реле;Освещение;1;pin[12]
|
||||||
|
0;button-out;button2;toggle;Реле;Освещение;2;pin[13]
|
||||||
|
0;inoutput;T1;inputTime;Реле;Введите#время#включения;3
|
||||||
|
0;inoutput;T2;inputTime;Реле;Введите#время#выключения;4
|
||||||
8
doc/old files/presets/4.s.txt
Normal file
8
doc/old files/presets/4.s.txt
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
timenow = T1
|
||||||
|
button1 1
|
||||||
|
button2 0
|
||||||
|
end
|
||||||
|
timenow = T2
|
||||||
|
button1 0
|
||||||
|
button2 1
|
||||||
|
end
|
||||||
7
doc/old files/presets/5.c.txt
Normal file
7
doc/old files/presets/5.c.txt
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
0;button-out;button-out-1;toggle;Кнопки;Выключить#все;1
|
||||||
|
0;button-out;button-out-2;toggle;Кнопки;Гостинная;2;pin[12]
|
||||||
|
0;button-out;button-out-3;toggle;Кнопки;Спальня;3;pin[13]
|
||||||
|
0;button-out;button-out-4;toggle;Кнопки;Прихожая;4;pin[14]
|
||||||
|
0;pwm-out;pwm-out-5;range;Кнопки;Яркость;5;pin[15]
|
||||||
|
0;pwm-out;pwm-out-6;range;Кнопки;Яркость;6;pin[16]
|
||||||
|
0;inoutput;output-text-7;anydata;Кнопки;Статус;7
|
||||||
16
doc/old files/presets/5.s.txt
Normal file
16
doc/old files/presets/5.s.txt
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
button-out-1 = 1
|
||||||
|
button-out-2 1
|
||||||
|
button-out-3 1
|
||||||
|
button-out-4 1
|
||||||
|
pwm-out-5 200
|
||||||
|
pwm-out-6 800
|
||||||
|
output-text-7 включено
|
||||||
|
end
|
||||||
|
button-out-1 = 0
|
||||||
|
button-out-2 0
|
||||||
|
button-out-3 0
|
||||||
|
button-out-4 0
|
||||||
|
pwm-out-5 800
|
||||||
|
pwm-out-6 200
|
||||||
|
output-text-7 выключено
|
||||||
|
end
|
||||||
3
doc/old files/presets/6.c.txt
Normal file
3
doc/old files/presets/6.c.txt
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
0;button-out;button;toggle;Таймер;Освещение;1;pin[12]
|
||||||
|
0;count-down;count;anydata;Таймер;Обратный#отчет;2
|
||||||
|
0;inoutput;input;inputDigit;Таймер;Введите#цифру;3
|
||||||
6
doc/old files/presets/6.s.txt
Normal file
6
doc/old files/presets/6.s.txt
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
button = 1
|
||||||
|
count input
|
||||||
|
end
|
||||||
|
count = 0
|
||||||
|
button 0
|
||||||
|
end
|
||||||
4
doc/old files/presets/7.c.txt
Normal file
4
doc/old files/presets/7.c.txt
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
0;inoutput;text;anydataAlarm;Сигнализация;Движение:;1
|
||||||
|
0;inoutput;time;anydataTime;Сигнализация;Время:;2
|
||||||
|
0;button-in;sensor;na;na;na;3;pin[0];db[20]
|
||||||
|
0;button-out;reset;toggle;Сигнализация;Сбросить;4
|
||||||
10
doc/old files/presets/7.s.txt
Normal file
10
doc/old files/presets/7.s.txt
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
sensor = 1
|
||||||
|
text обнаружено
|
||||||
|
time %date%
|
||||||
|
telegram text обнаружено#движение 1
|
||||||
|
end
|
||||||
|
reset = 1
|
||||||
|
text не#обнаружено
|
||||||
|
time %date%
|
||||||
|
reset 0
|
||||||
|
end
|
||||||
4
doc/old files/presets/8.c.txt
Normal file
4
doc/old files/presets/8.c.txt
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
0;button-in;sensor;na;na;na;1;pin[0];db[20]
|
||||||
|
0;button-out;light;toggle;Освещение;Освещение;2;pin[13]
|
||||||
|
0;count-down;count;anydata;Освещение;Обратный#отчет;3
|
||||||
|
0;inoutput;period;inputDigit;Освещение;Период#включения;4
|
||||||
7
doc/old files/presets/8.s.txt
Normal file
7
doc/old files/presets/8.s.txt
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
sensor = 1
|
||||||
|
light 1
|
||||||
|
count period
|
||||||
|
end
|
||||||
|
count = 0
|
||||||
|
light 0
|
||||||
|
end
|
||||||
2
doc/old files/presets/9.c.txt
Normal file
2
doc/old files/presets/9.c.txt
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
0;button-out;light;toggle;Кнопки;Освещение;1;pin[13]
|
||||||
|
0;button-in;switch;na;na;na;2;pin[0];db[20]
|
||||||
3
doc/old files/presets/9.s.txt
Normal file
3
doc/old files/presets/9.s.txt
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
switch = 1
|
||||||
|
light change
|
||||||
|
end
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
//===========Firmware=============================================================================================================================================
|
//===========Firmware=============================================================================================================================================
|
||||||
#define FIRMWARE_VERSION 272
|
#define FIRMWARE_VERSION 273
|
||||||
//#define FLASH_SIZE_1MB true
|
#define FLASH_SIZE_1MB true
|
||||||
//==================================================================================================================================================================
|
//==================================================================================================================================================================
|
||||||
#define NUM_BUTTONS 6
|
#define NUM_BUTTONS 6
|
||||||
#define LED_PIN 2
|
#define LED_PIN 2
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
[platformio]
|
[platformio]
|
||||||
default_envs = esp8266
|
default_envs = esp8266_01_1m
|
||||||
;=============================================================================================================================================
|
;=============================================================================================================================================
|
||||||
[common_env_data]
|
[common_env_data]
|
||||||
lib_deps_external =
|
lib_deps_external =
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#include "BufferExecute.h"
|
#include "BufferExecute.h"
|
||||||
#include "Global.h"
|
#include "Global.h"
|
||||||
|
#include "SoftUART.h"
|
||||||
//
|
//
|
||||||
#include "items/vSensorDallas.h"
|
#include "items/vSensorDallas.h"
|
||||||
#include "items/vSensorUltrasonic.h"
|
#include "items/vSensorUltrasonic.h"
|
||||||
@@ -11,9 +12,18 @@
|
|||||||
#include "items/vCountDown.h"
|
#include "items/vCountDown.h"
|
||||||
|
|
||||||
void loopCmdAdd(const String& cmdStr) {
|
void loopCmdAdd(const String& cmdStr) {
|
||||||
orderBuf += cmdStr;
|
if (cmdStr.endsWith(",")) {
|
||||||
if (!cmdStr.endsWith(",")) {
|
orderBuf += cmdStr;
|
||||||
orderBuf += ",";
|
#ifdef uartEnable
|
||||||
|
if (jsonReadBool(configSetupJson, "uart")) {
|
||||||
|
if (jsonReadBool(configSetupJson, "uartEvents")) {
|
||||||
|
if (myUART) {
|
||||||
|
myUART->print(cmdStr);
|
||||||
|
SerialPrint("I", "<=UART", cmdStr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#include "MqttClient.h"
|
#include "MqttClient.h"
|
||||||
|
#include "BufferExecute.h"
|
||||||
#include <LittleFS.h>
|
#include <LittleFS.h>
|
||||||
#include "items/vLogging.h"
|
#include "items/vLogging.h"
|
||||||
#include "Class/NotAsync.h"
|
#include "Class/NotAsync.h"
|
||||||
@@ -132,10 +132,13 @@ void mqttCallback(char* topic, uint8_t* payload, size_t length) {
|
|||||||
|
|
||||||
String key = selectFromMarkerToMarker(topicStr, "/", 3);
|
String key = selectFromMarkerToMarker(topicStr, "/", 3);
|
||||||
|
|
||||||
orderBuf += key;
|
String order;
|
||||||
orderBuf += " ";
|
order += key;
|
||||||
orderBuf += payloadStr;
|
order += " ";
|
||||||
orderBuf += ",";
|
order += payloadStr;
|
||||||
|
order += ",";
|
||||||
|
|
||||||
|
loopCmdAdd(order);
|
||||||
|
|
||||||
SerialPrint("I", "=>MQTT", "Msg from iotmanager app: " + key + " " + payloadStr);
|
SerialPrint("I", "=>MQTT", "Msg from iotmanager app: " + key + " " + payloadStr);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
#ifdef uartEnable
|
#ifdef uartEnable
|
||||||
#include "SoftUART.h"
|
#include "SoftUART.h"
|
||||||
#include "Global.h"
|
#include "Global.h"
|
||||||
|
#include "BufferExecute.h"
|
||||||
|
|
||||||
#ifdef ESP8266
|
#ifdef ESP8266
|
||||||
SoftwareSerial* myUART = nullptr;
|
SoftwareSerial* myUART = nullptr;
|
||||||
@@ -10,7 +11,7 @@ HardwareSerial* myUART = nullptr;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
void uartInit() {
|
void uartInit() {
|
||||||
if (!jsonReadBool(configSetupJson, "uartEnable")) {
|
if (!jsonReadBool(configSetupJson, "uart")) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!myUART) {
|
if (!myUART) {
|
||||||
@@ -27,7 +28,7 @@ void uartInit() {
|
|||||||
|
|
||||||
void uartHandle() {
|
void uartHandle() {
|
||||||
if (myUART) {
|
if (myUART) {
|
||||||
if (!jsonReadBool(configSetupJson, "uartEnable")) {
|
if (!jsonReadBool(configSetupJson, "uart")) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
static String incStr;
|
static String incStr;
|
||||||
@@ -49,7 +50,7 @@ void parse(String& incStr) {
|
|||||||
incStr.replace("\n", "");
|
incStr.replace("\n", "");
|
||||||
if (incStr.indexOf("set") != -1) {
|
if (incStr.indexOf("set") != -1) {
|
||||||
incStr = deleteBeforeDelimiter(incStr, " ");
|
incStr = deleteBeforeDelimiter(incStr, " ");
|
||||||
orderBuf += incStr;
|
loopCmdAdd(incStr);
|
||||||
SerialPrint("I", "=>UART", incStr);
|
SerialPrint("I", "=>UART", incStr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
#include "Consts.h"
|
#include "Consts.h"
|
||||||
#ifdef telegramEnable
|
#ifdef telegramEnable
|
||||||
#include "Telegram.h"
|
#include "Telegram.h"
|
||||||
|
#include "BufferExecute.h"
|
||||||
CTBot* myBot{ nullptr };
|
CTBot* myBot{ nullptr };
|
||||||
|
|
||||||
void telegramInit() {
|
void telegramInit() {
|
||||||
@@ -49,7 +50,7 @@ void telegramMsgParse(String msg) {
|
|||||||
if (msg.indexOf("set") != -1) {
|
if (msg.indexOf("set") != -1) {
|
||||||
msg = deleteBeforeDelimiter(msg, "_");
|
msg = deleteBeforeDelimiter(msg, "_");
|
||||||
msg.replace("_", " ");
|
msg.replace("_", " ");
|
||||||
orderBuf += String(msg) + ",";
|
loopCmdAdd(String(msg) + ",");
|
||||||
myBot->sendMessage(jsonReadInt(configSetupJson, "chatId"), "order done");
|
myBot->sendMessage(jsonReadInt(configSetupJson, "chatId"), "order done");
|
||||||
SerialPrint("<-", "Telegram", "chat ID: " + String(jsonReadInt(configSetupJson, "chatId")) + ", msg: " + String(msg));
|
SerialPrint("<-", "Telegram", "chat ID: " + String(jsonReadInt(configSetupJson, "chatId")) + ", msg: " + String(msg));
|
||||||
}
|
}
|
||||||
|
|||||||
151
src/Web.cpp
151
src/Web.cpp
@@ -19,65 +19,55 @@ bool parseRequestForPreset(AsyncWebServerRequest* request, uint8_t& preset) {
|
|||||||
void web_init() {
|
void web_init() {
|
||||||
server.on("/set", HTTP_GET, [](AsyncWebServerRequest* request) {
|
server.on("/set", HTTP_GET, [](AsyncWebServerRequest* request) {
|
||||||
//==============================set.device.json====================================================================================================
|
//==============================set.device.json====================================================================================================
|
||||||
if (request->hasArg("addItem")) {
|
if (request->hasArg(F("addItem"))) {
|
||||||
addItem2(request->getParam("addItem")->value());
|
addItem2(request->getParam("addItem")->value());
|
||||||
request->redirect("/?set.device");
|
request->redirect("/?set.device");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (request->hasArg("addPreset")) {
|
if (request->hasArg(F("addPreset"))) {
|
||||||
addPreset2(request->getParam("addPreset")->value().toInt());
|
addPreset2(request->getParam(F("addPreset"))->value().toInt());
|
||||||
jsonWriteStr(configSetupJson, "warning1", F("<div style='margin-top:10px;margin-bottom:10px;'><font color='black'><p style='border: 1px solid #DCDCDC; border-radius: 3px; background-color: #ffc7c7; padding: 10px;'>Требуется перезагрузка</p></font></div>"));
|
if (FLASH_SIZE_1MB) {
|
||||||
request->redirect("/?set.device");
|
jsonWriteStr(configSetupJson, F("warning1"), F("<div style='margin-top:10px;margin-bottom:10px;'><font color='black'><p style='border: 1px solid #DCDCDC; border-radius: 3px; background-color: #ffc7c7; padding: 10px;'>Присеты не доступны, модуль на 1mb</p></font></div>"));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
jsonWriteStr(configSetupJson, F("warning1"), F("<div style='margin-top:10px;margin-bottom:10px;'><font color='black'><p style='border: 1px solid #DCDCDC; border-radius: 3px; background-color: #ffc7c7; padding: 10px;'>Требуется перезагрузка</p></font></div>"));
|
||||||
|
}
|
||||||
|
request->redirect(F("/?set.device"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (request->hasArg("delChoosingItems")) {
|
if (request->hasArg(F("delChoosingItems"))) {
|
||||||
jsonWriteStr(configSetupJson, "warning1", F("<div style='margin-top:10px;margin-bottom:10px;'><font color='black'><p style='border: 1px solid #DCDCDC; border-radius: 3px; background-color: #ffc7c7; padding: 10px;'>Требуется перезагрузка</p></font></div>"));
|
jsonWriteStr(configSetupJson, F("warning1"), F("<div style='margin-top:10px;margin-bottom:10px;'><font color='black'><p style='border: 1px solid #DCDCDC; border-radius: 3px; background-color: #ffc7c7; padding: 10px;'>Требуется перезагрузка</p></font></div>"));
|
||||||
myNotAsyncActions->make(do_delChoosingItems);
|
myNotAsyncActions->make(do_delChoosingItems);
|
||||||
request->send(200);
|
request->send(200);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (request->hasArg("delAllItems")) {
|
if (request->hasArg(F("delAllItems"))) {
|
||||||
delAllItems();
|
delAllItems();
|
||||||
cleanLogAndData();
|
cleanLogAndData();
|
||||||
jsonWriteStr(configSetupJson, "warning1", F("<div style='margin-top:10px;margin-bottom:10px;'><font color='black'><p style='border: 1px solid #DCDCDC; border-radius: 3px; background-color: #ffc7c7; padding: 10px;'>Требуется перезагрузка</p></font></div>"));
|
jsonWriteStr(configSetupJson, F("warning1"), F("<div style='margin-top:10px;margin-bottom:10px;'><font color='black'><p style='border: 1px solid #DCDCDC; border-radius: 3px; background-color: #ffc7c7; padding: 10px;'>Требуется перезагрузка</p></font></div>"));
|
||||||
request->redirect("/?set.device");
|
request->redirect(F("/?set.device"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (request->hasArg("saveItems")) {
|
if (request->hasArg(F("saveItems"))) {
|
||||||
myNotAsyncActions->make(do_deviceInit);
|
myNotAsyncActions->make(do_deviceInit);
|
||||||
request->send(200);
|
request->send(200);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (request->hasArg("scen")) {
|
if (request->hasArg(F("scen"))) {
|
||||||
bool value = request->getParam("scen")->value().toInt();
|
bool value = request->getParam(F("scen"))->value().toInt();
|
||||||
jsonWriteBool(configSetupJson, "scen", value);
|
jsonWriteBool(configSetupJson, F("scen"), value);
|
||||||
saveConfig();
|
saveConfig();
|
||||||
loadScenario();
|
loadScenario();
|
||||||
request->send(200);
|
request->send(200);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (request->hasArg("sceninit")) {
|
if (request->hasArg(F("sceninit"))) {
|
||||||
loadScenario();
|
loadScenario();
|
||||||
request->send(200);
|
request->send(200);
|
||||||
}
|
}
|
||||||
|
|
||||||
//if (request->hasArg("snaUdp")) {
|
if (request->hasArg(F("MqttIn"))) {
|
||||||
// bool value = request->getParam("snaUdp")->value().toInt();
|
bool value = request->getParam(F("MqttIn"))->value().toInt();
|
||||||
// jsonWriteBool(configSetupJson, "snaUdp", value);
|
|
||||||
// saveConfig();
|
|
||||||
// #ifdef UDP_ENABLED
|
|
||||||
// asyncUdpInit();
|
|
||||||
// #endif
|
|
||||||
// request->send(200);
|
|
||||||
//}
|
|
||||||
|
|
||||||
//if (request->hasArg("scenUdp")) {
|
|
||||||
// myNotAsyncActions->make(do_sendScenUDP);
|
|
||||||
// request->send(200);
|
|
||||||
//}
|
|
||||||
|
|
||||||
if (request->hasArg("MqttIn")) {
|
|
||||||
bool value = request->getParam("MqttIn")->value().toInt();
|
|
||||||
jsonWriteBool(configSetupJson, "MqttIn", value);
|
jsonWriteBool(configSetupJson, "MqttIn", value);
|
||||||
saveConfig();
|
saveConfig();
|
||||||
mqtt.subscribe((mqttPrefix + "/+/+/event").c_str());
|
mqtt.subscribe((mqttPrefix + "/+/+/event").c_str());
|
||||||
@@ -85,111 +75,103 @@ void web_init() {
|
|||||||
request->send(200);
|
request->send(200);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (request->hasArg("MqttOut")) {
|
if (request->hasArg(F("MqttOut"))) {
|
||||||
bool value = request->getParam("MqttOut")->value().toInt();
|
bool value = request->getParam(F("MqttOut"))->value().toInt();
|
||||||
jsonWriteBool(configSetupJson, "MqttOut", value);
|
jsonWriteBool(configSetupJson, F("MqttOut"), value);
|
||||||
saveConfig();
|
saveConfig();
|
||||||
request->send(200);
|
request->send(200);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (request->hasArg("scenMqtt")) {
|
if (request->hasArg(F("scenMqtt"))) {
|
||||||
myNotAsyncActions->make(do_sendScenMQTT);
|
myNotAsyncActions->make(do_sendScenMQTT);
|
||||||
request->send(200);
|
request->send(200);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (request->hasArg("cleanlog")) {
|
if (request->hasArg(F("cleanlog"))) {
|
||||||
cleanLogAndData();
|
cleanLogAndData();
|
||||||
request->send(200);
|
request->send(200);
|
||||||
}
|
}
|
||||||
|
|
||||||
//==============================wifi settings=============================================
|
//==============================wifi settings=============================================
|
||||||
if (request->hasArg("devname")) {
|
if (request->hasArg(F("devname"))) {
|
||||||
jsonWriteStr(configSetupJson, "name", request->getParam("devname")->value());
|
jsonWriteStr(configSetupJson, F("name"), request->getParam(F("devname"))->value());
|
||||||
saveConfig();
|
saveConfig();
|
||||||
request->send(200);
|
request->send(200);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (request->hasArg("routerssid")) {
|
if (request->hasArg(F("routerssid"))) {
|
||||||
jsonWriteStr(configSetupJson, "routerssid", request->getParam("routerssid")->value());
|
jsonWriteStr(configSetupJson, F("routerssid"), request->getParam(F("routerssid"))->value());
|
||||||
saveConfig();
|
saveConfig();
|
||||||
request->send(200);
|
request->send(200);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (request->hasArg("routerpass")) {
|
if (request->hasArg(F("routerpass"))) {
|
||||||
jsonWriteStr(configSetupJson, "routerpass", request->getParam("routerpass")->value());
|
jsonWriteStr(configSetupJson, F("routerpass"), request->getParam(F("routerpass"))->value());
|
||||||
saveConfig();
|
saveConfig();
|
||||||
request->send(200);
|
request->send(200);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (request->hasArg("apssid")) {
|
if (request->hasArg(F("apssid"))) {
|
||||||
jsonWriteStr(configSetupJson, "apssid", request->getParam("apssid")->value());
|
jsonWriteStr(configSetupJson, F("apssid"), request->getParam(F("apssid"))->value());
|
||||||
saveConfig();
|
saveConfig();
|
||||||
request->send(200, "text/text", "OK");
|
request->send(200, "text/text", "OK");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (request->hasArg("appass")) {
|
if (request->hasArg(F("appass"))) {
|
||||||
jsonWriteStr(configSetupJson, "appass", request->getParam("appass")->value());
|
jsonWriteStr(configSetupJson, F("appass"), request->getParam(F("appass"))->value());
|
||||||
saveConfig();
|
saveConfig();
|
||||||
request->send(200);
|
request->send(200);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (request->hasArg("weblogin")) {
|
if (request->hasArg(F("weblogin"))) {
|
||||||
jsonWriteStr(configSetupJson, "weblogin", request->getParam("weblogin")->value());
|
jsonWriteStr(configSetupJson, F("weblogin"), request->getParam(F("weblogin"))->value());
|
||||||
saveConfig();
|
saveConfig();
|
||||||
request->send(200);
|
request->send(200);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (request->hasArg("webpass")) {
|
if (request->hasArg(F("webpass"))) {
|
||||||
jsonWriteStr(configSetupJson, "webpass", request->getParam("webpass")->value());
|
jsonWriteStr(configSetupJson, F("webpass"), request->getParam(F("webpass"))->value());
|
||||||
saveConfig();
|
saveConfig();
|
||||||
request->send(200);
|
request->send(200);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (request->hasArg("timezone")) {
|
if (request->hasArg(F("timezone"))) {
|
||||||
String timezoneStr = request->getParam("timezone")->value();
|
String timezoneStr = request->getParam(F("timezone"))->value();
|
||||||
jsonWriteStr(configSetupJson, "timezone", timezoneStr);
|
jsonWriteStr(configSetupJson, F("timezone"), timezoneStr);
|
||||||
saveConfig();
|
saveConfig();
|
||||||
timeNow->setTimezone(timezoneStr.toInt());
|
timeNow->setTimezone(timezoneStr.toInt());
|
||||||
request->send(200);
|
request->send(200);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (request->hasArg("ntp")) {
|
if (request->hasArg(F("ntp"))) {
|
||||||
String ntpStr = request->getParam("ntp")->value();
|
String ntpStr = request->getParam(F("ntp"))->value();
|
||||||
jsonWriteStr(configSetupJson, "ntp", ntpStr);
|
jsonWriteStr(configSetupJson, F("ntp"), ntpStr);
|
||||||
saveConfig();
|
saveConfig();
|
||||||
timeNow->setNtpPool(ntpStr);
|
timeNow->setNtpPool(ntpStr);
|
||||||
request->send(200);
|
request->send(200);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (request->hasArg("blink")) {
|
if (request->hasArg(F("blink"))) {
|
||||||
bool value = request->getParam("blink")->value().toInt();
|
bool value = request->getParam(F("blink"))->value().toInt();
|
||||||
jsonWriteBool(configSetupJson, "blink", value);
|
jsonWriteBool(configSetupJson, F("blink"), value);
|
||||||
saveConfig();
|
saveConfig();
|
||||||
request->send(200);
|
request->send(200);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (request->hasArg("reqReset")) {
|
if (request->hasArg(F("reqReset"))) {
|
||||||
String tmp = "{}";
|
String tmp = "{}";
|
||||||
jsonWriteStr(tmp, "title", F("<button class=\"close\" onclick=\"toggle('reset-block')\">×</button>Вы действительно хотите перезагрузить устройство?<a href=\"#\" class=\"btn btn-block btn-danger\" onclick=\"send_request(this, '/set?reset');setTimeout(function(){ location.href='/?set.device'; }, 15000);html('reset-block','<span class=loader></span>Идет перезагрузка устройства')\">Перезагрузить</a>"));
|
jsonWriteStr(tmp, "title", F("<button class=\"close\" onclick=\"toggle('reset-block')\">×</button>Вы действительно хотите перезагрузить устройство?<a href=\"#\" class=\"btn btn-block btn-danger\" onclick=\"send_request(this, '/set?reset');setTimeout(function(){ location.href='/?set.device'; }, 15000);html('reset-block','<span class=loader></span>Идет перезагрузка устройства')\">Перезагрузить</a>"));
|
||||||
jsonWriteStr(tmp, "class", "pop-up");
|
jsonWriteStr(tmp, "class", "pop-up");
|
||||||
request->send(200, "text/html", tmp);
|
request->send(200, "text/html", tmp);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (request->hasArg("reset")) {
|
if (request->hasArg(F("reset"))) {
|
||||||
ESP.restart();
|
ESP.restart();
|
||||||
request->send(200);
|
request->send(200);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (request->hasArg("test")) {
|
|
||||||
if (request->getParam("test")->value() == "ok") {
|
|
||||||
Serial.println("test pass");
|
|
||||||
}
|
|
||||||
request->send(200);
|
|
||||||
}
|
|
||||||
|
|
||||||
//==============================mqtt settings=============================================
|
//==============================mqtt settings=============================================
|
||||||
|
|
||||||
if (request->hasArg("mqttServer")) {
|
if (request->hasArg("mqttServer")) {
|
||||||
jsonWriteStr(configSetupJson, "mqttServer", request->getParam("mqttServer")->value());
|
jsonWriteStr(configSetupJson, "mqttServer", request->getParam("mqttServer")->value());
|
||||||
saveConfig();
|
saveConfig();
|
||||||
@@ -237,7 +219,7 @@ void web_init() {
|
|||||||
request->send(200, "text/html", payload);
|
request->send(200, "text/html", payload);
|
||||||
}
|
}
|
||||||
|
|
||||||
//==============================push settings=============================================
|
//==============================telegram settings=============================================
|
||||||
if (request->hasArg("telegramApi")) {
|
if (request->hasArg("telegramApi")) {
|
||||||
jsonWriteStr(configSetupJson, "telegramApi", request->getParam("telegramApi")->value());
|
jsonWriteStr(configSetupJson, "telegramApi", request->getParam("telegramApi")->value());
|
||||||
saveConfig();
|
saveConfig();
|
||||||
@@ -266,15 +248,21 @@ void web_init() {
|
|||||||
myNotAsyncActions->make(do_BUSSCAN);
|
myNotAsyncActions->make(do_BUSSCAN);
|
||||||
request->redirect("/?set.utilities");
|
request->redirect("/?set.utilities");
|
||||||
}
|
}
|
||||||
if (request->hasArg("uartEnable")) {
|
if (request->hasArg("uart")) {
|
||||||
bool value = request->getParam("uartEnable")->value().toInt();
|
bool value = request->getParam("uart")->value().toInt();
|
||||||
jsonWriteBool(configSetupJson, "uartEnable", value);
|
jsonWriteBool(configSetupJson, "uart", value);
|
||||||
saveConfig();
|
saveConfig();
|
||||||
#ifdef uartEnable
|
#ifdef uartEnable
|
||||||
uartInit();
|
uartInit();
|
||||||
#endif
|
#endif
|
||||||
request->send(200);
|
request->send(200);
|
||||||
}
|
}
|
||||||
|
if (request->hasArg("uartEvents")) {
|
||||||
|
bool value = request->getParam("uartEvents")->value().toInt();
|
||||||
|
jsonWriteBool(configSetupJson, "uartEvents", value);
|
||||||
|
saveConfig();
|
||||||
|
request->send(200);
|
||||||
|
}
|
||||||
if (request->hasArg("uartS")) {
|
if (request->hasArg("uartS")) {
|
||||||
jsonWriteStr(configSetupJson, "uartS", request->getParam("uartS")->value());
|
jsonWriteStr(configSetupJson, "uartS", request->getParam("uartS")->value());
|
||||||
saveConfig();
|
saveConfig();
|
||||||
@@ -309,22 +297,7 @@ void web_init() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
//==============================list of items=====================================================
|
|
||||||
//server.on("/del", HTTP_GET, [](AsyncWebServerRequest* request) {
|
|
||||||
// if (request->hasArg("file")) {
|
|
||||||
// itemsFile = request->getParam("file")->value();
|
|
||||||
// }
|
|
||||||
// if (request->hasArg("line")) {
|
|
||||||
// itemsLine = request->getParam("line")->value();
|
|
||||||
// }
|
|
||||||
// delElementFlag = true;
|
|
||||||
// deviceInit();
|
|
||||||
// request->redirect("/?setn.device");
|
|
||||||
//});
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Check
|
|
||||||
*/
|
|
||||||
server.on("/check", HTTP_GET, [](AsyncWebServerRequest* request) {
|
server.on("/check", HTTP_GET, [](AsyncWebServerRequest* request) {
|
||||||
myNotAsyncActions->make(do_GETLASTVERSION);
|
myNotAsyncActions->make(do_GETLASTVERSION);
|
||||||
SerialPrint("I", "Update", "firmware version: " + String(lastVersion));
|
SerialPrint("I", "Update", "firmware version: " + String(lastVersion));
|
||||||
|
|||||||
@@ -20,17 +20,6 @@ ButtonOut::ButtonOut(String pin, boolean inv, String key, String type) {
|
|||||||
ButtonOut::~ButtonOut() {}
|
ButtonOut::~ButtonOut() {}
|
||||||
|
|
||||||
void ButtonOut::execute(String state) {
|
void ButtonOut::execute(String state) {
|
||||||
if (_type == "UART") {
|
|
||||||
if (jsonReadBool(configSetupJson, "uartEnable")) {
|
|
||||||
#ifdef uartEnable
|
|
||||||
if (myUART) {
|
|
||||||
String msg = _key + " " + state;
|
|
||||||
myUART->print(msg);
|
|
||||||
SerialPrint("I", "<=UART", msg);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (state != "" && _pin != "") {
|
if (state != "" && _pin != "") {
|
||||||
if (state == "change") {
|
if (state == "change") {
|
||||||
state = String(!digitalRead(_pin.toInt()));
|
state = String(!digitalRead(_pin.toInt()));
|
||||||
|
|||||||
Reference in New Issue
Block a user