Commit Graph

49 Commits

Author SHA1 Message Date
4ad9a85a08 Add ChType_Enum and enable SetChannelEnum. (#1830)
* create a ChType_Enum to go with SetChannelEnum

* resolve build errors for ChType_Enum PR

* fixing build errors for simulator and others for cmd_enums.c

* added ChType_ReadOnlyEnum and assocaited enum selftests

* ChType_Enum simulation and memory error corrections

* ChType_Enum documentation updates

---------

Co-authored-by: root <root@stonacek.nz>
2025-10-14 09:21:18 +02:00
4a2ae013ed HLW8112 Driver for energy measurments (#1810)
* initial test driver for hlw8112

Signed-off-by: Nizam <code@maxters.net>

* restrict build to BK7231N
will stub other platforms later

Signed-off-by: Nizam <code@maxters.net>

* fix newer gcc build

Signed-off-by: Nizam <code@maxters.net>

* fix channel b stat restore
after all i still doesnt get pointer arithmetic

Signed-off-by: Nizam <code@maxters.net>

* clean up flashvar bk7231 still use emetering struct to store data

Signed-off-by: Nizam <code@maxters.net>

* fix OpenBK7231N_ALT build fail

Signed-off-by: Nizam <code@maxters.net>

* disable incomplete spi device raw access commands and ui

Signed-off-by: Nizam <code@maxters.net>

* remove mqtt hack for commands. leverage existing tasmota command framework

Signed-off-by: Nizam <code@maxters.net>

* missed flashvar restore

Signed-off-by: Nizam <code@maxters.net>

* disable hlw812 driver for upstream pr

Signed-off-by: Nizam <code@maxters.net>

---------

Signed-off-by: Nizam <code@maxters.net>
2025-09-30 15:04:15 +02:00
94812a2587 BK7231T/U/ESP32/LN882H SPI LED (#1749)
* BK7231U/T_ALT SPI LED

* esp32 spi led dma

* ln882h led spi dma

* simplify

---------

Co-authored-by: Tester23 <85486843+openshwprojects@users.noreply.github.com>
2025-08-10 14:46:01 +02:00
eb77165be9 Update hass.h - add missing "hass_init_textField_info()" to avoid breaking ESP builds (#1753)
ESP builds with "-Werror=implicit-function-declaration", so we get

 error: implicit declaration of function 'hass_init_textField_info';
2025-08-09 19:10:58 +02:00
6ae05de560 textfield hass discovery? 2025-08-07 23:44:04 +02:00
3564ed7013 AC TCL 3 (#1659)
* Update obk_config.h

* fan fx

* fan mode

* fan_only

* swings for climate

* test html

* better

* bew cfg

* Update obk_config.h
2025-06-26 15:56:39 +02:00
b1b41f4a66 channel type - Percent 2025-05-31 01:18:37 +02:00
d6f7678dc6 TCL AC driver progress + LowMidHigh etc channels HA discovery
* Buzzer

* Update obk_config.h

* Display

* uart test stub

* unfinished TCL_DoDiscovery

* ha

* Update drv_tclAC.c

* ha mode send

* unfinished not working

* Update drv_tclAC.c

* Update hass.h

* better discovery

* Update obk_config.h
2025-05-30 16:10:36 +02:00
XJ
3c22b5e4ad Twin BL0942 mod - Two BL0942 on two UARTs on one power metering device (#1531)
* Twin BL0942 mod

* Energy data more checks for index 0

* BL09XX_ResetEnergyCounter reset lastSavedEnergyCounterValue

* added ENABLE_BL_TWIN compiler option, default disabled

* added more ENABLE_BL_TWIN
2025-02-26 11:51:22 +01:00
eb5b1ca2d0 Allow to disable more drivers and features in order to reduce binary size (#1500)
* Update obk_config.h

* Update obk_config.h

* shared

* fx

* he

* fix

* fx

* ffff

* F

* T

* tre

* fcx

* leeed

* ww

* w

* fx

* t

* ENABLE_OLD_YAML_GENERATOR

* w

* startyuip[

* dis all

* remove test post

* ENABLE_HTTP_SEND

* extra guard

* ENABLE_TCP_COMMANDLINE

* better OBK_DISABLE_ALL_DRIVERS

* tr

* ENABLE_PING_WATCHDOG

* ENABLE_HA_DISCOVERY

* TEST WITH EMPTY USER_MAIN

* fx

* no mqtt

* nm

* tr

* ENABLE_MQTT

* Update cmd_newLEDDriver.c

* tr

* header

* fx

* Update user_main.c

* t

* Update hal_main_bk7231.c

* w

* ENABLE_DRIVER_IR

* RESTORE

* fx

* #warning "Platform not defined"

* fx 1

* Update obk_config.h

* ENABLE_DRIVER_TESTPOWER

* DS1820

* fx

* fx

* enable DHT on W800

* Update Makefile

* ntp w800

* ntp

* ssdp

* OWM AND CHARTS

* why utils net has flash pub included

* nmakefile only, no refs

* makefile only

* drv

* Update Makefile

* drcs

* ENABLE_DRIVER_BMP280

* Update Makefile

* d

* ENABLE_I2C

* Update Makefile

* fin
2025-01-10 19:50:17 +01:00
3a1c3e9bbf BatteryLevelPercent for HA 2025-01-05 14:39:19 +01:00
9423561ca0 Add water quality PH Type (#1283)
* Update new_pins.h

* Update new_pins.h

* Update new_pins.c

* Update hass.c

* Update http_fns.c

* Update hass.h

* Update new_pins.c

* Update new_pins.h

* Update new_pins.c

* Update http_fns.c

* Orp Channel Type

* Add Orp Channel Title

* Bugfix Case Type

* TDS Water Quality Type

* tds change channelname

* Add Tds Pin
2024-07-04 18:30:31 +02:00
2c6686e8ac Publish IP and SSID to Home Assistant (#1262) 2024-06-14 08:34:02 +02:00
e609f37264 Publish internal temperature to Home Assistant (#1243) 2024-05-20 00:49:45 +02: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
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
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
b0bfc23098 split power handling 2023-12-17 23:08:52 +01:00
e4211ac508 add pressure channel 2023-12-16 18:27:46 +01:00
0fccb67580 cosmetic changes only, fixing compilation warnings 2023-11-20 14:54:05 +01:00
1308a8f5b5 fix potential RSSI name collision 2023-10-25 16:01:18 +02:00
83cd57dff5 hass rssi discovery 2023-10-19 10:30:18 +02:00
7fae04a9e3 add missing header 2023-09-27 09:42:08 +02:00
51f2281e36 Temperature_div2 added 2023-09-27 09:03:31 +02:00
1141d42325 header 2023-08-23 11:16:07 +02:00
23cbd2c7f1 HA discovery energy_sensor from tuyaMCU (#864)
Handle EnergyTotal_kWh_div1000
2023-06-25 09:28:52 +02:00
1e8bb1f688 illuminance channel type for Homa Assistant Discovery 2023-06-19 00:11:04 +02:00
808f65c8ad add smoke percent channel type and add bat_relay_n 2023-05-20 20:26:36 +02:00
21c6a0dd7e header fx, comment 2023-05-04 11:41:43 +02:00
5d78434941 tuyamcu discovery for dimmers - p1, unfinished 2023-05-04 10:13:58 +02:00
d4f99293b6 read only low mid high channel with Hass discovery 2023-05-02 13:03:45 +02:00
f9e17be5fb ReadOnly HA discovery 2023-05-02 12:22:47 +02:00
83871bf889 TuyaMCU Hass Discovery/custom channel types should cover now Toggles, Voltage/Current/Power, and humidity/temperature 2023-05-01 20:07:30 +02:00
fa592bc5a0 custom channels HASS discovery, not enabled, p1 2023-05-01 15:49:49 +02:00
22aa45fd66 add function for generating val_tpl for hass, with a self-test 2023-05-01 14:05:12 +02:00
28556c06c7 Adding SGP Air Sensor I2C Driver (#769)
* Adding new driver for SGP30

* correct tasmota detection for SGP

* Correct mqtt publish

* Adding dependency in drv_tuyaMCU for bl0602
2023-04-14 08:37:12 +02:00
137c815dfb HASS Discovery for color temperature range. (#736)
* Add Color Temperature Range to HASS Discovery.

Add min_mireds and max_mireds to lights with color temperature capability.

* Update hass.h

* Debug logging.

* mireds as int rather than float.

* Removed debug logging.
2023-03-17 12:58:34 +01:00
993cd60c90 [HASS] Adding Battery driver discovery ang sensor avty flag (#685)
* Adding Battery driver discovery
Adding Flag for sensor avaibility publish

* correct hass.h

* correct call for other platform than beken

* Change Typo availability and Battery for driver

* Forget the pin description
2023-02-22 09:14:17 +01:00
f346c6169e flag for adding relays as lights in hA discovery 2023-02-19 17:10:07 +01:00
18fae1fe0e HASS set pointer to NULL after free, also add cosnt correct 2023-01-16 13:56:46 +01:00
174ab8dd1d DHT discovery (#590)
* Renamed enums,hass_init_sensor_device_info

* Added discovery for DHT sensors

* Fixed/simplified publish in discovery

* Handle 2nd channel for DHT

* Renamed feature DHT to SENSOR to be reusable

* Added missing :

* Minor optimization

* Fixed missing }
2023-01-09 10:06:58 +01:00
5f509064f0 Add support for binary sensor (digital input) in Home Assistant discovery (#586)
* Add support for binary sensor in Home Assistant discovery

* Fix broken builds
2023-01-07 00:28:37 +01:00
a199327167 Using brightness scale of 100 2022-12-29 20:28:31 -06:00
86ee0499ac Fixed 2 PWM case 2022-10-18 06:35:51 -05:00
fd4aaeef13 Formatted 2022-10-14 21:08:38 -05:00
8bd59e66d0 Added support for RGB 2022-10-07 05:57:28 -05:00
684a175a3c Reworked storage for JSON generation 2022-10-04 19:36:13 -05:00
94aa809ebf Added HASS specific modules 2022-09-09 04:12:48 -05:00
258873a37b Added placeholder hass 2022-09-08 05:31:05 -05:00