NorthernMan54 / homebridge-tasmota

Plugin for Tasmota devices leveraging Home Assistant auto discovery
Apache License 2.0
35 stars 9 forks source link

Support Tasmota integration (default) discovery protocol `setOption19 0` #36

Open DominikPalo opened 3 years ago

DominikPalo commented 3 years ago

Is your feature request related to a problem? Please describe:

The new HA Tasmota integration https://www.home-assistant.io/integrations/tasmota/ (which is now a preferred way to integrate Tasmota devices with HA) requires a "Tasmota integration (default)" HA discovery protocol to be set on all devices (see https://www.home-assistant.io/integrations/tasmota/#requirements). Therefore I had to reconfigure all my devices to use it (by setting setOption19 0).

But the homebridge-tasmota plugin supports only the "MQTT discovery" protocol ("Please ensure that your Tasmota device has HASS Auto Discovey enabled ( setOption19 1 )").

Due to these contradictory requirements, I can't use both projects/integrations at the same time. So, it would be great to support also the default discovery protocol (not sure how that mode works over MQTT, but the HA Tasmota integration I've mentioned was able to automatically discover all my Tasmota devices, so it is technically possible).

UPDATE:

I've just checked the Tasmota documentation and it seems that Tasmota setOption19 0 now behaves differently compared to the older versions of Tasmota - I found an older revision of the Tasmota documentation, where the command is explained as:

SetOption19 | Home Assistant automatic discovery. 0 = disabled (default) 1 = enabled and also sets SetOption59 1 If you enable and then disable SetOption19, doing so does not set SetOption59= 0 and does not revert to default %prefix%/%topic%/ FullTopic

But it is explained differently in newer versions:

SetOption19 | Set Home Assistant discovery protocol. 0 = use Tasmota integration (default) 1 = use MQTT discovery

See: https://github.com/tasmota/docs/commit/ec11f0f0668f85ed3092747a1f249645c948f99a#diff-13483592b824255998c18c26ba13d15aaa8cf9aac19d0135e07000204a0cbaab

So, it is no longer about enabling/disabling the auto-discover functionality, it is now used to choose a discovery protocol... maybe @arendst or @blakadder could explain more

blakadder commented 3 years ago

What exactly do you need explaining on?

It would be up to this project to follow the not so recent changes to Tasmota and MQTT discovery.

NorthernMan54 commented 3 years ago

@DominikPalo I have been watching the development of that new device discovery method for the last year, and at the present time I have not started exploring adding this functionality. As the change is fundamental to the existing plugin design/approach, I would expect to require an almost total re-write of the plugin. Which is a significant effort. Why not just rollback your version of home assistant?

tablatronix commented 2 years ago

Could you add a way to manually add devices instead? Or is it possible to pull them in from HA or an HA plugin?

NorthernMan54 commented 2 years ago

The homebridge-mqttthing plugin is for devices you want to manually add