Update state in Home Assistant

Hi everyone, these days I am experimenting with OpenMQTTGateway with a Nodemcu and an outlet 433.
Everything works correctly, but I can’t get the updated status on HA when I use the remote control of the socket, it updates only when I use the button on HA.
My configuration is:

  - platform: mqtt
    name: MQTTto433
    state_topic: "home/OpenMQTTGateway_ESP8266_RF/433toMQTT"
    command_topic: "home/OpenMQTTGateway_ESP8266_RF/commands/MQTTto433"
    payload_on: "5326167"
    payload_off: "5326164"
    optimistic: false
    qos: "0"
    retain: true
    availability_topic: "home/OpenMQTTGateway_ESP8266_RF/LWT"
    payload_available: "online"
    payload_not_available: "offline"

I would also like to disable Autodiscovery completely. To do this I deleted the line ‘-DZmqttDiscovery = “HADiscovery”’ in the Platformio.imi file, but observing the mqtt traffic all homeassistant / … topics are still generated

Sorry for my english :-\

I found the problem! I forgot to define the value_template to extract the “value” from the string received in mqtt;

I added

value_template: "{{value_json.value}}"
optimistic: true

and now using the HA interface OR the remote control I always have the updated status! Great project!

The question remains that even if I delete the line I said above, I cannot deactivate auto discovery

Nice !

Could you verify that ZmqttDiscovery is not set in another place in your files ?

I had probably changed something by mistake. I downloaded the project again, commented on the line ‘-DZmqttDiscovery = “HADiscovery”’… and added a DHT22 sensor. Everything works perfectly without auto discovery. Thanks for the fantastic project!