timeout for ack...
hallerdavid opened this issue · 7 comments
I have a few scripts, this scripts reads some values and push that to virtual inputs in Loxone.
The values are availbale in loxone without problems, but in the Log there are many entries like "Timeout for ack loxone.0.***"
This is one of the scripts:
on({ id: 'mqtt.0.tele.eg_tv_wohnzimmer_tasmota.SENSOR', change: 'ne' }, function (obj) {
const jsonData = JSON.parse(obj.state.val);
const powerValue = jsonData.ENERGY.Power;
setState("loxone.0.169dc8ab-01b7-4045-ffff80f3f492c728.value",powerValue);
});
Can you help me to ignore or fix this warnings? :-)
That's a bit suspicious. Unless you are flooding the Miniserver with updates it really shouldn't timeout often.
You could try changing this to a higher value (like 2000ms or something): build/main.js:const ackTimeoutMs = 500;
FWIW, if you use on
like that you will have problems if the source state changes while Loxone is offline/rebooting/updating config/etc. because when Loxone comes back online the Loxone state (your destination) will be set from the value Loxone last had and thus overwrite any changes from the source while it was offline. For this reason I have a handler that keeps a list of source -> destination states that go to Loxone and when Loxone comes online sets all the destination states just to be sure. There really should be a way to handle this in the adapter, but that's another story!
Thanks for your reply. Can you help me how to expand my script to a higher ack timeout?
I don´t care about lost values. 99,9% of them are power states from smart plugs or the photovoltaik on the roof or something. So they have lots of changes in a minute and if there is an old state, it would update fast enough :-) but i know what you think... :-)
and yes, maybe the timeouts are since i send a lot of values from the three power lines to loxone... :-D but i think it shouldnt be a problem because the values are all set correctly? :-) or there are some not set correctly but then i can ignore because the next one is correct... Maybe there is a way to update just every 2 seconds or something instead of every value?
Thanks for your reply. Can you help me how to expand my script to a higher ack timeout?
Yes. Edit build/main.js
(on a Linux system the full path is typically /opt/iobroker/node_modules/iobroker.loxone/build/main.js
) and change const ackTimeoutMs = 500;
to some number higher (like 2000).
Maybe there is a way to update just every 2 seconds or something instead of every value?
Yes... that is exactly what you should do in the case of fast changing states and is easy to do with a timer in your script. Or TBH, if your IoB installation is being flooded with many updates perhaps you should raise an issue with the source adapter and ask that it throttle updates (always better to go to the source).
I‘m experiencing the same warnings. My script is updating about 15 virtual Inputs in bulk (50ms) every 5 minutes.
Now adapted my script to delay the update of the virtual inputs. Will monitor of tis improves the Situation..
But how about the idea to have a Adapter Setting „max Updates to Miniserver per second“?
But how about the idea to have a Adapter Setting „max Updates to Miniserver per second“?
Throttling updates to the Miniserver does sound plausible.