Commit Graph

901 Commits

Author SHA1 Message Date
f5e2a50ba5 allow auto creation of tuya dpid storage 2024-04-20 23:03:56 +02:00
aec5dfaf29 Fix index page performance for LN882H (#1180) 2024-04-14 19:43:06 +02:00
46b698b77d Merge branch 'main' of https://github.com/openshwprojects/OpenBK7231T_App 2024-04-10 15:48:36 +02:00
89fc09a921 fix Web App API for long startup commands > 255 chars 2024-04-10 15:44:59 +02:00
f1c1894235 Add LittleFS for BL602 (#1159)
* Add little fs for bl602

* check for Lfs before creating file
2024-04-09 14:57:46 +02:00
355b856f50 update supported chips list on OBK about page + more modules to release info (#1171)
* update supported chips list on OBK about page

* forgot Belon

* correct spelling in drv_bp1658cj.h

in comments only

* update release notice supported chips and modules

* add BL602 modules

* add w600 module

* add more modules
2024-04-08 11:49:09 +02:00
52aba73a5f reboot reason (#1154) 2024-03-28 16:22:02 +01:00
eaaa3848b0 Some more fixes to usage of gmtime (#1150)
* Some more fixes to usage of gmtime

* Second version for drv_ntp_events.c - changing to time_t (hence do casting in calculations)

* Fix for unset NTP time if no NTP drivers present. Rely on "fake" definitions of
NTP_GetCurrentTime() and NTP_GetCurrentTimeWithoutOffset() to make sure
code using time is not called, if it is not set.

* If time is not set, give 1970-01-01T00:00:00 as startupUTC
2024-03-27 23:47:28 +01:00
9987e685e9 Hass discovery (#1122)
* HASS discovery energy stats fixed except energycounter_clear_date

* HASS: add friendly entity names, remove timestamp class from energycounter_clear_date as workaround for hass-incompatible date format

* HA energycounter_clear_date fixed for correct interpreting as home assistant timestamp sensor

* refactor HA power sensors discovery info

* refactor HA power sensors discovery more

* add apparent power, reactive power, power factor to mqtt + hass discovery, refactor some vars into new energy_sensors[] struct

* amend hass sensor unique_ids due to mqtt topic/channel too long; 'Error:MQTT:Unable to queue! Topic (13), channel (66) or value (437) exceeds size limit'

* hass sensors: add 'energy 2 days ago', 'energy 3 days ago', 'uptime'
web UI: energy sensors apply their rounding setting
drv_bl_shared.c: add enum for daily_stats[], put rearrange energy_sensor[] struct to expose only names via DRV_GetEnergySensorNames()

* -HA energy sensor uniq_id values made consistent with prior builds via .hass_uniq_id_suffix
-Refactor drv_bl_shared sensor/counter vars into energy_sensors[] to simplify mqtt transmissions etc
-Add energy '2 days ago'/'3 days ago' to main web ui, data from vars already being saved to/from flash
-NTP fix html formatting in web ui

* -HA energy sensor uniq_id values made consistent with prior builds via .hass_uniq_id_suffix
-Refactor drv_bl_shared sensor/counter vars into energy_sensors[] to simplify mqtt transmissions etc
-Add energy '2 days ago'/'3 days ago' to main web ui, data from vars already being saved to/from flash
-NTP fix html formatting in web ui

* Update settings.json

ignore vscode settings...

* Update settings.json

* Update settings.json

* minor fix

* fix OBK_CONSUMPTION_LAST_HOUR missing from mqtt

* HASS entity names use channel labels when set, hass discovery excludes unpublished entities (i.e. those set via SetChannelPrivate), hass discovery firmware build info added to diagnostic section, energy sensor discovery bugfix re clear-date

* update submodule sdk

* Fix ch0 label wrongly applied to diagnostic sensors

* update docs

---------

Co-authored-by: Stefan Smith <stefan064>
2024-03-23 17:56:44 +01:00
deb61620e7 remove warning 2024-03-14 15:11:05 +01:00
a9f702ab06 Temperature var (#1127)
* s

* Update cmd_if.c

* header

* bl602 fix
2024-03-12 23:39:29 +01:00
2d6f4e61ca g_rebootReason (#1121)
* g_rebootReason

* fx
2024-03-10 00:09:30 +01:00
e833f80494 new reboot reasons 2024-03-09 22:33:25 +01:00
bc124fc873 App warnings fixed. (#1118) 2024-03-09 08:02:26 +01:00
d02008b7ca MAIN page item added to HTML footer. (#1115) 2024-03-08 00:12:26 +01:00
29cc2cc323 Add energy sensors to MQTT + HA discovery for active power, reactive power, power factor (#1102)
* HASS discovery energy stats fixed except energycounter_clear_date

* HASS: add friendly entity names, remove timestamp class from energycounter_clear_date as workaround for hass-incompatible date format

* HA energycounter_clear_date fixed for correct interpreting as home assistant timestamp sensor

* refactor HA power sensors discovery info

* refactor HA power sensors discovery more

* add apparent power, reactive power, power factor to mqtt + hass discovery, refactor some vars into new energy_sensors[] struct

* amend hass sensor unique_ids due to mqtt topic/channel too long; 'Error:MQTT:Unable to queue! Topic (13), channel (66) or value (437) exceeds size limit'

* hass sensors: add 'energy 2 days ago', 'energy 3 days ago', 'uptime'
web UI: energy sensors apply their rounding setting
drv_bl_shared.c: add enum for daily_stats[], put rearrange energy_sensor[] struct to expose only names via DRV_GetEnergySensorNames()

* -HA energy sensor uniq_id values made consistent with prior builds via .hass_uniq_id_suffix
-Refactor drv_bl_shared sensor/counter vars into energy_sensors[] to simplify mqtt transmissions etc
-Add energy '2 days ago'/'3 days ago' to main web ui, data from vars already being saved to/from flash
-NTP fix html formatting in web ui

* -HA energy sensor uniq_id values made consistent with prior builds via .hass_uniq_id_suffix
-Refactor drv_bl_shared sensor/counter vars into energy_sensors[] to simplify mqtt transmissions etc
-Add energy '2 days ago'/'3 days ago' to main web ui, data from vars already being saved to/from flash
-NTP fix html formatting in web ui

* Update settings.json

ignore vscode settings...

* Update settings.json

* Update settings.json

* minor fix

* fix OBK_CONSUMPTION_LAST_HOUR missing from mqtt

---------

Co-authored-by: Stefan Smith <stefan064>
2024-03-02 07:55:01 +01:00
231b87aea8 Warnings in OpenBK7231T_App fixed. (#1098)
* Warnings in AppT fixed.

* Remove ota include file added by mistake in drv_sm2235.
2024-02-23 08:45:28 +01:00
8eaf72e2ea Home Assistant discovery - add energy counters today/yesterday, add clear date, add friendly names (#1092)
* HASS discovery energy stats fixed except energycounter_clear_date

* HASS: add friendly entity names, remove timestamp class from energycounter_clear_date as workaround for hass-incompatible date format

* HA energycounter_clear_date fixed for correct interpreting as home assistant timestamp sensor

* fix compile on OpenW800 due to OBK_DISABLE_ALL_DRIVERS on that platform

---------

Co-authored-by: Stefan Smith <stefan064>
2024-02-22 11:26:13 +01:00
421466063a add channels 2 to json 2024-02-20 11:25:33 +01:00
a1decd3427 Add temperature to BL602 (#1067)
Co-authored-by: openshwprojects <85486843+openshwprojects@users.noreply.github.com>
2024-02-09 14:32:02 +01:00
cedc4be125 Make temperature readable (#1066) 2024-02-09 14:28:38 +01:00
23c4c4d408 add Yesterday to ENERGY 2024-02-07 09:07:33 +01:00
729320258f Add internal temperature for Beken chipd (#1065)
* Add internal temperature for Beken chipd

* Don't fetch temperature in safe mode
2024-02-06 08:20:04 +01:00
8ed822d284 Fix OTA for BL602 (#1062)
Change to erasing flash in smaller chunks, this avoids issues with http connection, because erasing seems to stop everything.
2024-02-05 05:14:20 +01:00
8bb382b1f2 rtos delay (#1056) 2024-02-04 12:53:27 +01:00
20abe81b0b Implement reboot reason for BL602 (#1053)
* Implement RSSI for BL602 (#5)

Adds RSSI for BL602, looks ok, reports similar to what BK7231N reports in the same place

* Update http_fns.c

* Update http_fns.c
2024-01-31 17:55:54 +01:00
c5ad9acfb7 Implement full flash read for BL602 (#1052)
* Implement RSSI for BL602 (#5)

Adds RSSI for BL602, looks ok, reports similar to what BK7231N reports in the same place

* Update rest_interface.c

* Update rest_interface.c

* Update rest_interface.c

* Update rest_interface.c

* Update rest_interface.c

* Update rest_interface.c

* Update rest_interface.c

* Update rest_interface.c
2024-01-29 17:59:05 +01:00
55e2a66f7d Tuyamcu raw access (#1048)
* working/?

* winnermicro fix

* ENABLE_DRIVER_TUYAMCU fx

* some fixes, some unfiished

* extra check
2024-01-24 11:18:29 +01:00
5f7ab71721 quick hack to display LN temperature 2024-01-21 17:08:20 +01:00
87868f2559 Get sunrise/sunset (#1030)
* Get the next sunset or sunrise values as TimerSeconds to allow setting a light's initial sate.

* Fix BL602 & W600 builds, and add some self test asserts for get sunrise/sunset

* Clock based self tests fail if they are not run in Europe time zone.

Update all usages of localtime to be gmtime. On windows local time is has the timezone applied on top of the sourceTime parameter, OpenBK app manages its own timezone and applies it to g_ntpTime appropriately, so gmtime will avoid the additional timezone application on windows machines.

* Simplify sample autoexec to avoid functionality that has not been implemented yet.

* Update docs

* Small fix in autoexe file

No brackets allowed, multiplications before addition appears to work
2024-01-20 13:50:40 +01:00
92af5a6eaa OTA 2024-01-18 17:29:49 +01:00
77a95640ab fix hass discovery 2024-01-13 19:13:14 +01:00
2ba126b48b LN882H (#1022)
* it compiles and links

* Update user_main.c
2024-01-08 21:07:55 +01:00
57bf618d6d Start of LN882H platform definitions 2024-01-08 15:17:42 +02:00
bed281a890 friendlyName fix 2024-01-02 19:35:01 +01:00
b27c3a9cfc OBK_FLAG_DISCOVERY_DONT_MERGE_LIGHTS 2023-12-23 08:19:16 +01:00
b0bfc23098 split power handling 2023-12-17 23:08:52 +01:00
7193dbfa18 rewrite div handling so it's less messy 2023-12-17 22:13:40 +01:00
6cabc45b67 add Temperature_div100 for BMP280 2023-12-17 21:12:27 +01:00
e4211ac508 add pressure channel 2023-12-16 18:27:46 +01:00
95c30dd800 Add HTTP basic authentication (#996)
* add http basic auth

* add feature check for basic auth process

* fix http basic auth build for unsupported platforms (W800, W600)

* fix includes in http_basic_auth

* fix basic auth invocations when unavailable

* add http basic auth allow checks to http_fns

* remove unnecessary checks

* add my_strnicmp export

* silence warning

* update web password config ui

* update submodules

* add base64 lib to boufallo.mk for BL602

* add safe mode http basic auth bypass flag

* fix bl602 build with http auth bypass flag

* disable shared led driver

---------

Co-authored-by: Tester23 <openshwprojects@gmail.com>
2023-12-13 15:19:11 +01:00
4ba5c8326c PowerFactor_div100 2023-12-07 19:34:17 +01:00
34bf86f90f add Frequency_div10 2023-12-04 16:59:27 +01:00
960f281102 tuyamcu hass discoery edge case fix 2023-11-29 13:04:13 +01:00
08fc163286 rename loglevel to g_loglevel because it's global variable... 2023-11-26 12:17:11 +01:00
801959d9b8 only fixing warnings 2023-11-21 14:48:15 +01:00
0fccb67580 cosmetic changes only, fixing compilation warnings 2023-11-20 14:54:05 +01:00
79c0f6d862 temporary disable IP print 2023-11-02 17:21:50 +01:00
d772bb4938 prit more ip info (#974) 2023-11-02 08:54:36 +01:00
f9e5e428d0 remove 255 chars limit from add_label_input 2023-11-01 08:24:56 +01:00