I have a home assistant instance that only deals with mtt (mqtt devices, mqtt commands).
if i run
mosquitto_publish -h <broker> -t "x/command" -m "{\"state\":\"ON\"}"
or
mosquitto_publish -h <broker> -t "x/command" -m "{\"state\":\"OFF\"}"
then the light turns on or off almost immediately (dims up/down fast in 1 second to full/no brightness)
I ran this 100 times with a script and got zero delay every time, so MQTT -> light -> MQTT works fine. I also see updates to topic x/state like
{"brightness":255,"state":"OFF"}
or
{"brightness":255,"state":"ON"}
The light is configured like this
- platform: mqtt_json
id: officelamp
name: Office Lamp
state_topic: service/nodered/officelamp/state
command_topic: service/nodered/officelamp/command
availability_topic: service/nodered/officelamp/connection
brightness: true
If I click on the home assistant interface on the button to turn the light ON or OFF, I see a publish in mqtt in about 15 seconds, the lights turns on immediately, then after about another 15 seconds the light is marked on
- 0 second
- click in homeassistant to turn on or off the light
- after ~15 seconds
- see a publish to /command with correct message
- see a publish to /state with correct message
- after ~ 30 seconds
- state updates in homeassistant
How do I debug this? Before a full system restart everything worked with zero issues and now everything seems laggy ( for example showing the about page, the area that shows errors takes a very long time to load )
Thank you for your time!