Skip to content
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

timeout for ack... #522

Open
hallerdavid opened this issue Feb 28, 2024 · 7 comments
Open

timeout for ack... #522

hallerdavid opened this issue Feb 28, 2024 · 7 comments

Comments

@hallerdavid
Copy link

hallerdavid commented Feb 28, 2024

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.***"

image

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? :-)

@raintonr
Copy link
Collaborator

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!

@hallerdavid
Copy link
Author

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?

@raintonr
Copy link
Collaborator

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).

@raintonr
Copy link
Collaborator

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).

@servicemensch
Copy link

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“?

@raintonr
Copy link
Collaborator

But how about the idea to have a Adapter Setting „max Updates to Miniserver per second“?

Throttling updates to the Miniserver does sound plausible.

@raintonr
Copy link
Collaborator

Somewhat related to #399 (referencing here for the ideas in that).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants