mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-23 18:56:38 +00:00
Add Battery status to Zigbee GUI
Add Battery status to Zigbee GUI
This commit is contained in:
parent
3d95c6e193
commit
a63604bd10
@ -56,6 +56,7 @@
|
||||
#define D_AP "Точка за достъп" // Access Point
|
||||
#define D_AS "като"
|
||||
#define D_AUTO "АВТОМАТИЧНО"
|
||||
#define D_BATT "Batt" // Short for Battery
|
||||
#define D_BLINK "Мигане вкл."
|
||||
#define D_BLINKOFF "Мигане изкл."
|
||||
#define D_BOOT_COUNT "Брой на стартиранията"
|
||||
@ -116,6 +117,7 @@
|
||||
#define D_IP_ADDRESS "IP адрес"
|
||||
#define D_LIGHT "Светлина"
|
||||
#define D_LWT "LWT"
|
||||
#define D_LQI "LQI" // Zigbee Link Quality Index
|
||||
#define D_MODULE "Модул"
|
||||
#define D_MOISTURE "Влага"
|
||||
#define D_MQTT "MQTT"
|
||||
|
@ -56,6 +56,7 @@
|
||||
#define D_AP "AP" // Access Point
|
||||
#define D_AS "jako"
|
||||
#define D_AUTO "AUTO"
|
||||
#define D_BATT "Batt" // Short for Battery
|
||||
#define D_BLINK "Blikání"
|
||||
#define D_BLINKOFF "BlikáníVyp"
|
||||
#define D_BOOT_COUNT "Počítadlo spuštění"
|
||||
@ -116,6 +117,7 @@
|
||||
#define D_IP_ADDRESS "Adresa IP"
|
||||
#define D_LIGHT "Světlo"
|
||||
#define D_LWT "LWT"
|
||||
#define D_LQI "LQI" // Zigbee Link Quality Index
|
||||
#define D_MODULE "Modul"
|
||||
#define D_MOISTURE "Moisture"
|
||||
#define D_MQTT "MQTT"
|
||||
|
@ -56,6 +56,7 @@
|
||||
#define D_AP "AP" // Access Point
|
||||
#define D_AS "als"
|
||||
#define D_AUTO "AUTO"
|
||||
#define D_BATT "Batt" // Short for Battery
|
||||
#define D_BLINK "Blinken"
|
||||
#define D_BLINKOFF "BlinkenAus"
|
||||
#define D_BOOT_COUNT "Anzahl Startvorgänge"
|
||||
@ -116,6 +117,7 @@
|
||||
#define D_IP_ADDRESS "IP-Adresse"
|
||||
#define D_LIGHT "Licht"
|
||||
#define D_LWT "LWT"
|
||||
#define D_LQI "LQI" // Zigbee Link Quality Index
|
||||
#define D_MODULE "Modul"
|
||||
#define D_MOISTURE "Moisture"
|
||||
#define D_MQTT "MQTT"
|
||||
|
@ -56,6 +56,7 @@
|
||||
#define D_AP "AP" // Access Point
|
||||
#define D_AS "ως"
|
||||
#define D_AUTO "ΑΥΤΟΜΑΤΟ"
|
||||
#define D_BATT "Batt" // Short for Battery
|
||||
#define D_BLINK "Blink"
|
||||
#define D_BLINKOFF "BlinkOff"
|
||||
#define D_BOOT_COUNT "Καταμέτρηση εκκινήσεων"
|
||||
@ -116,6 +117,7 @@
|
||||
#define D_IP_ADDRESS "Διεύθυνση IP"
|
||||
#define D_LIGHT "Φως"
|
||||
#define D_LWT "LWT"
|
||||
#define D_LQI "LQI" // Zigbee Link Quality Index
|
||||
#define D_MODULE "Μονάδα"
|
||||
#define D_MOISTURE "Moisture"
|
||||
#define D_MQTT "MQTT"
|
||||
|
@ -56,6 +56,7 @@
|
||||
#define D_AP "AP" // Access Point
|
||||
#define D_AS "as"
|
||||
#define D_AUTO "AUTO"
|
||||
#define D_BATT "Batt" // Short for Battery
|
||||
#define D_BLINK "Blink"
|
||||
#define D_BLINKOFF "BlinkOff"
|
||||
#define D_BOOT_COUNT "Boot Count"
|
||||
@ -116,6 +117,7 @@
|
||||
#define D_IP_ADDRESS "IP Address"
|
||||
#define D_LIGHT "Light"
|
||||
#define D_LWT "LWT"
|
||||
#define D_LQI "LQI" // Zigbee Link Quality Index
|
||||
#define D_MODULE "Module"
|
||||
#define D_MOISTURE "Moisture"
|
||||
#define D_MQTT "MQTT"
|
||||
|
@ -56,6 +56,7 @@
|
||||
#define D_AP "AP" // Access Point
|
||||
#define D_AS "como"
|
||||
#define D_AUTO "AUTO"
|
||||
#define D_BATT "Batt" // Short for Battery
|
||||
#define D_BLINK "Blink"
|
||||
#define D_BLINKOFF "BlinkOff"
|
||||
#define D_BOOT_COUNT "Conteo Reinicios"
|
||||
@ -116,6 +117,7 @@
|
||||
#define D_IP_ADDRESS "Dirección IP"
|
||||
#define D_LIGHT "Luz"
|
||||
#define D_LWT "LWT"
|
||||
#define D_LQI "LQI" // Zigbee Link Quality Index
|
||||
#define D_MODULE "Módulo"
|
||||
#define D_MOISTURE "Humedad del Suelo"
|
||||
#define D_MQTT "MQTT"
|
||||
|
@ -56,6 +56,7 @@
|
||||
#define D_AP "AP" // Access Point
|
||||
#define D_AS "comme"
|
||||
#define D_AUTO "AUTO"
|
||||
#define D_BATT "Batt" // Short for Battery
|
||||
#define D_BLINK "Blink"
|
||||
#define D_BLINKOFF "BlinkOff"
|
||||
#define D_BOOT_COUNT "Nombre de boot"
|
||||
@ -116,6 +117,7 @@
|
||||
#define D_IP_ADDRESS "Adresse IP"
|
||||
#define D_LIGHT "Lumière"
|
||||
#define D_LWT "LWT"
|
||||
#define D_LQI "LQI" // Zigbee Link Quality Index
|
||||
#define D_MODULE "Module"
|
||||
#define D_MOISTURE "Humidité"
|
||||
#define D_MQTT "MQTT"
|
||||
|
@ -56,6 +56,7 @@
|
||||
#define D_AP "AP" // Access Point
|
||||
#define D_AS "-כ"
|
||||
#define D_AUTO "אוטומטי"
|
||||
#define D_BATT "Batt" // Short for Battery
|
||||
#define D_BLINK "מהבהב"
|
||||
#define D_BLINKOFF "כיבוי היבהוב"
|
||||
#define D_BOOT_COUNT "מונה הפעלה מחדש"
|
||||
@ -116,6 +117,7 @@
|
||||
#define D_IP_ADDRESS "IP כתובת"
|
||||
#define D_LIGHT "אור"
|
||||
#define D_LWT "LWT"
|
||||
#define D_LQI "LQI" // Zigbee Link Quality Index
|
||||
#define D_MODULE "מודול"
|
||||
#define D_MOISTURE "Moisture"
|
||||
#define D_MQTT "MQTT"
|
||||
|
@ -56,6 +56,7 @@
|
||||
#define D_AP "AP" // Access Point
|
||||
#define D_AS "mint"
|
||||
#define D_AUTO "AUTO"
|
||||
#define D_BATT "Batt" // Short for Battery
|
||||
#define D_BLINK "Villogás"
|
||||
#define D_BLINKOFF "Villogás ki"
|
||||
#define D_BOOT_COUNT "Újraindulások száma"
|
||||
@ -116,6 +117,7 @@
|
||||
#define D_IP_ADDRESS "IP cím"
|
||||
#define D_LIGHT "Fény"
|
||||
#define D_LWT "LWT"
|
||||
#define D_LQI "LQI" // Zigbee Link Quality Index
|
||||
#define D_MODULE "Modul"
|
||||
#define D_MOISTURE "Moisture"
|
||||
#define D_MQTT "MQTT"
|
||||
|
@ -56,6 +56,7 @@
|
||||
#define D_AP "AP" // Access Point
|
||||
#define D_AS "come"
|
||||
#define D_AUTO "AUTO"
|
||||
#define D_BATT "Batt" // Short for Battery
|
||||
#define D_BLINK "Lampeggia"
|
||||
#define D_BLINKOFF "Lampeggia OFF"
|
||||
#define D_BOOT_COUNT "Numero di boot"
|
||||
@ -116,6 +117,7 @@
|
||||
#define D_IP_ADDRESS "Indirizzo IP"
|
||||
#define D_LIGHT "Luce"
|
||||
#define D_LWT "LWT"
|
||||
#define D_LQI "LQI" // Zigbee Link Quality Index
|
||||
#define D_MODULE "Modulo"
|
||||
#define D_MOISTURE "Umidità"
|
||||
#define D_MQTT "MQTT"
|
||||
|
@ -56,6 +56,7 @@
|
||||
#define D_AP "AP" // Access Point
|
||||
#define D_AS "as"
|
||||
#define D_AUTO "자동"
|
||||
#define D_BATT "Batt" // Short for Battery
|
||||
#define D_BLINK "깜박임"
|
||||
#define D_BLINKOFF "깜박임 끄기"
|
||||
#define D_BOOT_COUNT "부팅 횟수"
|
||||
@ -116,6 +117,7 @@
|
||||
#define D_IP_ADDRESS "IP 주소"
|
||||
#define D_LIGHT "밝게"
|
||||
#define D_LWT "LWT"
|
||||
#define D_LQI "LQI" // Zigbee Link Quality Index
|
||||
#define D_MODULE "모듈"
|
||||
#define D_MOISTURE "Moisture"
|
||||
#define D_MQTT "MQTT"
|
||||
|
@ -56,6 +56,7 @@
|
||||
#define D_AP "AP" // Access Point
|
||||
#define D_AS "als"
|
||||
#define D_AUTO "AUTO"
|
||||
#define D_BATT "Batt" // Short for Battery
|
||||
#define D_BLINK "Knipper"
|
||||
#define D_BLINKOFF "KnipperUit"
|
||||
#define D_BOOT_COUNT "Herstarts"
|
||||
@ -116,6 +117,7 @@
|
||||
#define D_IP_ADDRESS "IP Adres"
|
||||
#define D_LIGHT "Licht"
|
||||
#define D_LWT "LWT"
|
||||
#define D_LQI "LQI" // Zigbee Link Quality Index
|
||||
#define D_MODULE "Module"
|
||||
#define D_MOISTURE "Moisture"
|
||||
#define D_MQTT "MQTT"
|
||||
|
@ -56,6 +56,7 @@
|
||||
#define D_AP "AP" // Access Point
|
||||
#define D_AS "jak"
|
||||
#define D_AUTO "AUTO"
|
||||
#define D_BATT "Batt" // Short for Battery
|
||||
#define D_BLINK "Miganie"
|
||||
#define D_BLINKOFF "Miganie - Wył."
|
||||
#define D_BOOT_COUNT "Licznik restartów"
|
||||
@ -116,6 +117,7 @@
|
||||
#define D_IP_ADDRESS "Adres IP"
|
||||
#define D_LIGHT "Światło"
|
||||
#define D_LWT "LWT"
|
||||
#define D_LQI "LQI" // Zigbee Link Quality Index
|
||||
#define D_MODULE "Moduł"
|
||||
#define D_MOISTURE "Wilgotność"
|
||||
#define D_MQTT "MQTT"
|
||||
|
@ -56,6 +56,7 @@
|
||||
#define D_AP "Ponto de acesso" // Ponto de Acesso
|
||||
#define D_AS "como"
|
||||
#define D_AUTO "Auto"
|
||||
#define D_BATT "Batt" // Short for Battery
|
||||
#define D_BLINK "Pulsar"
|
||||
#define D_BLINKOFF "Pulsar desligado"
|
||||
#define D_BOOT_COUNT "Contagem de inicialização"
|
||||
@ -116,6 +117,7 @@
|
||||
#define D_IP_ADDRESS "Endereço IP"
|
||||
#define D_LIGHT "Luz"
|
||||
#define D_LWT "LWT"
|
||||
#define D_LQI "LQI" // Zigbee Link Quality Index
|
||||
#define D_MODULE "Módulo"
|
||||
#define D_MOISTURE "Umidade"
|
||||
#define D_MQTT "MQTT"
|
||||
|
@ -56,6 +56,7 @@
|
||||
#define D_AP "AP" // Ponto de Acesso
|
||||
#define D_AS "como"
|
||||
#define D_AUTO "AUTO"
|
||||
#define D_BATT "Batt" // Short for Battery
|
||||
#define D_BLINK "Piscar"
|
||||
#define D_BLINKOFF "Piscar Desligado"
|
||||
#define D_BOOT_COUNT "Contagem de Inicialização"
|
||||
@ -116,6 +117,7 @@
|
||||
#define D_IP_ADDRESS "Endereço IP"
|
||||
#define D_LIGHT "Luz"
|
||||
#define D_LWT "LWT"
|
||||
#define D_LQI "LQI" // Zigbee Link Quality Index
|
||||
#define D_MODULE "Módulo"
|
||||
#define D_MOISTURE "Moisture"
|
||||
#define D_MQTT "MQTT"
|
||||
|
@ -56,6 +56,7 @@
|
||||
#define D_AP "AP" // Access Point
|
||||
#define D_AS "as"
|
||||
#define D_AUTO "AUTO"
|
||||
#define D_BATT "Batt" // Short for Battery
|
||||
#define D_BLINK "Blink"
|
||||
#define D_BLINKOFF "BlinkOff"
|
||||
#define D_BOOT_COUNT "Boot Count"
|
||||
@ -116,6 +117,7 @@
|
||||
#define D_IP_ADDRESS "Adresă IP"
|
||||
#define D_LIGHT "Lumină"
|
||||
#define D_LWT "LWT"
|
||||
#define D_LQI "LQI" // Zigbee Link Quality Index
|
||||
#define D_MODULE "Modul"
|
||||
#define D_MOISTURE "Umezeală"
|
||||
#define D_MQTT "MQTT"
|
||||
|
@ -56,6 +56,7 @@
|
||||
#define D_AP "AP" // Access Point
|
||||
#define D_AS "как"
|
||||
#define D_AUTO "АВТО"
|
||||
#define D_BATT "Batt" // Short for Battery
|
||||
#define D_BLINK "Мигать"
|
||||
#define D_BLINKOFF "Не Мигать"
|
||||
#define D_BOOT_COUNT "Количество загрузок"
|
||||
@ -116,6 +117,7 @@
|
||||
#define D_IP_ADDRESS "IP Адрес"
|
||||
#define D_LIGHT "Свет"
|
||||
#define D_LWT "LWT"
|
||||
#define D_LQI "LQI" // Zigbee Link Quality Index
|
||||
#define D_MODULE "Модуль"
|
||||
#define D_MOISTURE "Moisture"
|
||||
#define D_MQTT "MQTT"
|
||||
|
@ -56,6 +56,7 @@
|
||||
#define D_AP "AP" // Access Point
|
||||
#define D_AS "ako"
|
||||
#define D_AUTO "AUTO"
|
||||
#define D_BATT "Batt" // Short for Battery
|
||||
#define D_BLINK "Blikanie"
|
||||
#define D_BLINKOFF "BlikanieVyp"
|
||||
#define D_BOOT_COUNT "Počítadlo spustení"
|
||||
@ -116,6 +117,7 @@
|
||||
#define D_IP_ADDRESS "Adresa IP"
|
||||
#define D_LIGHT "Svetlo"
|
||||
#define D_LWT "LWT"
|
||||
#define D_LQI "LQI" // Zigbee Link Quality Index
|
||||
#define D_MODULE "Modul"
|
||||
#define D_MOISTURE "Moisture"
|
||||
#define D_MQTT "MQTT"
|
||||
|
@ -56,6 +56,7 @@
|
||||
#define D_AP "AP" // Access Point
|
||||
#define D_AS "som"
|
||||
#define D_AUTO "AUTO"
|
||||
#define D_BATT "Batt" // Short for Battery
|
||||
#define D_BLINK "Blinka"
|
||||
#define D_BLINKOFF "BlinkaAv"
|
||||
#define D_BOOT_COUNT "Uppstartsräknare"
|
||||
@ -116,6 +117,7 @@
|
||||
#define D_IP_ADDRESS "IP-adress"
|
||||
#define D_LIGHT "Ljus"
|
||||
#define D_LWT "LWT"
|
||||
#define D_LQI "LQI" // Zigbee Link Quality Index
|
||||
#define D_MODULE "Modul"
|
||||
#define D_MOISTURE "Moisture"
|
||||
#define D_MQTT "MQTT"
|
||||
|
@ -56,6 +56,7 @@
|
||||
#define D_AP "AP" // Access Point
|
||||
#define D_AS "as"
|
||||
#define D_AUTO "OTOMATIK"
|
||||
#define D_BATT "Batt" // Short for Battery
|
||||
#define D_BLINK "Blink"
|
||||
#define D_BLINKOFF "BlinkOff"
|
||||
#define D_BOOT_COUNT "Yeniden başlama sayısı"
|
||||
@ -116,6 +117,7 @@
|
||||
#define D_IP_ADDRESS "IP Adresi"
|
||||
#define D_LIGHT "Işık"
|
||||
#define D_LWT "LWT"
|
||||
#define D_LQI "LQI" // Zigbee Link Quality Index
|
||||
#define D_MODULE "Modül"
|
||||
#define D_MOISTURE "Moisture"
|
||||
#define D_MQTT "MQTT"
|
||||
|
@ -56,6 +56,7 @@
|
||||
#define D_AP "Точка доступу" // Access Point
|
||||
#define D_AS "як"
|
||||
#define D_AUTO "АВТО"
|
||||
#define D_BATT "Batt" // Short for Battery
|
||||
#define D_BLINK "Блимати"
|
||||
#define D_BLINKOFF "Не блимати"
|
||||
#define D_BOOT_COUNT "К-сть завант."
|
||||
@ -116,6 +117,7 @@
|
||||
#define D_IP_ADDRESS "IP адреса"
|
||||
#define D_LIGHT "Світло"
|
||||
#define D_LWT "LWT"
|
||||
#define D_LQI "LQI" // Zigbee Link Quality Index
|
||||
#define D_MODULE "Модуль"
|
||||
#define D_MOISTURE "Волога"
|
||||
#define D_MQTT "MQTT"
|
||||
|
@ -56,6 +56,7 @@
|
||||
#define D_AP "AP" // Access Point
|
||||
#define D_AS "名称:"
|
||||
#define D_AUTO "自动"
|
||||
#define D_BATT "Batt" // Short for Battery
|
||||
#define D_BLINK "闪烁"
|
||||
#define D_BLINKOFF "闪烁关"
|
||||
#define D_BOOT_COUNT "启动次数"
|
||||
@ -116,6 +117,7 @@
|
||||
#define D_IP_ADDRESS "IP地址"
|
||||
#define D_LIGHT "灯"
|
||||
#define D_LWT "LWT"
|
||||
#define D_LQI "LQI" // Zigbee Link Quality Index
|
||||
#define D_MODULE "模块"
|
||||
#define D_MOISTURE "Moisture"
|
||||
#define D_MQTT "MQTT"
|
||||
|
@ -56,6 +56,7 @@
|
||||
#define D_AP "AP" // Access Point
|
||||
#define D_AS "名稱:"
|
||||
#define D_AUTO "自動"
|
||||
#define D_BATT "Batt" // Short for Battery
|
||||
#define D_BLINK "閃爍"
|
||||
#define D_BLINKOFF "閃爍關"
|
||||
#define D_BOOT_COUNT "啟動次數"
|
||||
@ -116,6 +117,7 @@
|
||||
#define D_IP_ADDRESS "IP地址"
|
||||
#define D_LIGHT "燈"
|
||||
#define D_LWT "LWT"
|
||||
#define D_LQI "LQI" // Zigbee Link Quality Index
|
||||
#define D_MODULE "模組"
|
||||
#define D_MOISTURE "Moisture"
|
||||
#define D_MQTT "MQTT"
|
||||
|
@ -1078,30 +1078,47 @@ void ZigbeeShow(bool json)
|
||||
return;
|
||||
#ifdef USE_WEBSERVER
|
||||
} else {
|
||||
char spart1[33];
|
||||
char spart2[8];
|
||||
|
||||
uint32_t zigbee_num = zigbee_devices.devicesSize();
|
||||
if (!zigbee_num) { return; }
|
||||
|
||||
// Calculate fixed column width for best visual result (Theos opinion)
|
||||
uint8_t px_batt = (strlen(D_BATT) + 5 + 1) * 10; // Batt 100% = 100px
|
||||
uint8_t px_lqi = (strlen(D_LQI) + 4) * 10; // LQI 254 = 70px
|
||||
|
||||
WSContentSend_P(PSTR("</table>{t}")); // Terminate current two column table and open new table
|
||||
// WSContentSend_PD(PSTR("{s}Device 0x1234</th><td style='width:30%%'>" D_BATT " 100%%</td><td style='width:20%%'>" D_LQI " 254{e}"));
|
||||
// WSContentSend_PD(PSTR("{s}Device 0x1234</th><td style='width:100px'>" D_BATT " 100%%</td><td style='width:70px'>" D_LQI " 254{e}"));
|
||||
// WSContentSend_PD(PSTR("{s}Device 0x1234</th><td style='width:%dpx'>" D_BATT " 100%%</td><td style='width:%dpx'>" D_LQI " 254{e}"), px_batt, px_lqi);
|
||||
|
||||
char sdevice[33];
|
||||
char sbatt[20];
|
||||
char slqi[20];
|
||||
|
||||
for (uint32_t i = 0; i < zigbee_num; i++) {
|
||||
uint16_t shortaddr = zigbee_devices.devicesAt(i).shortaddr;
|
||||
char *name = (char*)zigbee_devices.getFriendlyName(shortaddr);
|
||||
if (nullptr == name) {
|
||||
snprintf_P(spart1, sizeof(spart1), PSTR(D_DEVICE " 0x%04X"), shortaddr);
|
||||
name = spart1;
|
||||
snprintf_P(sdevice, sizeof(sdevice), PSTR(D_DEVICE " 0x%04X"), shortaddr);
|
||||
name = sdevice;
|
||||
}
|
||||
snprintf_P(spart2, sizeof(spart2), PSTR("-"));
|
||||
|
||||
snprintf_P(slqi, sizeof(slqi), PSTR("-"));
|
||||
uint8_t lqi = zigbee_devices.getLQI(shortaddr);
|
||||
if (0xFF != lqi) {
|
||||
snprintf_P(spart2, sizeof(spart2), PSTR("%d"), lqi);
|
||||
snprintf_P(slqi, sizeof(slqi), PSTR("%d"), lqi);
|
||||
}
|
||||
// uint8_t bp = zigbee_devices.getBatteryPercentx2(shortaddr);
|
||||
// Be aware that bp
|
||||
// if (0xFF != bp) {
|
||||
// snprintf_P(spart2, sizeof(spart2), PSTR("%d"), bp);
|
||||
// }
|
||||
|
||||
WSContentSend_PD(PSTR("{s}%s{m}LQI %s{e}"), name, spart2);
|
||||
snprintf_P(sbatt, sizeof(sbatt), PSTR(" "));
|
||||
uint8_t bp = zigbee_devices.getBatteryPercent(shortaddr);
|
||||
if (0xFF != bp) {
|
||||
snprintf_P(sbatt, sizeof(sbatt), PSTR(D_BATT " %d%%"), bp);
|
||||
}
|
||||
|
||||
WSContentSend_PD(PSTR("{s}%s</th><td style='width:%dpx'>%s</td><td style='width:%dpx'>" D_LQI " %s{e}"),
|
||||
name, px_batt, sbatt, px_lqi, slqi);
|
||||
}
|
||||
|
||||
WSContentSend_P(PSTR("</table>{t}")); // Terminate current multi column table and open new table
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user