-
-
Notifications
You must be signed in to change notification settings - Fork 190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Arc sending too many MQTT messages #88
Comments
These are messages from Home-Assistant, so not sure why this would be labeled a bug. |
FYI:
|
The actual question is how many is too much. It really depends on the automation system I guess. |
Is the 0,1 degree interval needed for what i expect is an ambient temperature setting ? |
The system in our house works at 0,1 intervals, 0,5 is too much here. A 0,3 degree temperature rising increases comfort significantly, 0,5 is too much. But all this is less relevant, there are a plethora of cases when one would use an arc or a slider with a 200 value-range. |
My Home Assistant and MQTT server instance is running on an HP DL380 server in a VM provisioned with 8GB of ram and connected to the network at 4x1Gbit LACP, and WiFi is provided by an UniFi system. So that's not the bottleneck. I would rather think that the ESP-WROOM's WiFi connectivity is maxed during these peaks. I think we should approach it differently. It doesn't really worth sending updates on MQTT when moving the slider handle based on the value change, instead it should be considered to send the updates based on a timer. Say, every 200ms should be enough. One might drag the handle slow, somebody else may drag is fast, the result should be the same in the end, send the last message when the handle stopped moving. If somebody will use a slider with In my log above at 22:35:26 Home Assistant filled 17 automation start attempts and I was moving the slider slowly during 1 second. This is way too much and causes useless load and lag behind, elasticness like htvekov mentioned. |
I commented my mode setting because otherwise the error message is suppressed from the log. Forgot to mention that even with |
Github labels these automatically, it was not me who puts this label on. I don't have permission to change labels afterwards. |
Strange indeed... In general I don't think that ESP speed is the bottleneck here. HA actually got all the MQTT messages nicely, but is so slow processing even your simple automation that it ends up logging 19 attempts to finish automation. As I said, I didn't experience any special lag issues with my cross plates volume slider update (100 values range) On the active plate indeed there are real lag issues updating value_str on same object (or a different object on same page). Looks like all inbound mqtt messages are buffered and not processed while hasp-lvgl is busy with arc/slider object changes ? EDIT: I'm currently at 0.4.0 dev dated 090321. Not that i believe it makes any difference. |
My goal would be to place a Lanbon in each room and offer temperature setting there. So I wouldn't need to display real time the arch value change on other screens, just on the one being handled. |
If you dap along the arc very quickly you'll get instant |
I have 100% identical experience with my volume slider |
I don't think this is OK. |
We'll have to see what @fvanroie has to say on the subject. I would call this an unintended design flaw, not showing up until now. Best solution was if hasp-lvgl code could handle this internally. Update objects Second best solution was to deal with the mqtt delays for inbound messages to active plate page. |
Agree. And an option to only send a single MQTT message when movement ended. |
Btw. how the hell did you manage to find and upload a working .zi fontfile ? As .zi font support currently is flawed and needs to be corrected when our 'one man army' @fvanroie at some point finds the time to check this as well. |
Believe me, so would I. |
Hasp-lvgl is conceptually a lvgl front-end over mqtt. Everything is implemented as a wrapper around lvgl objects, functions, features... with a mqtt command set. Anything that doesn't fit that concept is deemed to be an off-device feature, typically handled by home-automation software. We try not to pose limits any on what can be done, what you do with the exposed commands depends on the use case and user. If lvgl sends 100 value updates while dragging a slider, you will get 100 mqtt updates. This doesn't mean it's a good idea to send 100 values back to the device though... At this stage I'm still implementing the basic feature set. So adding mqtt message throttling is not high up on the list, since it can be done off-device too. |
I see your point but look practically. There's no easy way to decide on the other side what not to send back to the device to do some throttling as the end is unknown there. There's nowhere to know in advance when was the handle released and know which was the last message... so we could ignore the rest in between... In HA Automation Modes can't handle this. This will mostly make it usable exclusively with https://github.com/dgomes/hasp-lvgl-custom-component/ since these things can only be handled at lower level. |
Hi' @fvanroie The main issue is not really the extensive amount of MQTT messages. HA could easily just do restart mode, if flooded with more MQTT messages than possible to process. Or keep track of time delta between messages or use other means to diminish the abundance of MQTT messages. If new MQTT message arrives at HA from same button but with new value, then HA should just abort and restart as data is already obsolete. The real issue here is that hasp-lvgl doesn't seem to process any inbound MQTT messages for active plate (or at all ?) as long as an object is actively pressed or pulled. So no matter how few MQTT messages are returned to hasp, hasp doesn't process these before object button is released -> hence no 'on the fly' eg. I guess this is most likely by design to avoid MQTT message queue issues (inbound/outbound collisions). But I agree with you priorities. Core basic features first ! Ciao ! |
We could functionally separate the needs. For example we could avoid this behavior with a workaround: if we had In this example |
Feel free to test this feature branch. If OK I'll merge it in master. |
It's OK on my Lanbon L8 thank you! |
Seems stable enough 👍 I've had so many issues last couple of days testing more that 10 builds across 4 different plates with 3 different display hw setups. Main worry was that all plates at some point froze and just stopped sending mqtt messages completely. Really have no idea what happened ? Perhaps a small memory leak somewhere, triggered by the many, many hundreds in- /out bound mqtt messages in only minutes when testing arc/slider ? But now I'll stick with this latest build for a couple of days to test reliability in my environment. My general mqtt broker load is also now below 160 (recieved) messages/minut. Under previous testing it hit some 500+ recieved messages/minut - easily.... 🤯 The mqtt throttling seems to work perfectly. And on top of this the 'event up' message for sliders/arcs - what's not to like 😉 Thanks !! |
Create a page like this:
(don't forget to adjust font sizes to values supported by your build)
Create an automation in Home Assistant to update values:
Try to move the handle of the arc, relatively fast, to about 50%. You'll notice how slow the value updates in the middle.
The reason is that MQTT is flooded with a lot of messages, and Home Assistant tries to process all of them:
Of course if we use a smaller interval for arc, like
"min":15,"max":35
messages will be much fewer, but that's not acceptable because of #81.The text was updated successfully, but these errors were encountered: