Directives and answers travel over MQTT alone, the session is reopened with
a wait of 1 to 60 s, interfaces are rows in program memory, a device has
capabilities with instances, names and semantics, one handler takes the
directive with the device in hand, and the messages beside a Response are
there: ErrorResponse, DeferredResponse, ChangeReport, scene and doorbell
events. A 1.x sketch compiles as it is; the readme says what changes for it.

Light on a D1 mini: static RAM 30,616 B (1.1.0: 52,768), flash 332,705 B
(1.1.0: 350,885). 148 host tests, 17 sketches build without a warning.

On 2026-09-28, with a board and a real Alexa account: nine interfaces
driven, a deferred answer, an ErrorResponse, a ChangeReport and a doorbell
press; the session scenarios on a scripted broker, loss of Wi-Fi included.
Voice commands were not tested yet.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
David 2026-09-28 22:57:22 +00:00
parent f9c787a67a
commit f4297e6fce
7 changed files with 15 additions and 16 deletions

View file

@ -4,13 +4,12 @@ All notable changes to this library are written down here. The format is that of
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/), the version numbers follow [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), the version numbers follow
[Semantic Versioning](https://semver.org/spec/v2.0.0.html). [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [2.0.0] - unreleased ## [2.0.0] - 2026-09-28
The library talks MQTT only, describes 28 interfaces and takes 22 KB less static RAM. The sketches of 1.x compile as The library talks MQTT only, describes 28 interfaces and takes 22 KB less static RAM. The sketches of 1.x compile as
they are; the readme says what changes for them (Migrating from 1.x). they are; the readme says what changes for them (Migrating from 1.x).
While it was written this version was numbered 1.2.0, which was never released. `library.json`, While it was written this version was numbered 1.2.0, which was never released.
`library.properties` and `ALEX2ESP_VERSION` say 1.2.0 until the release.
### Added ### Added

View file

@ -98,10 +98,10 @@ Arduino IDE and have not run on a board yet. What each announces
in discovery is checked by the host tests in `test/test_examples`. in discovery is checked by the host tests in `test/test_examples`.
With this library on a Wemos D1 mini, a real Alexa account and other sketches (2026-09-28), Alexa discovered and With this library on a Wemos D1 mini, a real Alexa account and other sketches (2026-09-28), Alexa discovered and
drove PowerController, BrightnessController, ColorTemperatureController and one instance each of ToggleController, drove PowerController, BrightnessController, ColorTemperatureController, one instance each of ToggleController,
RangeController and ModeController. Not tried with Alexa from this library: ColorController, ThermostatController, RangeController and ModeController, a lock with its deferred answer and a scene, and took a ChangeReport, an
LockController and the deferred answer, SceneController, the ChangeReports and DoorbellPress. Voice commands have ErrorResponse and the press of a doorbell. Not tried with Alexa from this library: ColorController,
not been tried. ThermostatController and the sensors. Voice commands have not been tried.
## Limits ## Limits

View file

@ -1,6 +1,6 @@
{ {
"name": "Alex2ESP", "name": "Alex2ESP",
"version": "1.2.0", "version": "2.0.0",
"description": "Companion library for the Alex2MQTT Alexa skill: exposes ESP8266 devices to Alexa through alex2mqtt.stormysdream.club over MQTT (discovery, directives, state reports).", "description": "Companion library for the Alex2MQTT Alexa skill: exposes ESP8266 devices to Alexa through alex2mqtt.stormysdream.club over MQTT (discovery, directives, state reports).",
"keywords": [ "keywords": [
"alexa", "alexa",

View file

@ -1,5 +1,5 @@
name=Alex2ESP name=Alex2ESP
version=1.2.0 version=2.0.0
author=David <Alex2ESP@stormysdream.club> author=David <Alex2ESP@stormysdream.club>
maintainer=David <Alex2ESP@stormysdream.club> maintainer=David <Alex2ESP@stormysdream.club>
sentence=A companion library for the Alex2MQTT Alexa Skill (ESP8266). sentence=A companion library for the Alex2MQTT Alexa Skill (ESP8266).

View file

@ -411,7 +411,7 @@ The last column says whether Alexa discovered and drove the interface **from thi
| `ThermostatController` | 3.2 | targetSetpoint, lowerSetpoint, upperSetpoint, thermostatMode | `addThermostatSetpointProp`, `addThermostatLowerSetpointProp`, `addThermostatUpperSetpointProp` (both: `addThermostatDualSetpointProp(lower, upper)`), `addThermostatModeProp` | Thermostat | no | | `ThermostatController` | 3.2 | targetSetpoint, lowerSetpoint, upperSetpoint, thermostatMode | `addThermostatSetpointProp`, `addThermostatLowerSetpointProp`, `addThermostatUpperSetpointProp` (both: `addThermostatDualSetpointProp(lower, upper)`), `addThermostatModeProp` | Thermostat | no |
| `TemperatureSensor` | 3 | temperature | `addTemperatureSensorProp(value, scale)` | TemperatureSensor | no | | `TemperatureSensor` | 3 | temperature | `addTemperatureSensorProp(value, scale)` | TemperatureSensor | no |
| `HumiditySensor` | 3 | relativeHumidity | `addHumiditySensorProp` | | no | | `HumiditySensor` | 3 | relativeHumidity | `addHumiditySensorProp` | | no |
| `LockController` | 3 | lockState | `addLockControllerProp` | Lock | no | | `LockController` | 3 | lockState | `addLockControllerProp` | Lock | yes |
| `ContactSensor` | 3 | detectionState | `addContactSensorProp` | ContactSensor | no | | `ContactSensor` | 3 | detectionState | `addContactSensorProp` | ContactSensor | no |
| `MotionSensor` | 3 | detectionState | `addMotionSensorProp` | | no | | `MotionSensor` | 3 | detectionState | `addMotionSensorProp` | | no |
| `TimeHoldController` | 3 | holdStartTime, holdEndTime | `addProperty` | | no | | `TimeHoldController` | 3 | holdStartTime, holdEndTime | `addProperty` | | no |
@ -422,12 +422,12 @@ The last column says whether Alexa discovered and drove the interface **from thi
| `InventoryLevelSensor` | 3 | level | `addProperty` | | no | | `InventoryLevelSensor` | 3 | level | `addProperty` | | no |
| `PlaybackController` | 3 | `"properties": {}` | | | no | | `PlaybackController` | 3 | `"properties": {}` | | | no |
| `WakeOnLANController` | 3 | `"properties": {}` | | | no | | `WakeOnLANController` | 3 | `"properties": {}` | | | no |
| `SceneController` | 3 | no `properties` object | | Scene | no | | `SceneController` | 3 | no `properties` object | | Scene | yes |
| `DoorbellEventSource` | 3 | no `properties` object | | Doorbell | no | | `DoorbellEventSource` | 3 | no `properties` object | | Doorbell | yes |
| `StepSpeaker` | 3 | no `properties` object | | | no | | `StepSpeaker` | 3 | no `properties` object | | | no |
| `SimpleEventSource` | 1.0 | no `properties` object | | | no | | `SimpleEventSource` | 1.0 | no `properties` object | | | no |
The six interfaces with "yes" were driven with another sketch than the examples, which have not run on a board yet. The directives were answered within 0.2 to 0.4 s, and a directive that was delivered twice was answered once. Voice commands have not been tried. The interfaces with "yes" were driven on a Wemos D1 mini with other sketches than the examples, which have not run on a board yet. The directives were answered within 0.2 to 0.4 s, and a directive that was delivered twice was answered once. The lock answered after a DeferredResponse, nine seconds after the directive; the scene was started and stopped; the press of the doorbell was accepted by Alexa. A ChangeReport of a lamp and an ErrorResponse reached Alexa as well. Voice commands have not been tried.
The Alex2MQTT service itself has carried more than that. With its Node.js client, alex2node 1.5.2, on the same day: Power, Brightness, Color, ColorTemperature, Percentage, PowerLevel, Thermostat, Range, Mode, Toggle, Lock and Scene, deferred responses, ErrorResponse, ReportState, and ChangeReports for contact, motion, lock, temperature and power. So the way from the broker to Alexa is tried for these; what this library sends for them is checked by the host tests only. The Alex2MQTT service itself has carried more than that. With its Node.js client, alex2node 1.5.2, on the same day: Power, Brightness, Color, ColorTemperature, Percentage, PowerLevel, Thermostat, Range, Mode, Toggle, Lock and Scene, deferred responses, ErrorResponse, ReportState, and ChangeReports for contact, motion, lock, temperature and power. So the way from the broker to Alexa is tried for these; what this library sends for them is checked by the host tests only.
@ -683,7 +683,7 @@ What changes for a 1.x sketch that is compiled against 2.0:
- ESP8266 only. The library has never been compiled for an ESP32. - ESP8266 only. The library has never been compiled for an ESP32.
- The session is MQTT over TCP on port 1883, without TLS. - The session is MQTT over TCP on port 1883, without TLS.
- Reports are published with QoS 0 and sent once. An event or a change while there is no session with the broker is not sent later; `send()` returns `false` and the sketch decides. - Reports are published with QoS 0 and sent once. An event or a change while there is no session with the broker is not sent later; `send()` returns `false` and the sketch decides.
- Tried with Alexa from this library: the six interfaces marked in [Interface Types](#interface-types). Not tried from this library: `ColorController`, `ThermostatController`, `LockController` and the deferred answer, `SceneController`, the ErrorResponse, the ChangeReports, `DoorbellPress` and every interface without an example. Voice commands have not been tried. - Tried with Alexa from this library: the nine interfaces marked in [Interface Types](#interface-types), the deferred answer, the ErrorResponse, a ChangeReport and `DoorbellPress`. Not tried from this library: `ColorController`, `ThermostatController`, the sensors and every interface without an example. Voice commands have not been tried.
- The examples are compiled, with 0 warnings, and what each announces in discovery is checked by the host tests. They have not run on a board and have not been built with the Arduino IDE. - The examples are compiled, with 0 warnings, and what each announces in discovery is checked by the host tests. They have not run on a board and have not been built with the Arduino IDE.
- The library keeps no state of the devices. What a device is set to is a variable of the sketch and starts from its initial value after a reset. - The library keeps no state of the devices. What a device is set to is a variable of the sketch and starts from its initial value after a reset.
- 28 of the interfaces of Alexa have a row. The others cannot be announced. - 28 of the interfaces of Alexa have a row. The others cannot be announced.

View file

@ -4,7 +4,7 @@
#include <Arduino.h> #include <Arduino.h>
// A 1.x name, kept for sketches that print the memory figures. The send and receive queues that lived here // A 1.x name, kept for sketches that print the memory figures. The send and receive queues that lived here
// belonged to the HTTP fallback and went with it in 1.2.0; the library's own diagnostics are in AlexaLog.h. // belonged to the HTTP fallback and went with it in 2.0.0; the library's own diagnostics are in AlexaLog.h.
// printMemoryInfo() is a utility of the sketch and not a line of the log: the library never calls it, and it // printMemoryInfo() is a utility of the sketch and not a line of the log: the library never calls it, and it
// prints on Serial whatever the log level and ALEX2ESP_LOG_MAX are, because the sketch asked for the figures. // prints on Serial whatever the log level and ALEX2ESP_LOG_MAX are, because the sketch asked for the figures.
class AlexaUtils class AlexaUtils

View file

@ -3,6 +3,6 @@
#ifndef ALEXA_VERSION_H #ifndef ALEXA_VERSION_H
#define ALEXA_VERSION_H #define ALEXA_VERSION_H
#define ALEX2ESP_VERSION "1.2.0" #define ALEX2ESP_VERSION "2.0.0"
#endif // ALEXA_VERSION_H #endif // ALEXA_VERSION_H