Import ESP_UniClock (upstream 1189810)
Vendored from https://github.com/gpeter62/ESP_UniClock: the sketch source, the web UI and the libraries the ESP8266 build needs, unpacked from the bundled zips. Adds a PlatformIO project for the ESP-12. The source is unchanged; local changes follow as separate commits. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
8efa810e4e
commit
b347f1c63f
843 files changed
+122061
No files matched your search
@@ -0,0 +1,33 @@
|
||||
# Home Assistant availability example
|
||||
|
||||
This example shows how to use "availability" feature of the Home Assistant.
|
||||
It's supported only by following device types:
|
||||
* Binary sensor
|
||||
* Sensor
|
||||
* Switch
|
||||
* HVACs
|
||||
* Fans
|
||||
|
||||
## Initialization and usage
|
||||
|
||||
Availability feature is turned off by default. In order to turn it on for the specific
|
||||
sensor/switch you need to set initial state of the unit by calling `setAvailability` method.
|
||||
|
||||
Example:
|
||||
```cpp
|
||||
...
|
||||
HABinarySensor sensor("input", "door", true, mqtt);
|
||||
|
||||
void setup() {
|
||||
// ...
|
||||
|
||||
// method must be called before `mqtt.begin(...)`
|
||||
sensor.setAvailability(false); // offline
|
||||
|
||||
mqtt.begin(BROKER_ADDR);
|
||||
}
|
||||
...
|
||||
```
|
||||
|
||||
After availability is set for the very first time you can call `setAvailability` in any time.
|
||||
Each time the method is called, the device will publish MQTT message to the broker.
|
||||
Reference in new issue
Block a user