ioBroker / ioBroker.node-red

Instantiate the server with node-red
Apache License 2.0
52 stars 27 forks source link

iobroker- In Nodes - block unless value change by more than .. doesn't work #293

Closed mickym2 closed 2 years ago

mickym2 commented 2 years ago

There is currently a problem - when a value has changed - the changed value is sent 5 times. (regardless which rbe setting is set).

image

This error occurs even in version 3.0.0 It looks - like the message was created by 5 different nodes. I marked them in different colors in the screen shot.

EDIT: This problem cannot be reproduced - so I changed title.

Apollon77 commented 2 years ago

Please try Github version. On one hand I preventd subscriping for state changes multiple times for same node.id .. (just to be sure). And I log the initialization of in nodes ... enable debug log please

mickym2 commented 2 years ago

This version does not run at all: current debug log.txt

image

mickym2 commented 2 years ago

In addition - the value input when value changes more than (ignore initial value) is missing: screen

mickym2 commented 2 years ago

So original error cannot be followed up, as it can't be reproduced. However the all versions when value changes more than - are not working - so I will change the topic in the title.

Apollon77 commented 2 years ago

Both shopud be fixed (the missing number field was also broken before)

mickym2 commented 2 years ago

Ok - much better - but not completely fixed. I have to follow up later.

Apollon77 commented 2 years ago

alright ... a debug log would be interesting

mickym2 commented 2 years ago

Here is the log - current debug log.txt

First problem is restart of the adapter and msg at start is selected:

image

  1. Adapter start The initial value ignored when value changed behaves correct (no msg). The initial value ignored when value changed by xx - sends a msg, which should not the case.

  2. Only Update so only update value - without changing. The node which should send a msg when value changes more than xx - completely failed. Should send nothing at this stage.

screen

  1. Value changes by 2 (in the last nodes more than 5 is specified) - so this fails as well:

image screen2

None of these action is logged - so make no sense to post the log again.

So in my opinion - the value changes by more than xx cases must be implemented - the value changes cases work correct on the first point of view.

If I restart the flow - but do not restart the adapter the initialisation of the log looks a little bit different: current debug log.txt

Apollon77 commented 2 years ago

Ok, I do not get it ... Please try GitHub version. This version now uses "node.log to log all "logic stuff" per node ... mybe this brings some light. It should log when value is pre-initialized and also for rbe/deadband logic when it is executed and with which values

mickym2 commented 2 years ago

So there is no change in the behavior of the nodes. I tested change value with a fixed value - i.e. 5 and also with a percentage like 10%. In the log I see the comparison between old and new - but I do not see any reference to the value which defines the deadband, current debug log.txt

Apollon77 commented 2 years ago

The log schould not be in the iobroker log but "with the nodes" .. ok I can also move into iobroker log if easier? Just tell (und wieder deutsch?) :-)

Apollon77 commented 2 years ago

PS: Aaaahhh ok werte auch da drin geloggt ... ok

Apollon77 commented 2 years ago

ALso wenn "Deadband" log "false" sagt dann wird nichts getriggert!

Apollon77 commented 2 years ago

Ok, lass mich log nochmal erweitern um ID und bei deadband um das limit

Apollon77 commented 2 years ago

More logging added

mickym2 commented 2 years ago

OK und bislang wurde Nachrichten erzeugt – egal ob Deadband false oder nicht – Ich hatte bislang noch keinen Fall wo keine Nachricht erzeugt wird. Selbst unveränderte Werte werden nicht geblockt bei diesem Deadband.

Gesendet von Mail für Windows

Von: Ingo Fischer Gesendet: Mittwoch, 23. März 2022 22:09 An: ioBroker/ioBroker.node-red Cc: mickym2; Author Betreff: Re: [ioBroker/ioBroker.node-red] iobroker- In Nodes - block unlessvalue change by more than .. doesn't work (Issue #293)

Ok, lass mich log nochmal erweitern um ID und bei deadband um das limit — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

mickym2 commented 2 years ago

Ok - only FYI - all deadband checks are not working - even when value is unchanged - those nodes send messages. - So I have to install the next version. ;)

Apollon77 commented 2 years ago

Ooohh... wait i think I found the error!!!!

Apollon77 commented 2 years ago

Try github again ... BTW: If it works now then deadband NEVER worked before. The comparism was wrong and I did not changed anything there

mickym2 commented 2 years ago

May be this hasn't been used so much ... - but then it is even better if we eliminate those bugs as well - I am installing. ...

mickym2 commented 2 years ago

Looks much better - still testing ... :)

mickym2 commented 2 years ago

Currently I have somehow a deadlock situation. This happened during the test sometimes. I restarted the flows - and only update a topic with the same value - but get no more a connection to the in Nodes.

I refreshed browser. Nothing happens. After restarting the adapter - it works again.

So it looks good now - even if I am not sure - if everything has been tested.

One problem could probably checked before deploy. So if no value is specified when option if value changed by xx - the node accept this, instead blocking a deploy. May be an input check would help.

The description as it working now - should be changed into

block until changes will by more or equal than current debug log.txt

So you did a fantastic job now. The only thing what creates a little headache are these situations when I had to restart the adapter - as the iobroker-In Nodes were disconnected. However - it might be that it will not happen, when there is not a lot of installations in the system. Same as yesterday - I do not know how this could happen - today this error never occurs again.

And I guess for some it would be confusing - at least when no msg at start - that the nodes behave different the first and second time - but it is logical as it is working now.

mickym2 commented 2 years ago

So in summary - but not knowing if all is tested

  1. The general problem is fixed-
  2. Check that in the deadband configuration a value or percentage is specified
  3. description as it works now screen2
Apollon77 commented 2 years ago

May be an input check would help.

Honestly ... no idea how to do that ... need to read into it ... please create an extra issue. will check when time

text change ... block until changes will by more or equal than

Done on GitHub ... https://github.com/ioBroker/ioBroker.node-red/commit/bf3ca8a81dd836fabeb735df39af7b2d4f4e42b4

Ok???

Then I remove the logging for the value changes and we are done

mickym2 commented 2 years ago

Ok - so go ahead with this version