Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
DutchmanNL committed Nov 12, 2023
2 parents 2745357 + 3f0964e commit c49e054
Show file tree
Hide file tree
Showing 37 changed files with 1,956 additions and 693 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name: Test and Release
on:
push:
branches:
- "main"
- "*"
tags:
# normal versions
- "v[0-9]+.[0-9]+.[0-9]+"
Expand Down
3 changes: 0 additions & 3 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,5 @@ tsconfig.*.json
iobroker.*.tgz
package-lock.json

# i18n intermediate files
admin/i18n

# maintenance scripts
maintenance/**
8 changes: 8 additions & 0 deletions CHANGELOG_OLD.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
# Older changes
## 0.3.0 (2023-10-31) - Bugfixes & Improvements
* (Dutchman & SimonFischer04) Several Bugfixes
* (SimonFischer04) Supports type "select device"
* (DutchmanNL) ESPHome dashboard default disabled
* (SimonFischer04) Migrate to @2colors/esphome-native-api
* (DutchmanNL) Automatically create needed directories, resolves #168
* (SimonFischer04) Migrate usage of python to new structure should solve all ESPHome Dashboard-related installation issues

## 0.2.4 (2021-08-24)
* (DutchmanNL) Version of ESPHome Dashboard updated to 2021.8
* (DutchmanNL) Add option if config of ESPHome device should be shown as states (default = FALSE, safes 8 states for each sensor)
Expand Down
88 changes: 73 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,18 @@
## ESPHome adapter for ioBroker

Control your ESP8266/ESP32 with simple yet powerful configuration files created and managed by ESPHome.
Native integration of ESPHome managed device (Including Dashboard) by its native API and ensure all data is synchronised (live-event handling, no data polling ! :)
Native integration of ESPHome managed device (Including Dashboard) by its native API and ensures all data is synchronized (live-event handling, no data polling ! :)

![Logo](admin/img/dashboard.png)

This adapter uses the [esphome-native-api](https://github.com/Nafaya/esphome-native-api#readme) with all credits to @Nafaya to interact with [ESPHome API](https://esphome.io/components/api.html?highlight=api)!


<!--
## [Documentation](https://DrozmotiX.github.io/languages/en/Adapter/ESPHome/)
All our adapter documentation can be found at [The DrozmotiX Docu Page](https://DrozmotiX.github.io/languages/en/Adapter/ESPHome/)
All our adapter documentation can be found at [The DrozmotiX Docu Page](https://DrozmotiX.github.io/languages/en/Adapter/ESPHome/)
-->

## Prerequisites

Expand All @@ -37,12 +40,65 @@ All our adapter documentation can be found at [The DrozmotiX Docu Page](https://
* ESPHome Dashboard IP is provided in instance settings

### Activate API in YAML
> [!IMPORTANT]
> ioBroker ESPHome allows to integrate Devices by Encryption Key (recommended) or API-Password (legacy),
> you must specify your authentication settings accordingly,
> see [ESPHome Documentation](https://esphome.io/components/api.html?highlight=api)
> Please only configure Encryption Key (preferable) or API-Password (legacy)
#### Example Encryption Key configuration entry
```
api:
encryption:
key: "DyDfEgDzmA9GlK6ZuLkj3qgFcjXiZUzUf4chnIcjQto="
```

#### Example API configuration entry
```
api:
password: 'MyPassword'
```

### Add / Modify / Remove ESPHome devices to ioBroker
> [!IMPORTANT]
> This adapter integrates communication with ESPHome capable devices and
> (if activated) an integrated version of ESPHome Dashboard.
> You must configure and upload your ESP configuration by yourself,
> either by using the integrated Dashboard or an external alternative
> (like Docker) before they can be integrated to ioBroker
The device Tab will show all current known devices; you can either wait for Devices to be autodetect
(currently disabled, see #175) or add them manually by providing their IP-Address and credentials

![DevicesTab](admin/img/deviceTabEmpty.png)

> [!NOTE]
> Buttons to add/modify/remove devices and load device table are only available if adapter is running!
> You must refresh the device table manually by pressing "Refresh device Overview", all devices and their connection state will be shown
Please enter IP-Address (if a device is already known, you can select it from the dropdown) and choose the proper actions:
- ADD / Modify Devices
- Will send IP address and credentials to the backend and try to establish a connection
- When an encryption Key is provided, API-Password is ignored, please ensure proper YAML configuration!

- Delete Device
- Will send a message to the backend to remove this device

> [!WARNING]
> THis action will remove selected device and all its related states from ioBroker!
> [!NOTE]
> After a device has been added, a message will be indicated if successfully or error,
> you can refresh the table to show current devices and their connection status
![DevicesError](admin/img/connectionError.png)
![DevicesOK](admin/img/connectionOK.png)

If connection was successfully, the Device will be initiated and all related states created to control their attributes.
When making any changes to your YAML configuration, reboot of the ESP will disconnect and initiate a new connection.
During this process, states not part anymore of YAML configuration will be automatically removed.

![DevicesOK](admin/img/deviceTree.png)

### Example config
Example config, for more examples see [The DrozmotiX Docu Page](https://DrozmotiX.github.io) or [ESPHome Documentation](https://esphome.io/index.html)
Expand Down Expand Up @@ -95,14 +151,14 @@ Example config, for more examples see [The DrozmotiX Docu Page](https://Drozmoti
## Tasmota / ESPEasy migration

Migrating from previous Sonoff Tasmota or ESPEasy setups is very easy. You just need to have ESPHome create a binary for you and then upload that in the web interface.
See for more details our [Docu Page](https://DrozmotiX.github.io/languages/en/Adapter/ESPHome/06.migration.html)
See for more details on our [Docu Page](https://DrozmotiX.github.io/languages/en/Adapter/ESPHome/06.migration.html)

**_NOTE:_** Generated yaml files are stored at ```/opt/iobroker/iobroker-data/iobroker.esphome.>instance</>device<.yaml


## Support me
If you like my work, please consider a personal donation
(this is an personal Donate link for DutchmanNL, no relation to the ioBroker Project !)
(this is a personal Donate link for DutchmanNL, no relation to the ioBroker Project !)
[![Donate](https://raw.githubusercontent.com/DrozmotiX/ioBroker.sourceanalytix/main/admin/button.png)](http://paypal.me/DutchmanNL)

## Changelog
Expand All @@ -112,31 +168,33 @@ If you like my work, please consider a personal donation
### __WORK IN PROGRESS__
* (DutchmanNL)
-->
### 0.5.0-beta.0 (2023-11-12) - Rebuild Admin Interface & Connection handler
* (DutchmanNL) Admin interface redesigned to JSON-Config relates #171
* (DutchmanNL) Backend massages implemented to Add/Modify/Delete devices
* (DutchmanNL) Device connection handling and visibility of devices improved
* (DutchmanNL) Auto device discovery temporary disabled due to external bug, relates #175
* (DutchmanNL) Possibility added to exclude IP-Addresses from device discovery, relates #175
* (DutchmanNL) Allow Selection to listen on specific interface or all for device discovery resolves #67
* (DutchmanNL) State implemented to show current connection status (unreachable/disconnected/connected) to improve management of devices
* (DutchmanNL) Several bugfixes, resolves #181 resolves #

### 0.4.1 (2023-11-05)
* (DutchmanNL) Bugfix: Password / connection issues in previous beta resolves #179
* (DutchmanNL) Bugfix: Allow individual API password or encryption keys for devices, resolves #174
* (DutchmanNL) Support ESPHome device Encryption Key (you should migrate from API password to Encryption Key ! resolves #152)

### 0.4.0 (2023-11-03)
* (DutchmanNL) Added cleanup capability for unused channels & states after initialisation of device, resolves #39
* (DutchmanNL) Added button to info channel which allows to delete all offline devices from adapter tree. resolves #39
* (DutchmanNL) Added cleanup capability for unused channels & states after initialization of a device, resolves #39
* (DutchmanNL) Added button to an info channel which allows to delete all offline devices from an adapter tree. resolves #39
* (DutchmanNL) [Breaking] Backup strategy changed, requires [BackitUp v2.9.1](https://github.com/simatec/ioBroker.backitup) and activate option for ESPHome, fixes #129

### 0.3.2 (2023-11-01)
* (DutchmanNL) Improved error handling if devices are not reachable/disconnected
* (DutchmanNL) Bugfix: Allow control of brightness and color for light component, resolves #173
* (DutchmanNL) Bugfix: Allow control of brightness and color for a light component, resolves #173

### 0.3.1 (2023-10-31)
* (DutchmanNL) Bugfix: Show online state of ESP Device correctly, resolves #106

### 0.3.0 (2023-10-31) - Bugfixes & Improvements
* (Dutchman & SimonFischer04) Several Bugfixes
* (SimonFischer04) Support type "select device"
* (DutchmanNL) ESPHome dashboard default disabled
* (SimonFischer04) Migrate to @2colors/esphome-native-api
* (DutchmanNL) Automatically create needed directories, resolves #168
* (SimonFischer04) Migrate usage of python to new structure, should solve all ESPHome Dashboard related installation issues

## License
MIT License

Expand Down
58 changes: 36 additions & 22 deletions admin/i18n/de/translations.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,38 @@
{
"API password": "Passwort",
"Add device manually": "Gerät manuell hinzufügen",
"Automatic device detection activated": "Automatische Geräteerkennung aktiviert",
"Close": "Schließen",
"Connected": "Verbunden",
"Delete": "Löschen",
"Devices can be added manually or by autodiscovery": "Geräte können manuell oder durch die automatische Erkennung hinzugefügt werden",
"ESPHomeDashboardEnabled": "Aktiviere das integrierte ESPHome-Dashboard",
"ESPHome_Dashboard_Generic_info": "Hier wird das von ioBroker bereitgestellt ESPHome-Dashboard aktiviert / deaktiviert. Eine separate Installation von ESPHome ist nicht erforderlich!",
"ESPHome_Dashboard_IP_info": "Bitte die IP-Adresse angeben, unter der sich das ESPHome-Dashboard befindet (ioBroker oder bereits vorhandene ESPHome Instanz).",
"Edit": "Bearbeiten",
"Edit device": "Gerät bearbeiten",
"ID": "ID",
"IP": "IP-Adresse",
"IP-Address": "IP-Adresse",
"Name": "Name",
"Show configuration as states": "Konfiguration als Zustände anzeigen",
"When Encryption Key is provided, API-Password will be ignored": "Wenn der Verschlüsselungsschlüssel bereitgestellt wird, wird das API-Passwort ignoriert",
"You can either choose to use the Device Encryption Key (preferred) or API-Password (legacy)": "Sie können entweder den Geräteverschlüsselungsschlüssel (bevorzugt) oder das API-Passwort (alt) verwenden.",
"device-pass": "Passwort",
"deviceEncryptionKey": "Geräteverschlüsselungsschlüssel (bevorzugt)",
"reconnect interval": "Intervall für erneutes Verbinden"
"ESPHomeCommunityLink": "Weitere Informationen zu ESPHome, Beispielkonfigurationen und Links zu Communities finden Sie unter:",
"chkEnableESPHome": "Aktivieren Sie das ESPHome-Dashboard",
"hlpDiscoveryListeningAddress": "Erkennen Sie nur Geräte auf dieser Schnittstelle",
"hlpInputApiPassword": "API-Passwort (alt, bitte Verschlüsselungsschlüssel verwenden!)",
"hlpInputDeviceIP": "Wählen Sie ein vorhandenes Gerät aus oder geben Sie die IP des neuen Geräts ein",
"hlpInputEncryptionKey": "Geben Sie einen gerätespezifischen Verschlüsselungsschlüssel an (bevorzugt)",
"introLine-1": "Mit ioBroker ESPHome können Sie ESPHome-fähige Geräte verwalten und steuern. Sie müssen diese Binärdateien selbst erstellen und hochladen!",
"introLine-2": "Zum Erstellen dieser Binärdateien ist ESPHome Dashboard erforderlich. ",
"lblApiPass": "API-Passwort (Legacy)",
"lblAutoDiscovery": "Geräteerkennung aktiviert",
"lblConnectDetails-Line-1": "Die native ESPHome-API wird für die direkte Kommunikation mit Clients über ein hochoptimiertes Netzwerkprotokoll verwendet. ",
"lblConnectDetails-Line-2": "Nachdem Sie Ihrer ESPHome-Konfiguration eine api:-Zeile hinzugefügt haben, können Sie zu dieser Seite gehen und warten, bis das ESPHome-Gerät im Abschnitt „Erkannte Geräte“ angezeigt wird (kann bis zu 5 Minuten dauern) oder das Gerät manuell hinzufügen, indem Sie „Gerät hinzufügen“ wählen. ",
"lblConnectDetails-Line-3": "Die native API von ESPHome basiert auf einem benutzerdefinierten TCP-Protokoll unter Verwendung von Protokollpuffern. ",
"lblConnectIobroker": "ioBroker kommuniziert direkt über die native API statt über MQTT, um Ihnen das bestmögliche Erlebnis und die Unterstützung von Verschlüsselungsschlüsseln (empfohlen) anstelle von API/MQTT-Passwörtern zu bieten",
"lblDashboardLink": "Um das ESPHome-Dashboard auf der Admin-Registerkarte von ioBroker anzuzeigen, müssen Sie die IP-Adresse angeben, auf der die Installation ausgeführt wird",
"lblDefaultCredentials": "Standard-API-/Verschlüsselungsschlüssel-Einstellungsgeräte (nicht empfohlen)",
"lblDefaultCredentials-Line-1": "Jedes Gerät sollte über einen eigenen eindeutigen Verschlüsselungsschlüssel (empfohlen) oder ein API-Passwort verfügen. Die Geräteerkennung (sofern aktiviert) erkennt alle Geräte und versucht, eine Verbindung mit den unten aufgeführten Anmeldeinformationen herzustellen",
"lblDefaultCredentials-Line-2": "Wenn Sie einen eindeutigen Verschlüsselungsschlüssel (empfohlen) oder ein API-Passwort zuweisen, werden neue Geräte auf der Registerkarte „Erkannte Geräte“ angezeigt (oder müssen hinzugefügt werden) und Sie müssen die eindeutigen Anmeldeinformationen manuell eingeben",
"lblDelDevice": "Gerät löschen",
"lblDevicesTable": "Alle aktuellen (bekannten) Geräte und deren Verbindungsstatus",
"lblDiscoveryListeningAddress": "Anhörungsadresse",
"lblESPHomeIP": "IP-Adresse, unter der ESPHome Dashboard zur Integration in ioBroker Admin ausgeführt wird",
"lblESPHomePort": "Port des ESPHome-Dashboards",
"lblEnableESPHome": "Sie können ESPHome Dashboard entweder separat ausführen oder die Option unten aktivieren, um es nativ in ioBroker auszuführen",
"lblEncryptionKey": "Standardverschlüsselungsschlüssel",
"lblHeaderConnect": "So verbinden Sie ein ESPHome-fähiges Gerät mit ioBroker",
"lblHeaderMainPage": "ESPHome Dashboard-Integration",
"lblIgnoreList": "IP-Adressen, die von der Geräteerkennung ausgeschlossen werden sollen",
"lblInputApiPassword": "API-Passwort",
"lblInputDeviceIP-content": "Geräte-IP-Adresse",
"lblInputEncryptionKey": "Verschlüsselungsschlüssel",
"lblLoadDevices": "Geräteübersicht aktualisieren",
"lblTxtNoButtonsIfNotActive": "Gerätetabelle und Schaltfläche HINZUFÜGEN/Löschen nur verfügbar, wenn der Adapter ausgeführt wird",
"lbl_addUpdateDevice": "Geräte hinzufügen/ändern",
"maxRetry": "Maximale Verbindungswiederholung, bevor das Gerät als offline betrachtet wird",
"reConInterval": "Einstellung zwischen ioBroker versucht, dieses Gerät erneut zu verbinden"
}
1 change: 1 addition & 0 deletions admin/i18n/dum/translations.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
Loading

0 comments on commit c49e054

Please sign in to comment.