aderusha / HASwitchPlate

LCD touchscreen for Home Automation
MIT License
732 stars 128 forks source link

Too many MQTT messages. #33

Closed marciogranzotto closed 5 years ago

marciogranzotto commented 5 years ago

The idea of the project is great. However, it's very message intensive and that demands a lot of the broker. It's causing my broker to slow down for the rest of my devices.

I propose having a batch topic, that we could send one message containing several topics and values, much like the Tasmota Backlog command. A simple JSON would suffice, like so:

{
    "command": "dim=50",
    "command/page": 1,
    "command/p[1].b[4].txt": "Lamp On"
}
aderusha commented 5 years ago

This is an interesting idea and I'll look into it further. The latest release of the Arduino code + Home Assistant automations may resolve a lot of the MQTT traffic you're seeing, so I'd make sure you're running the latest automations and that will likely address your current problems.

Still, I think sending a JSON over with a set of commands it interesting and warrants further investigation. Thanks for the suggestion!

aderusha commented 5 years ago

This has been added in version 0.33 using a JSON array instead of objects, as key:value doesn't really make sense here. Documentation here.