How to create channels when the thing uses separate mqtt topics to get and set status and returns json string? – #3 by ariznaf – Beginners

I am trying to integrate EQ3 Bluetooth TRV with openHab.

I have setup a tasmota ESP32 device with BLE enabled to connect to EQ3 valves.

But the implementation in tasmota uses MQTT topics like stat/<TasmotaDevice>/EQ3/<EQMACADD> to get the status, which returns a json string with all relevant information (setpoint temperature, opening of valve, etc).

For setting temperature, for example, you use cmnd/<TasmotaDevice>/EQ3/<EQMACADD>/settemp <tempval>” using just raw values.

When you send a command to the valve to set one value, it returns the complete set of values in the “stat” topic with the complete JSON set of values and containing error info.

I can get the values from eq3 valves in just one channel retrieving the status JSON value.
Then I can link items to it an use JSONPATH to extract the values from it.
But then I cannot change that values, as there is no place to introduce the comand MQTT topics.

You can use different channels for each value, giving different topics to get the value and set it.
But it seems quite inefective, as the valve will answer with the complete JSON with all the values of the status of the valve, from where you have to use JSONPATH to extract each value.
Doing it multiple times seems a waste of resources.

How is the best way to interact with this kind of devices?

Read more here: Source link