Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add support for Hass device registry
Also small adjustment of
TOGGLE
type button to make it easier to use in automations.With support for device registry, entities will show up like this in Hass configuration UI:
![image](https://user-images.githubusercontent.com/14281572/49754298-fbe26b00-fcb5-11e8-87ed-5e781d6a56ee.png)
(Configuration -> Integrations -> MQTT)
Note1: Due to the very long announcement message,
setoption55
must be set to 1, otherwise device registry data is not announced.Note 2: With support for device registry it is mandatory to define a unique ID (for example: MAC address, serial number etc) to identify the entities and devices. For Tasmota, MAC is the perfect choice and that's what's used in this PR. To not confuse Hass and create duplicated entities, the unique ID is now also used as a base for object id in the discovery messages.
This is a change from before, when topic was instead used a a base for the object id.
This means previously retained discovery messages must be manually cleared from the MQTT server!