Commit Graph
90 Commits
Author SHA1 Message Date
alex ac08bf8431 style: remove trailing blank lines 2026-09-06 08:46:07 +10:00
alex 35b375b497 feat: improve MQTT discovery publishing and examples 2026-09-04 09:52:20 +10:00
alex 7f28604887 Stabilize Home Assistant contract CI 2026-09-02 07:48:48 +10:00
alex 56d74df55a Release ArduinoHA v3.1.0 v3.1.0 2026-09-02 07:14:20 +10:00
alex 84cc0037b1 Improve release preparation tooling 2026-09-01 17:29:54 +10:00
alex 29ca5b2a29 Release v3.0.2 v3.0.2 2026-09-01 11:39:46 +10:00
alex 5296fb1831 Release v3.0.1 v3.0.1 2026-09-01 10:57:59 +10:00
alex 96c5aa6e78 feat: prepare ArduinoHA 3.0.0 2026-08-27 14:25:38 +10:00
alex 9d3eaa61f7 docs: clarify maintained fork installation 2026-08-25 09:01:06 +10:00
alex 3ac7fc98be Release home-assistant-integration 3.0.0 v3.0.0 2026-08-24 22:08:19 +10:00
alex d03766ffbc Refactor ArduinoHA logging and add MQTT diagnostics.
Move ArduinoHA to a structured, runtime-configurable log model and instrument HAMqtt with disconnect and publish failure telemetry so ESP8266 MQTT failures can be diagnosed without patching PubSubClient first.
2026-05-05 22:29:48 +10:00
alex b9f4fd7f4b Per-entity availability, deferred discovery publish, suggested precision
- Add HAAvailabilityConfig for per-entity availability_topic and payloads
- Defer discovery until MQTT connected; publish availability after discovery
- HASensor/HANumber: optional suggested_display_precision in discovery
- HASerializer/HADictionary: extend for new keys; update device types and mocks
- Docs and examples reflect availability and precision usage
- Tests updated for discovery and availability behavior
- Ignore .cursor/ in repo root
2026-05-05 17:47:55 +10:00
alex 8ba5482892 test: add MQTT callback publish regressions and mock callback tracking
PubSubClientMock flags inbound callback context and counts publish attempts
from callbacks. Entity and core tests assert unsafe callback publishes are
rejected by the mock (baseline before HAMqtt deferred publish).
2026-05-05 13:52:00 +10:00
alex c9e6eef5b2 Add ArduinoHALog helpers, extend ArduinoHADefines, update mqtt usage doc 2026-04-22 12:09:12 +10:00
alex 40b98a38ee Migrate unit tests to PlatformIO Unity
Replace the legacy tests/ tree (AUnit, EpoxyDuino, Make, AUniter) with
PlatformIO Unity suites under test/, shared helpers, and platformio.ini.
Remove AUnitHelpers and drop the AUnit include from ArduinoHA test builds.
Refresh docs to Markdown-only and document the test workflow in CHANGELOG.
2026-04-19 23:24:28 +10:00
alex 7c419cb99e Add PlatformIO library.json and README note
Declare PubSubClient dependency; document lib_deps for PIO consumers.
2026-04-19 21:17:11 +10:00
alex 25fc356a0a Update fork metadata references.
Align the public package metadata and README badge with the maintained alexhopeoconnor fork while preserving upstream authorship credit.
2026-04-18 01:23:26 +10:00
alex 7d5d70d525 Modernize MQTT discovery compatibility and runtime refreshes.
Align ArduinoHA with current Home Assistant MQTT discovery expectations by adding default entity IDs, device discovery support, safer runtime discovery refresh behavior, expanded entity category coverage, and the tests/docs needed to support the migration away from legacy object_id payloads.
2026-04-16 19:49:50 +10:00
alex 7894f0c621 Fix MQTT client ownership and base device cleanup.
Store the production PubSubClient instance directly on HAMqtt and release base device serializers on destruction to avoid invalid deletes and leaked serializer allocations.
2026-04-16 17:39:42 +10:00
alex d954543236 Fix HASelect long-options parsing and add dynamic HANumber config updates.
This prevents overflow-related crashes when select options exceed 255 characters, adds runtime min/max/step updates that republish discovery config, and includes related HAText compilation fixes with test coverage.
2026-04-16 16:44:44 +10:00
alex 2ebdcf302b Add fork-driven MQTT and entity feature upgrades.
This integrates configurable MQTT reconnect behavior, the new Text entity, default lambda callback support across command-capable entities, and entity_category support for button/sensor/number families with test coverage.
2026-04-16 15:38:26 +10:00
Dawid Chyrzyński 1d333ab229 ArduinoHA 2.1.0 2.1.0 2024-02-10 00:48:58 +01:00
Dawid Chyrzynski 2a00dcd65f fix compiler warnings 2024-02-10 00:40:42 +01:00
Dawid Chyrzyński 105e96197b Add support for Arduino Due (#228)
* added support for Arduino Due

* update tests

* update changelog and docs

* fix tests
2024-02-09 22:16:54 +01:00
Dawid Chyrzyński a838dac9c0 fix tests (#227) 2024-02-09 20:31:15 +01:00
Dawid Chyrzyński 77a356bb37 HAMqtt improvements (#224)
* added setBufferSize method to the HAMqtt class

* added getState method to the HAMqtt class

* update docs

* update changelog

* changelog

* update mocks

* change data type in the PubSubClientMock

* update docs and changelog

* add more callbacks to the HAMqtt class

* improve handling of the disconnected state

* minor fixes in state handling
2024-02-09 19:27:10 +01:00
Dawid Chyrzyński 9e17dda50b Added support for object_id in all device types (#223)
* added support for the object_id property in all device types

* added tests
2024-02-07 00:03:30 +01:00
Dawid Chyrzynski 5c7acd7e39 update readme badges 2024-02-06 17:24:22 +01:00
Dawid Chyrzyński 87b7e03fe6 HASensor improvements (#222)
* added support for setting None value in the HASensor

* added support for the expire_after property in the HASensor

* update readme and docs

* added expire_after property in the HABinarySensor

* increase default device types limit to 24 on non ATMega328/168 processors

* added support for the JSON attributes in the HASensor
2024-02-06 17:01:46 +01:00
camnewnham ae059aecc1 Doc: add comment regarding position feature usage (#111)
* add comment regarding position feature usage

* add doc link
2024-02-06 13:58:27 +01:00
Dawid Chyrzyński 6cf4f11580 HASelect improvements (#221)
* added getCurrentOption method to the HASelect

* final fixes, tests

* added support for publishing None state in the HASelect

* update select.ino

* update docs
2024-02-05 20:44:29 +01:00
Dawid Chyrzyński fdc60b57c3 Added support for the configuration_url parameter in the HADevice (#220)
* added support for the configuration_url parameter in the HADevice

* update docs
2024-02-05 17:21:36 +01:00
Dawid Chyrzyński 80ae7ae592 Add support for extended unique IDs (#217)
* implement unique ID serialization as flag

* finished extended unique IDs feature

* add tests

* update docs

* add funding.yml
2024-02-05 16:20:40 +01:00
Dawid Chyrzynski ab46939903 docs 2024-02-05 16:17:33 +01:00
Dawid Chyrzynski e054e53eea update changelog 2024-01-31 09:11:32 +01:00
Dawid Chyrzynski 9ec42d667d update tests, change state_class to stat_cla 2024-01-31 09:11:25 +01:00
Mateusz Starzec b1eeec0856 Support for statistics from sensors in HA (#179)
* Fix statistics from sensors

* Test for state class setter in HASensor
2024-01-31 09:03:01 +01:00
Dawid Chyrzynski cd706969de update changelog 2024-01-31 09:00:44 +01:00
allenb2800andAllen Benter 8e3aad90c4 setKeepAlive function added issue #153 (#170)
Co-authored-by: Allen Benter <allen.benter@dpi.nsw.gov.au>
2024-01-31 08:54:12 +01:00
Dawid Chyrzynski b0bc9b4ea7 bump up version 2024-01-31 00:05:02 +01:00
Dawid Chyrzynski 8d76532e41 update changelog and tests 2024-01-31 00:04:31 +01:00
Kostiantyn Synytsia 252f0ab6b1 Bugfix/maximum number of device types (#190) (#191)
* added test for maximum device types

* fix max device types check
2024-01-30 23:59:54 +01:00
Dawid Chyrzynski b86495f492 update changelog 2024-01-30 23:31:53 +01:00
Eric Shtivelberg 884d8254bf fix: warning: class 'HANumeric' is implicitly friends with itself (#197) 2024-01-30 23:29:17 +01:00
Dawid ChyrzyńskiandDawid Chyrzynski 0fc32a5bad ArduinoHA 2.0.0 🔥 (#81)
* added tests for HADeviceTracker

* added support for progmem property value in the HASerializer

* codebase update

* add support for source type in HADeviceTracker

* added support for HACamera

* added support for HALock

* rename HABinarySensor::getState to getCurrentState

* standardize sender name in all callback headers

* remove duplicate serializer field protection (reduce flash usage)

* optimize HAUtils

* minor improvements

* optimize writing progmem payload

* optimize HAUtils:numberToStr

* remove relloc from HASerializer

* optimize HASerializerArray

* remove includeNullTerminator arg from the topics size generators

* optimize HASerializer

* replace dtostrf with custom implementation

* optimize BaseDeviceType

* removed relloc from the HAMqtt

* removed support for floats

* removed vtable for HADevice, HAMqtt, HASerializer and HASerializerArray

* implemented HASwitch with tests

* implemented basic HADeviceTrigger

* added support for built-in triggers

* finished HADeviceTrigger

* update changelog

* implemented base HASensor

* implemented HASensorInteger

* finished HASensorFloat

* override onMqttConnected in HASensorInteger and HASensorFloat

* add more tests for HASensorInteger and HASensorFloat

* optimize HASensorFloat

* update changelog

* standardize constructor of the HABinarySensor

* update readme

* readme

* readme

* standardize HADeviceTracker API

* standardize HASwitch API

* update docs README

* move Sphinx files to docsrc directory

* type in HASwitch

* test docs

* add .nojekyll to the docs directory

* update makefile of the docs

* wip: docs

* docs: fix html title

* docs: update styling and sidebar

* docs: add "Basics" section

* docs: device configuration

* docs: availability

* docs: MQTT discovery

* docs: MQTT security

* docs: MQTT advanced features

* rename BaseDeviceType to HABaseDeviceType

* update gitignore

* add API reference

* update gitignore

* HADevice doxygen

* doxygen css

* HADevice doxygen typos

* docs: update links

* docs: HAUtils doxygen

* HAMqtt and HADevice doxygen

* docs: device types

* docs: HABaseDeviceType

* reduced flash usage by 190 bytes

* fix tests

* move HAUtils class to the utils directory

* make HADevice const in HAMqtt

* HABinarySensor docs

* doxygen

* HADeviceTrigger doxygen

* HALock doxygen

* HASensor doxygen

* HASensor doxygen

* HASwitch doxygen

* HATagScanner doxygen

* HASerializer doxygen

* fix SAMD compile error

* add HAMqtt::publish method

* update examples

* add HAButton example

* update changelog

* added support for the optimistic property in the HACover

* do not set optimistic property in the HASwitch if it's set to default value

* update examples list

* update HASensor example

* update MQTT docs

* fix device trigger example link

* fix search form style on the search result page

* added support for the optimistic property in the HALock

* update readme

* change readme icon

* added HALock example

* MDNS example

* added HASensorFloat and HASensorInteger examples

* update readme

* update examples

* fix crash in the HABaseDeviceType

* add support for storing RAM elements in the HASerializerArray

* update tests cases in the CoverTest

* finished tests for HASelect

* added support for HASelect

* update README, CHANGELOG and examples list

* DeviceTest typos

* add more tests to SelectTest

* optimize HASelect command's handler

* improve CoverTest

* optimize HACover command's handler

* optimize HALock command's handler

* update SerializerTest

* remove HAMqtt::writePayload_P method

* remove FlagInternalType from the HASerializer

* added support for __FlashStringHelper in the topics related functions

* migrated serializer to use __FlashStringHelper

* add __FlashStringHelper to the HABaseDeviceType::publishOnDataTopic method

* move component name to flash memory

* update docs

* fix debug logs

* fix memory leaks

* monitor memory leaks in all test cases

* optimize tests (RAM)

* fix HALock states

* fix bug in the HASensor (invalid serialization of the value template property)

* fix memory leak in the HASelect

* fix crash in HASelect

* fix memory leak in the HADeviceTrigger

* fix memory leak in the HADevice

* tests: add support for ESP8266 and ESP32 envs

* update docs

* add multi-switch example

* update docs structure

* update MQTT advanced example in the docs

* HADevice: fix _uniqueId memory release

* wip: HANumber

* add HANumber to defines

* refactor HASensor implementation for numbers (again)

* update docs

* wip: HANumber

* wip: add support for number's precision in the HASerializer

* add support for float numbers in the HASerializer

* optimize vtables in the HASensor

* wip: HANumber

* fix crash in the float serialization

* handle another edge case in the float serialization

* replace int32_t with HAUtils::Number type

* HANumber fixes

* tests for HANumber

* change HAUtils::Number type to int64_t

* implemented HAUtils::strToNumber

* finished HANumber command handler

* finished HANumber

* update docs

* add number example

* added support for HAScene

* add scene example, update docs

* update doxygen

* remove memset from the codebase

* micro optimizations

* fix commands handlers

* update HACover code

* codebase cleanup

* finished HAFan implementation

* update docs, added fan example

* make json readable in all tests

* make position configurable in the HACover

* docs

* added support for HALight

* implement default values as static HAFan members

* update docs, added light example

* added support for color temperature in the HALight

* update light example

* update docs

* wip: HVAC

* improve all tests with callbacks

* update logs

* add HVAC to the docs

* optimize HANumber

* add current temperature to the HVAC

* started work on HVAC tests

* added action feature to the HVAC

* add temperature unit to the HVAC

* add more tests to UtilsTest

* fix fake MQTT messages mock - message shouldn't include null terminator

* fix HAUtils::strToNumber

* optimize HAFan, HACover and HALight

* add min/max temp to the HVAC

* added temp step property to the HVAC

* rename HASensorNumber::getCurrentValueAsFloat to getCurrentValueFloat

* update docs

* added support for aux heating in the HVAC

* added power command to the HVAC

* add subscriptions to the HVAC

* added fan mode to the HVAC

* update examples

* update command handlers in all device types

* added swing mode to the HVAC

* finished HVAC

* update docs

* fix memory leak in the HVAC

* added support for the target temperature in the HVAC

* add HVAC example

* update docs

* remove unnecessary checks from some device types

* added support for RGB in the HALight

* update docs

* standardize HAHVAC code

* rename HAButton::onPress method to onCommand

* rename HAScene::onActivate method to onCommand

* fix seg fault in the HAUtils

* HASensorNumber: do not publish default value on connect

* add return uint16_t to the HAUtils::numberToStr method

* simplify logic in the HALight::publishRGBColor

* optimize numbers serialization in the HASerializer

* update README, added LICENSE.md

* rename license file

* added tag-scanner example

* update publishOnDataTopic methods

* added esp32-cam example

* update docs

* add examples to the README.md

* update examples

* update HAMqtt.h for latest SAMD core, update aunier

* update README, fix auniter settings for esp32

* update README

* added documentation link to the README

* final tweaks in the HACover

* fix logic of the speed feature in the HAFan

* fix mdns example

* fix bug in the DeviceTrigger (invalid serialization of the progmem type/subtype)

* implemented HANumeric

* update HASensorNumber

* update HANumber

* update HALight

* update HAHVAC

* update HAFan

* update HACover

* update examples

* update tests

* update docs

* fix HANumeric constructor bug

* update HANumeric for SAMD

* update readme and docs

* add payload_on to the scene config (HA throws an exception if this property is missing)

* update sensor-analog example

* update sensor-integer example

* HVAC fixes

* update docs

Co-authored-by: Dawid Chyrzynski <dawid.chyrzynski@gmail.com>
2.0.0
2022-10-14 19:10:38 +02:00
Dawid Chyrzyński a4e50b7d04 Release 1.3.0 (#36)
* Add support for HVAC (#15)

* remove HASwitch::triggerCallback method

* fix typo in docs

* HASwitch: simplify callback #define

* work in progress: HVAC

* replace local mqtt instances with singleton

* device types optimization

* cleanup

* finished aux heating and away mode

* wip: HVAC

* finished HVAC implementation

* HVAC implementation

* add ifdefs for all HA components

* wip: optimization

* update readme

* update examples

* remove unused constructor from HAMqtt

* update HAUtils

* remove mqtt from constructors, fix compilation warnings

* finished HVAC

* add HVAC example, add changelog

* update changelog, add documentation

* Add support for icons in HASwitch and HASensor (#16)

* add support for icon in HASwitch

* add support for icon in HASensor

* update changelog

* add support for setting retain flag in HASwitch

* Add support for text payload in HASensor (#17)

* refactored HASensor

* update changelog

* fix sensor example

* Add support for fans (HAFan) (#18)

* finished basic implementation of the HAFan

* add retain method to DeviceTypeSerializer

* finished HAFan implementation

* update HAHVAC

* device types cleanup

* add HAFan example

* update changelog

* update readme

* update fan example

* optimization, add support for ActionFeature in HVAC

* Add support for MQTT LWT (#19)

* add support for hostname in HAMqtt

* add support for LWT and shared availability

* minor fixes

* added advanced availability example

* update examples

* update changelog

* cleanup & bug fix

* bump up version

* minor improvements and fixes

* update readme

* add HAMqtt::onMessage method

* Add support for covers (#28)

* add HACovers

* add cover example, update implementation

* disable debug

* update mqtt-events example

* Add support for setting different prefix for non-discovery topics (#29)

* add support for data prefix

* cleanup

* update comments and logs

* update multi-state-button example

* rename rexample from mqtt-events to mqtt-advanced

* update changelog

* update links in changelog

* Home Assistant 2021.4.5 - MQTT upgrade (#33)

* updae HAFan implementation

* change lib version

* update changelog

* fix setSpeed method

* update HAFan example

* Separate uniqueId from name (#34)

* rename name to uniqueId

* remove legacy labels

* update examples

* rename isMyTopic to compareTopics

* update changelog, rename name to uniqueId

* Implement onBeforeStateChanged callback in HASwitch (#35)

* add low latency mode to HASwitch

* add onBeforeStateChanged callback to HASwitch

* update readme

* rename DEPRECATED macro

* update advanced MQTT example
1.3.0
2021-04-17 20:03:32 +02:00
Dawid Chyrzyński 15562fa74c Release 1.2.0 (#21) 1.2.0 2021-03-23 13:23:56 +01:00
Dawid Chyrzyński 70ccd26c75 Add support for Arduino Nano 33 IoT (SAMD) (#5)
* fix compilation errors

* add support for Nano 33 IoT

* bump up version, update link in README.md
1.1.1
2021-02-07 10:13:22 +01:00
Dawid Chyrzyński 4135d0991f Add support for "availability" for sensors and switch (#4)
* hide onMqttConnected and onMqttMessage methods in BaseDeviceType class

* bump up version

* replace HAComponentName with initialization inside constructor

* add missing documentation to begin() method

* add support for availability in BaseDeviceType

* add support for availability in HABinarySensor, HASensor and HASwitch

* move serialization to separate class

* wip: DeviceTypeSerializer

* update device types

* refactored all devices types to use common serializer

* update examples

* update availability example README.md

* bugs fixes

* fix build for NodeMCU

* cleanup
1.1.0
2021-02-06 20:41:10 +01:00
Dawid Chyrzynski 35a7ea39be rename library 1.0.1 2021-01-08 19:23:03 +01:00