openshwprojects / OpenBK7231T_App

Open source firmware (Tasmota/Esphome replacement) for BK7231T, BK7231N, BL2028N, T34, XR809, W800/W801, W600/W601, BL602 and LN882H
https://openbekeniot.github.io/webapp/devicesList.html
1.45k stars 271 forks source link

Inability to set MQTT QoS #750

Open chriskinal opened 1 year ago

chriskinal commented 1 year ago

Describe the bug A clear and concise description of what the bug is.

Firmware:

To Reproduce Steps to reproduce the behavior:

  1. Go to main menu on the device
  2. Click on 'Config'
  3. Click on 'Configure MQTT'
  4. No field to specify MQTT QoS.

On some networks it would be helpful to specify a higher QoS than the default setting of '0'. This would ensure subscribers such as Homeassistant stay in sync with the state of the device on less than ideal networks.

openshwprojects commented 1 year ago

Hello, I can easily add an access for that, maybe through a console command?

chriskinal commented 1 year ago

Either a console command or add it to the MQTT settings page. My preference would be the settings page so all MQTT settings are in one place and be easily reviewed or changed.

openshwprojects commented 1 year ago

Hmmm, from what I can see in the code, the publish QOS in our firmware seem to be 2. Is QOS 2 a good setting for you, or do you just need it configurable?

chriskinal commented 1 year ago

The two MQTT browsers I am using both show the QOS from the OBK devices as 0. I also checked with tcpdump and see the QOS is also 0. While QOS 2 certainly ensures 1 and only 1 copy of the message is received, it imposes some overhead. In a marginal network, this can slow the MQTT data transfers as the sender and receiver may end up waiting for "acks" that are lost.

I think having it configurable would allow one to try the different levels and measure the result. Then one can determine if the result meets their use case.