Commit Graph

92 Commits

Author SHA1 Message Date
XJ
04ab04ccfc HASS - Sensor name 'Battery' also for BATTERY_CHANNEL_SENSOR (#1583)
* Sensor name 'Battery' also for BATTERY_CHANNEL_SENSOR

* .

* changed unique_id to battery_ch to avoid collision

* spaces

* updated comment
2025-03-26 22:15:18 +01:00
XJ
5810db7ae1 BL0492 Frequency to HASS (MQTT) + Energy calculation in TWIN_BL_ENABLED mode for channel 2 (#1578)
* twinbl energy for channel 2

* .

* removed movavg

* Added HASS MQTT frequency (both standard and TWIN_MODE)

* .

* simplify, store total only IX0

* Ext BugFix: addChangeHandler Power < 20 appears broken #1543
2025-03-26 13:24:34 +01: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
XJ
926db0041d HASS MQTT patch typo (#1433) 2024-11-21 16:16:51 +01:00
96a248078c Fix bug preventing divider of 2 to work properly for home assistant auto discovery (#1424)
* Update README.md

Add intention for fork

* Update README.md

Improve Readme

* Update hass.c

Fix issue of not using divider other than 1 for home assistant auto discovery val_tpl

* Update README.md

update Fork intention

* Update README.md

Revert Readme to original state
2024-11-12 21:57:15 +01:00
87a2da9e81 A few fixes for HASS MQTT for Energy (#1398)
* HASS MQTT json update

* HASS MQTT json update

* HASS MQTT json update

* HASS MQTT json update strlen
2024-10-31 12:18:49 +01:00
46fa0b18e0 drivers define change
* Charts test for Ln882h and w800

* Update cmd_if.c

Try fix for DRV_GetReading without ENABLE_DRIVER_BL0937

* Update obk_config.h

* Update cmd_if.c

next try to fix Drivers w/o OBK_DISABLE_ALL_DRIVERS

* Update cmd_channels.c

... and another "DRV_GetReading" ...

* Update hass.c

... next problem: DRV_GetEnergySensorNames

* Update hass.c

.. more disabling code w/o energy driver

* Update http_fns.c

... and even more

* Update json_interface.c

... and energy drivers in json_interface.c

* Update user_main.c

another use of BL09X

* Update obk_config.h to remove define for charts driver
2024-09-29 21:54:54 +02:00
d491a71a93 made avty disable global 2024-09-05 18:19:26 +02: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
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
1308a8f5b5 fix potential RSSI name collision 2023-10-25 16:01:18 +02:00
476af2825a test - better rounding|? 2023-10-19 11:56:30 +02:00
83cd57dff5 hass rssi discovery 2023-10-19 10:30:18 +02:00
9c1ececd3c empty stat_t fix? 2023-09-27 20:26:50 +02:00
51f2281e36 Temperature_div2 added 2023-09-27 09:03:31 +02:00
c82c6047cc whitespaces in name fix? 2023-09-06 17:40:07 +02:00
ee1ffb38d3 Toggle_Inv per user request 2023-08-23 10:51:10 +02:00
5cb73aa17e Remove duplicate prefix (#899) 2023-08-16 11:05:29 +02:00
c094e8fd01 Fix stat_class for energy sensor (#865) 2023-06-25 17:25:17 +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
c783f39380 add flag to use kWh instead of Wh for energy 2023-05-05 09:49:45 +02:00
f1d22cef28 finish tuyamcu dimmer+toggle combo discovery? 2023-05-04 11:29:19 +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
03845f4dd5 disable availbity topic for tmSensr 2023-05-01 23:26:39 +02:00
b6e911fef8 new hass discovery case fix 2023-05-01 20:17:13 +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
dfc12fa76d unfinished voltage hass channel test 2023-05-01 16:00:49 +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
caa8357b9d allow special indices for flash memory channel access; fix obk disable drivers 2023-02-25 11:38:19 +01:00
e2251b0ed3 door sensor should not post availbility topic because it goes to sleep most of the time (for HA discovery) 2023-02-25 10:21:29 +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
e0589fcb4d remove debug log, merge common code 2023-02-09 21:52:15 +01:00