OpenBK7231T_App icon indicating copy to clipboard operation
OpenBK7231T_App copied to clipboard

Home assistant auto setup

Open brandondb1 opened this issue 2 years ago • 6 comments

Hello,

As you know the MQTT built into Home Assistant has pretty strong auto setup abilities. Although Tasmota has gone away from this to their own integration, I have maintained a custom version of Tasmota meant to work with the MQTT integration.

Although I am not a great programmer by any stretch, I understand the Home Assistant MQTT auto setup quite well and could help if someone wanted to try and extend the MQTT in that direction.

I also saw that someone was asking about Domoticz - there is a Home Assistant MQTT plugin for Domoticz that uses the same autosetup protocols (and one for OpenHab too), so working on the auto setup for Home Assistant MQTT could provide an easy path to setting up in all three systems.

brandondb1 avatar Apr 26 '22 15:04 brandondb1

It would also be an option, to build a home assistant integration, like tasmota did that recognizes ObenBeken devices.

LuisThe0ne avatar Jun 19 '22 13:06 LuisThe0ne

Is there an advantage to a custom integration? Wouldn't it be better to work by default in the way the OP suggests?

TurkeyMan avatar Jun 27 '22 10:06 TurkeyMan

One way I considered doing this was to store the template on the device, but construct it in the webapp. In this way, the webapp can be quite sophisticated in the way the template is constructed, without loads of hard coded stuff in the firmware. (I did some TAS MQTT stuff in the past - BLE, for example - and it seems pretty nasty to have hand coded up json in the source code....). The devices (not sure about all processors) have a filesystem available, within which we can store generic files. So to serve them over the MQTT should be very easy, and the webapp can be used to create specific HA templates with much easier to program Javascript.

btsimonh avatar Jun 27 '22 17:06 btsimonh

If you're using MQTT anyway can't you just store things like this in a retained message?

belikh avatar Jul 05 '22 03:07 belikh

is it possible to use Home Assistant MQTT Discovery? as per documentation it is probably pretty simple: https://www.home-assistant.io/docs/mqtt/discovery/

Mordevolt avatar Jul 08 '22 12:07 Mordevolt

It is quite simple to use the Hass matt autosetup...just need to publish a JSON with the right info in it, to the right topic.

brandondb1 avatar Jul 08 '22 15:07 brandondb1

@openshwprojects I am trying to implement this but cannot locate cJSON implementation in Tuya SDK. There are a bunch of header files under sdk\include but no implementation?

iprak avatar Sep 03 '22 11:09 iprak

@iprak basically nailed it, good job, discovery seems to be working.

https://github.com/openshwprojects/OpenBK7231T_App/pull/183

More to come soon.

openshwprojects avatar Oct 02 '22 14:10 openshwprojects