Announcement

Collapse
No announcement yet.

Node-red gives double update bug.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Eki
    replied
    I know this is an older thread, but was it ever fixed?

    I have the same issue with a virtual object in HS4 sending web hooks to node-red. I get duplicate web hook messages for a property change. The messages are otherwise identical, except the ref id is different, so it looks like duplicate messages are being created.

    When I look in HS4 log, I see no dupes

    I fixed it with the "filter" node in node-red, but that is more of a hack than a solution.

    Thanks

    Erik

    Leave a comment:


  • Malosa
    replied
    kenm

    well here is an update,
    it still doesnt work.
    only work sometimes sadly.

    regards



    Code:
    1/26/2020, 10:02:28 AM[URL="http://192.168.1.12:1880/#"]node: testoutput[/URL]msg.payload : Object
    objectref: 6423
    name: "Live bruto power produce"
    location: "Malosa"
    location2: "GROWATT"
    value: 168.5
    status: "168.5 "
    last_change: "/Date(1606381363681+0100)/"
    
    
    11/26/2020, 10:06:55 AM[URL="http://192.168.1.12:1880/#"]node: 93238ca6.d6496[/URL]msg : string[24]
    "Creating handler for all"
    
    11/26/2020, 10:07:28 AM[URL="http://192.168.1.12:1880/#"]node: testoutput[/URL]
    
    
    msg.payload : Object
    object
    ref: 6423
    
    name: "Live bruto power produce"
    
    location: "Malosa"
    
    location2: "GROWATT"
    
    value: 212
    
    status: "168.5 "
    
    
    last_change: "/Date(1606381663640+0100)/"

    Leave a comment:


  • Malosa
    replied
    Originally posted by kenm View Post
    Malosa Sorry for jumping into this late but I think I can see the root of the problem you are having. It's in your script calls.

    Instead of this:

    Code:
    Dim Ref
    Ref = hs.GetDeviceRef("PWR-YDAY-GAS")
    hs.SetDeviceValueByRef(Ref, data, True)
    hs.SetDeviceString(Ref, data, True)
    Try this:

    Code:
    Dim Ref
    Ref = hs.GetDeviceRef("PWR-YDAY-GAS")
    hs.SetDeviceString(Ref, data, False)
    hs.SetDeviceValueByRef(Ref, data, True)
    What your script is currently doing is triggering a "last change' twice by having the third parameter of both calls set to "True".

    EDIT: I found something else interesting. The webhook will only report a change IF the string or value changes, even with "last change" set to "True". However, correctly, it will not report a change when "last change" is set to "False", even if the string or value changes.

    Hope this helps,
    Ken
    sorry for the late reply,
    well i must say u right about the script issue, indeed setting one of them to false solve the issue,
    but the one with some plugins remain, i will ask dev to change the double change.

    many thanks for that.

    Leave a comment:


  • kenm
    replied
    Malosa Sorry for jumping into this late but I think I can see the root of the problem you are having. It's in your script calls.

    Instead of this:

    Code:
    Dim Ref
    Ref = hs.GetDeviceRef("PWR-YDAY-GAS")
    hs.SetDeviceValueByRef(Ref, data, True)
    hs.SetDeviceString(Ref, data, True)
    Try this:

    Code:
    Dim Ref
    Ref = hs.GetDeviceRef("PWR-YDAY-GAS")
    hs.SetDeviceString(Ref, data, False)
    hs.SetDeviceValueByRef(Ref, data, True)
    What your script is currently doing is triggering a "last change' twice by having the third parameter of both calls set to "True".

    EDIT: I found something else interesting. The webhook will only report a change IF the string or value changes, even with "last change" set to "True". However, correctly, it will not report a change when "last change" is set to "False", even if the string or value changes.

    Hope this helps,
    Ken

    Leave a comment:


  • Malosa
    replied
    Originally posted by Eman View Post
    Now I know. There should not be any problems because the HomeSeer nodes also report status!

    Try to add a few of them extra and check...?

    It would sound weird but it's like they receive the data from the script and they acknowledge then they pass it on.

    You are the first one I saw who has got your HS device nodes before the Change nodes (because you are collecting data to feed into grafana)


    Eman
    maybe thats the case nobody reported that issue i have.
    yeah i wanted full status on grafana so i can track everything.
    I have atleast 40 devices doing that every second. but like you seen some of them report double but not in grafana.

    for now i solved the double data in influx/grafana with that node mentioned by ksum, and it works good for me.
    that other double data i don't care its only logging, but i will care if its get instable when i gonna add all my other devices, but we will see.

    i'm very happy with the integration of node-red in homeseer, it solve a lot of problems so i can finally track everything

    Leave a comment:


  • Eman
    replied
    Now I know. There should not be any problems because the HomeSeer nodes also report status!

    Try to add a few of them extra and check...?

    It would sound weird but it's like they receive the data from the script and they acknowledge then they pass it on.

    You are the first one I saw who has got your HS device nodes before the Change nodes (because you are collecting data to feed into grafana)


    Eman

    Leave a comment:


  • Malosa
    replied
    Gas live day total gives me only 1 x value with the throttle node, that was the one giving double status on influxdb i solved that with the throttle node instead of RBE.

    While the rest almost all give 2x value in th windows debug screen and not node-red and in influx db.


    1.Some devices are reporting double payload because of the delay of value-string in Node-Red
    2.Some devices not reporting double payload in Node-Red but in the windows console window, while not connected to any debug line.


    I'm very sure homeseer need to fix the webhook,and delay it with 1 ms, i see when a value and status change its faster updated in node-red than homeseer self.
    i don;t think it causes stability issue's.



    here my list of some double items, u see some devices update double because 1 value did delay while update,
    but some of them not.

    The temperature sensors are MQTT
    some of them in the list below are virtual devices and plugin of plugwise.
    this is the list of only the power management and temperature from past 10 seconds

    regards

    Code:
     ref: 5689,
    name: 'Temperature',
    location: 'Kitchen',
    location2: 'Temperature',
    value: 17,
    status: '17°C',
    last_change: '/Date(1604041893743+0100)/'
    }
    device update:
    {
    ref: 5904,
    name: 'Watts',
    location: 'Zolder',
    location2: 'Plugwise Device',
    value: 0,
    status: '0 Watts',
    last_change: '/Date(1604041896793+0100)/'
    }
    device update:
    {
    ref: 5998,
    name: 'Electricity consumed (current)',
    location: 'Zolder',
    location2: 'Plugwise Smile',
    value: 409,
    status: '409 Watts',
    last_change: '/Date(1604041899421+0100)/'
    }
    device update:
    {
    ref: 5998,
    name: 'Electricity consumed (current)',
    location: 'Zolder',
    location2: 'Plugwise Smile',
    value: 409,
    status: '409 Watts',
    last_change: '/Date(1604041899421+0100)/'
    }
    device update:
    {
    ref: 5904,
    name: 'Watts',
    location: 'Zolder',
    location2: 'Plugwise Device',
    value: 0.266559463246038,
    status: '0 Watts',
    last_change: '/Date(1604041900842+0100)/'
    }
    device update:
    {
    ref: 5998,
    name: 'Electricity consumed (current)',
    location: 'Zolder',
    location2: 'Plugwise Smile',
    value: 398,
    status: '398 Watts',
    last_change: '/Date(1604041905185+0100)/'
    }
    device update:
    {
    ref: 5998,
    name: 'Electricity consumed (current)',
    location: 'Zolder',
    location2: 'Plugwise Smile',
    value: 398,
    status: '398 Watts',
    last_change: '/Date(1604041905185+0100)/'
    }
    device update:
    {
    ref: 5904,
    name: 'Watts',
    location: 'Zolder',
    location2: 'Plugwise Device',
    value: 0,
    status: '0 Watts',
    last_change: '/Date(1604041908920+0100)/'
    }
    device update:
    {
    ref: 5992,
    name: 'Peak electricity consumed (total)',
    location: 'Zolder',
    location2: 'Plugwise Smile',
    value: 1670.436,
    status: '1670.436 kW Hours',
    last_change: '/Date(1604041916613+0100)/'
    }
    device update:
    {
    ref: 5992,
    name: 'Peak electricity consumed (total)',
    location: 'Zolder',
    location2: 'Plugwise Smile',
    value: 1670.436,
    status: '1670.436 kW Hours',
    last_change: '/Date(1604041916613+0100)/'
    }
    device update:
    {
    ref: 5998,
    name: 'Electricity consumed (current)',
    location: 'Zolder',
    location2: 'Plugwise Smile',
    value: 402,
    status: '402 Watts',
    last_change: '/Date(1604041916670+0100)/'
    }
    device update:
    {
    ref: 5998,
    name: 'Electricity consumed (current)',
    location: 'Zolder',
    location2: 'Plugwise Smile',
    value: 402,
    status: '402 Watts',
    last_change: '/Date(1604041916670+0100)/'
    }
    device update:
    {
    ref: 6001,
    name: 'Gas consumed (total)',
    location: 'Zolder',
    location2: 'Plugwise Smile',
    value: 2052,
    status: '2052 m3',
    last_change: '/Date(1604041916709+0100)/'
    }
    device update:
    {
    ref: 6001,
    name: 'Gas consumed (total)',
    location: 'Zolder',
    location2: 'Plugwise Smile',
    value: 2052,
    status: '2052 m3',
    last_change: '/Date(1604041916709+0100)/'
    }
    runEvent id=142
    device update:
    {
    ref: 3972,
    name: 'Live Gas Hour',
    location: 'Gas Total',
    location2: 'Gas Check',
    value: 0.04,
    status: '0.032',
    last_change: '/Date(1604041916741+0100)/'
    }
    device update:
    {
    ref: 3972,
    name: 'Live Gas Hour',
    location: 'Gas Total',
    location2: 'Gas Check',
    value: 0.04,
    status: '0.04',
    last_change: '/Date(1604041916751+0100)/'
    }
    device update:
    {
    ref: 3973,
    name: 'Live Gas Consumed Hour',
    location: 'Gas Total',
    location2: 'Gas Check',
    value: 0.752,
    status: '0.712',
    last_change: '/Date(1604041916769+0100)/'
    }
    device update:
    {
    ref: 3973,
    name: 'Live Gas Consumed Hour',
    location: 'Gas Total',
    location2: 'Gas Check',
    value: 0.752,
    status: '0.712',
    last_change: '/Date(1604041916769+0100)/'
    }
    device update:
    {
    ref: 3973,
    name: 'Live Gas Consumed Hour',
    location: 'Gas Total',
    location2: 'Gas Check',
    value: 0.752,
    status: '0.752',
    last_change: '/Date(1604041916771+0100)/'
    }
    device update:
    {
    ref: 3973,
    name: 'Live Gas Consumed Hour',
    location: 'Gas Total',
    location2: 'Gas Check',
    value: 0.752,
    status: '0.752',
    last_change: '/Date(1604041916771+0100)/'
    }
    device update:
    {
    ref: 3974,
    name: 'Live Gas Cost',
    location: 'Gas Total',
    location2: 'Gas Check',
    value: 0.49,
    status: '0.46 €',
    last_change: '/Date(1604041916799+0100)/'
    }
    device update:
    {
    ref: 3974,
    name: 'Live Gas Cost',
    location: 'Gas Total',
    location2: 'Gas Check',
    value: 0.49,
    status: '0.49 €',
    last_change: '/Date(1604041916801+0100)/'
    }
    device update:
    {
    ref: 5904,
    name: 'Watts',
    location: 'Zolder',
    location2: 'Plugwise Device',
    value: 0.266559463246038,
    status: '0 Watts',
    last_change: '/Date(1604041917032+0100)/'
    }
    device update:
    {
    ref: 5904,
    name: 'Watts',
    location: 'Zolder',
    location2: 'Plugwise Device',
    value: 0,
    status: '0 Watts',
    last_change: '/Date(1604041925132+0100)/'
    }
    device update:
    {
    ref: 5904,
    name: 'Watts',
    location: 'Zolder',
    location2: 'Plugwise Device',
    value: 0.266559463246038,
    status: '0 Watts',
    last_change: '/Date(1604041933403+0100)/'
    }
    device update:
    {
    ref: 5904,
    name: 'Watts',
    location: 'Zolder',
    location2: 'Plugwise Device',
    value: 0,
    status: '0 Watts',
    last_change: '/Date(1604041941559+0100)/'
    }
    device update:
    {
    ref: 5904,
    name: 'Watts',
    location: 'Zolder',
    location2: 'Plugwise Device',
    value: 0.266559463246038,
    status: '0 Watts',
    last_change: '/Date(1604041945611+0100)/'
    }
    device update:
    {
    ref: 5904,
    name: 'Watts',
    location: 'Zolder',
    location2: 'Plugwise Device',
    value: 0,
    status: '0 Watts',
    last_change: '/Date(1604041953717+0100)/'
    }
    device update:
    {
    ref: 5816,
    name: 'Humidity',
    location: 'Carlito bedroom',
    location2: 'Humidity',
    value: 52,
    status: '52%',
    last_change: '/Date(1604041955859+0100)/'
    }
    device update:
    {
    ref: 5811,
    name: 'Temperature',
    location: 'Carlito bedroom',
    location2: 'Temperature',
    value: 19,
    status: '19°C',
    last_change: '/Date(1604041955880+0100)/'
    }
    device update:
    {
    ref: 5816,
    name: 'Humidity',
    location: 'Carlito bedroom',
    location2: 'Humidity',
    value: 53,
    status: '53%',
    last_change: '/Date(1604041958352+0100)/'
    }
    device update:
    {
    ref: 5811,
    name: 'Temperature',
    location: 'Carlito bedroom',
    location2: 'Temperature',
    value: 20,
    status: '20°C',
    last_change: '/Date(1604041958369+0100)/'
    }
    device update:
    {
    ref: 5904,
    name: 'Watts',
    location: 'Zolder',
    location2: 'Plugwise Device',
    value: 0.266559463246038,
    status: '0 Watts',
    last_change: '/Date(1604041961817+0100)/'
    }

    Leave a comment:


  • Eman
    replied

    Click image for larger version

Name:	image_94938.png
Views:	189
Size:	289.4 KB
ID:	1429674
    There is that Change Node "Gas Daily Total" at the bottom, although not connected to anything but I think would it would give you similar values as the one above it "Gas consumed total today" If you don't need it delete it.

    And something else, split the nodes into 2 function nodes going to HomeseerENERGY and test by first removing half of the nodes

    Eman.

    Leave a comment:


  • Malosa
    replied
    Click image for larger version  Name:	image_94938.png Views:	3 Size:	297.2 KB ID:	1429668
    Originally posted by Eman View Post
    Node-RED and HomeSeer versions....?? Although I don't think that could be a problem ..??

    The whole screenshot of your setup..??


    Eman.
    HS4.1.5 and the last node-red.
    this is the plugin i getting info from.

    Leave a comment:


  • Eman
    replied
    Node-RED and HomeSeer versions....?? Although I don't think that could be a problem ..??

    The whole screenshot of your setup..??


    Eman.

    Leave a comment:


  • Malosa
    replied
    Originally posted by enigmatheatre View Post

    This to me points to the device being updated twice by the plugin or script that is updating it and has nothing to do with node-red as you say it is fine for other devices. What is shown in the HS log when the device is triggered. Is it displayed twice in there?



    How do you know the update is for the value one time and the status another as both values in the debug are the same?
    no its not updated twice, i just did debug on the homeseer plugin and its updating 1x the same value.


    So remove the debug node, Malosa and see if one of the messages goes away. You could just delete the wire to test this is you feel you need to keep the node long term.
    no wire for debug is connected.


    well its not a big deal but can this cause instability issues?
    its happening to some of the devices i did not check them all because i enabled over 20 devcices..

    Leave a comment:


  • enigmatheatre
    replied
    Originally posted by Malosa View Post

    Well since i checked my influxdb i did see double value's all the time after a status and value gets updated by 1 device.
    This to me points to the device being updated twice by the plugin or script that is updating it and has nothing to do with node-red as you say it is fine for other devices. What is shown in the HS log when the device is triggered. Is it displayed twice in there?

    Originally posted by Malosa View Post

    So when it updates and i check the output in node-red it triggers 2x, 1 time for status and one time for value in a second..
    How do you know the update is for the value one time and the status another as both values in the debug are the same?

    Leave a comment:


  • ksum
    replied
    So remove the debug node, Malosa and see if one of the messages goes away. You could just delete the wire to test this is you feel you need to keep the node long term.

    Leave a comment:


  • Malosa
    replied
    Originally posted by ksum View Post
    Malosa Is that duplicate message coming out of a Switch node which has multiple conditions and all conditions are being tested? Wondering if it is passing two tests and reporting such.
    ksum well if that was true all other devices would report double aswell, all the nodes are the same, i used one to change the payload name on all of them.
    Well i must say on influxdb its not double, so it could be a normal debug thing.. idk

    my last couple of value's in influx db, all good
    Code:
    1603953171906000000 0.771
    1603953413598000000 0.827
    1603953720205000000 0.883
    1603954024897000000 0.935
    1603956468355000000 0.958
    1603956711694000000 0.963
    1603957932516000000 0.976
    1603958241583000000 1.026
    1603958544257000000 1.083
    1603958851835000000 1.089
    1603961231830000000 1.206

    Originally posted by Eman View Post
    How do your HomeSeer nodes look inside (properties)? Do you have the check box enabled?

    Because if checked the node reports back to Node-RED (let's hope it's not that)


    Eman.
    Eman
    No check enabled.

    Leave a comment:


  • Eman
    replied
    How do your HomeSeer nodes look inside (properties)? Do you have the check box enabled?

    Because if checked the node reports back to Node-RED (let's hope it's not that)


    Eman.

    Leave a comment:

Working...
X