Page 1 of 3

Neo CoolCam Power plug 12A+ problem with kWh

Posted: Saturday 10 August 2019 17:24
by EddyG
I have several Neo Coolcam power plugs and lately also the new 12A+ plug.
This plug 'spikes' with very high value for kWh, always in the order of 21474837
Anybody any idea how to prevent this?

Re: Neo CoolCam Power plug 12A+ problem with kWh

Posted: Saturday 10 August 2019 20:34
by tonbor
Let kWh be calculated by domoticz not the sensor. If the spike is in watt too computed kWh is wrong too.

Re: Neo CoolCam Power plug 12A+ problem with kWh

Posted: Monday 12 August 2019 21:48
by EddyG
Tnx, I will do that. I hoped there was an other way 'inside' the plug.

Re: Neo CoolCam Power plug 12A+ problem with kWh

Posted: Thursday 15 August 2019 20:00
by EddyG
Unfortunately that did NOT solve the problem.
I have a lot of 'old' neo coolcam powerplugs, which all work fine and give good reading of kWh.
I have 3 new powerplugs ID=0x1027 Type=0x0200. 1 works fine as it should be, but 2 powerplugs still are giving these strange readings.
In the database I see values like -21474828288.
Anyone any idea how to solve this?

Re: Neo CoolCam Power plug 12A+ problem with kWh

Posted: Saturday 17 August 2019 17:01
by tonbor
It is not only kWh, ampere too.

Re: Neo CoolCam Power plug 12A+ problem with kWh

Posted: Saturday 17 August 2019 21:50
by EddyG
My current even stays at zero all the time.
Watt gives a normal display.
Question remains, how to solve it.
I looked a little bit further. The value in database is very close to the negative power of 2 to 31. Which is: -2.147.483.648
The difference might be the real value.
So it might be a 32 bit value, where the MSB has a special meaning which is not converted in OZW.

Re: Neo CoolCam Power plug 12A+ problem with kWh

Posted: Monday 19 August 2019 15:13
by dens1975
I also have this problem with the new Power Plugs. Hope someone can help out. I already had it with the previous version of domoticz and was hoping it was solved when I upgraded to version: 4.10717

Re: Neo CoolCam Power plug 12A+ problem with kWh

Posted: Sunday 25 August 2019 7:19
by krizzz
Same issue here! Strange KwH readings!

Re: Neo CoolCam Power plug 12A+ problem with kWh

Posted: Sunday 25 August 2019 20:10
by akamming
Same here on the same device type.

i noticed 2 things.
1. Apparently the kwh value in the device itself is not initialised correctly: There is a very big negative value reported by the device itself. (bug in the device)
afbeelding 2.jpg
afbeelding 2.jpg (239.46 KiB) Viewed 6681 times
2. This should not bother domoticz, because it is an incremental counter. The value itself is not relevant, only the increment between 2 reported values. Domoticz does not seem to handle this negative value correctly: See graph below: for the 48 hr history the increments are calculated correctly. However for the last month graph (lower graph) when the increments are calculated on a daily basis they seem to be calculated incorrectly in case of these big negative absolute numbers.
afbeelding 1.jpg
afbeelding 1.jpg (104.85 KiB) Viewed 6681 times
I will try to do a factory reset on this device, to check if problem 1 is gone, however for now i will leave it like it is. Hopefully a domoticz developer can follow up on the 2nd issue (making domoticz more robust) for which i then would have a valid testscenario to verify if the problem is gone.

Re: Neo CoolCam Power plug 12A+ problem with kWh

Posted: Monday 26 August 2019 11:51
by jfh75
Same for me, I thought is was due to moving from one network (paris house) to countryside house.
I tried to reset the device following instruction. And since, I also get this huge negative total. And it seems to decrease indeed.
To my opinion, it must be a domoticz issue as suddenly, in my zwave control panel, I once got all my devices ID, manufacturer and type turning to 00 and empty.
I soft and hard resetted the controller it the same.
Also, when I click heal network, nothing is happening, as I used to get "healing network launched !" notice before. So I am actually wondering if it is working or not.
This faulty zwave management happens on a 716+II synology nas with Aeon gen5 stick and beta V4.11213.
On my other installation with everspring zwave dongle, everything look fine on a synology 916+ and stable v4.10717. Which was beta before anyway and also working fine.

Re: Neo CoolCam Power plug 12A+ problem with kWh

Posted: Monday 26 August 2019 13:36
by akamming
hmmm... today the node suddenly seems to be repaired by itself. It now shows a counter of 2.348kwh, also in the OZW control panel. I manually removed all weird values from the database and the graph is now looking fine. I will keep monitoring and report if it changes back to the weird values again.
To my opinion, it must be a domoticz issue
Although i do think it is possible to make a fix in domoticz (if the increments are calculated correctly, domoticz should not be bothered by the wrong incorrect total value), i don't think the root cause is domoticz. On this device the same behaviour is reported on several home automation software packages, for example: https://community.athom.com/t/neo-coolc ... ssue/11389

Re: Neo CoolCam Power plug 12A+ problem with kWh

Posted: Tuesday 27 August 2019 9:03
by akamming
hmmmm.... the meter log from last night on this device ("select * From Meter where DeviceRowID=416;")

Code: Select all

416|2350|0|2019-08-26 22:20:00
416|2150|1663|2019-08-26 22:25:01
416|2170|1669|2019-08-26 22:30:00
416|2190|1679|2019-08-26 22:35:00
416|-21474834432|1688|2019-08-26 22:40:01
416|-21474834432|1697|2019-08-26 22:45:00
416|-21474834432|1703|2019-08-26 22:50:00
416|2300|1708|2019-08-26 22:55:00
416|2320|1712|2019-08-26 23:00:00
416|2360|1716|2019-08-26 23:05:01
416|-21474834432|1717|2019-08-26 23:10:00
416|-21474834432|1726|2019-08-26 23:15:02
416|-21474834432|1732|2019-08-26 23:20:00
416|2480|1738|2019-08-26 23:25:02
416|2500|1747|2019-08-26 23:30:00
416|2520|1757|2019-08-26 23:35:01
416|-21474834432|1766|2019-08-26 23:40:00
416|-21474834432|1778|2019-08-26 23:45:01
416|-21474834432|1786|2019-08-26 23:50:01
416|2630|1795|2019-08-26 23:55:00
416|2670|1807|2019-08-27 00:00:00
416|2690|1814|2019-08-27 00:05:00
416|-21474834432|1820|2019-08-27 00:10:00
416|-21474834432|1828|2019-08-27 00:15:00
416|-21474834432|1842|2019-08-27 00:20:00
416|2820|1856|2019-08-27 00:25:00
416|2840|1860|2019-08-27 00:30:01
416|2880|1633|2019-08-27 00:35:00
416|-21474834432|1448|2019-08-27 00:40:00
416|-21474834432|1304|2019-08-27 00:45:00
416|-21474834432|1201|2019-08-27 00:50:00
416|2960|1129|2019-08-27 00:55:00
416|2980|1076|2019-08-27 01:00:00
416|3000|1035|2019-08-27 01:05:00
416|3020|989|2019-08-27 01:10:02
416|3020|946|2019-08-27 01:15:00
416|3040|899|2019-08-27 01:20:02
416|-21474834432|846|2019-08-27 01:25:00
416|-21474834432|787|2019-08-27 01:30:01
416|-21474834432|716|2019-08-27 01:35:00
416|3100|644|2019-08-27 01:40:02
416|3100|569|2019-08-27 01:45:00
416|3120|496|2019-08-27 01:50:01
So not spontaniously fixed at all… every now and then the negative values screwing up the sensor history! I will try a factory reset next

UPDATE: Factory reset did not have impact, so i created a workaround, by creating a dzvents script which resets the kwh value to the latest valid value in case of a negatively reported number. Since on a daily basis there are also valid kwh reports this should theoretically result in a working kwh meter (which is less accurate unfortunately):

Code: Select all

return {
    
    on = { 
       devices = { 
           "kWh Meter Power Plug 1" -- add your to be corrected neo coolcam kwh meter here 
       }
    },
        
    logging =   {   
        level     =   domoticz.LOG_DEBUG,
        marker    =   "NEO Coolcam kWh Fix"      
    },
    data = {
             ["kWh Meter Power Plug 1"] = { history = true, maxItems = 10 } -- add your to be corrected neo coolcam kwh meter here
    },
    
    execute = function(domoticz,device)
        domoticz.log("device["..device.name.."] was changed to ["..device.state.."]",domoticz.LOG_DEBUG);
        
        domoticz.log("total is "..device.WhTotal..", usage="..device.usage,domoticz.LOG_DEBUG)
        if (device.WhTotal>0) then
            domoticz.log("adding to history",domoticz.LOG_DEBUG)
            domoticz.data[device.name].add(device.WhTotal)
        else
            local CorrectedWhTotal=domoticz.data[device.name].max()
            domoticz.log("Negative number, correcting WhTotal from "..device.WhTotal.." to "..CorrectedWhTotal,domoticz.LOG_DEBUG)
            device.updateElectricity(device.usage,CorrectedWhTotal).silent()
            
        end
        
    end
}
i will let this run for a few days and let you know if the stats are corrected automatically.

Re: Neo CoolCam Power plug 12A+ problem with kWh

Posted: Thursday 29 August 2019 11:26
by akamming
update:

happy to report that my workaround script works as expected.

this script has now been running for a few days and it works as a workaround. The node still reports spikes to domoticz (there is evidence in the log:a lot of lines like: 2019-08-29 05:57:22.010 Status: dzVents: Debug: NEO Coolcam Fix: Negative number, correcting WhTotal from -21474832384 to 4080), but they are corrected by the script resulting in a nice graph of daily stats without the spikes
NEO Coolcam log.png
NEO Coolcam log.png (111.63 KiB) Viewed 6571 times

Re: Neo CoolCam Power plug 12A+ problem with kWh

Posted: Tuesday 15 October 2019 8:46
by mleferink
hi there,

same problem here. is there a nice solution already?

greets mark

Re: Neo CoolCam Power plug 12A+ problem with kWh

Posted: Friday 18 October 2019 16:22
by Micha123
I have exactly the same problem, wil try your script.


Maybe is there an firmware update for it?

Re: Neo CoolCam Power plug 12A+ problem with kWh

Posted: Monday 21 October 2019 20:44
by Aad3229
Ik heb hetzelfde probleem en Ik krijg een foutmelding bij het runnen van het script. Ik ben zelf onbekend met programmeren, iemand een idee wat er fout gaat?

Code: Select all

2019-10-21 20:35:09.072 Status: dzVents: Info: NEO Coolcam kWh Fix: ------ Start internal script: kWh_Correct: Device: "L_WMGroot_kWh (Aeon Z-Stick Gen 5)", Index: 283
2019-10-21 20:35:09.072 Status: dzVents: Debug: NEO Coolcam kWh Fix: device[L_WMGroot_kWh] was changed to [6.020;-21474836480.000]
2019-10-21 20:35:09.072 Status: dzVents: Debug: NEO Coolcam kWh Fix: total is -21474836480, usage=6.02
2019-10-21 20:35:09.072 Status: dzVents: Error (2.4.19): NEO Coolcam kWh Fix: An error occured when calling event handler kWh_Correct
2019-10-21 20:35:09.072 Status: dzVents: Error (2.4.19): NEO Coolcam kWh Fix: ...cz/var/scripts/dzVents/generated_scripts/kWh_Correct.lua:26: attempt to concatenate local 'CorrectedWhTotal' (a nil value)
2019-10-21 20:35:09.072 Status: dzVents: Info: NEO Coolcam kWh Fix: ------ Finished kWh_Correct
2019-10-21 20:35:09.120 Status: dzVents: Info: NEO Coolcam kWh Fix: ------ Start internal script: kWh_Correct: Device: "L_WMGroot_kWh (Aeon Z-Stick Gen 5)", Index: 283
2019-10-21 20:35:09.121 Status: dzVents: Debug: NEO Coolcam kWh Fix: device[L_WMGroot_kWh] was changed to [6.000;-21474836480.000]
2019-10-21 20:35:09.121 Status: dzVents: Debug: NEO Coolcam kWh Fix: total is -21474836480, usage=6
2019-10-21 20:35:09.121 Status: dzVents: Error (2.4.19): NEO Coolcam kWh Fix: An error occured when calling event handler kWh_Correct
2019-10-21 20:35:09.121 Status: dzVents: Error (2.4.19): NEO Coolcam kWh Fix: ...cz/var/scripts/dzVents/generated_scripts/kWh_Correct.lua:26: attempt to concatenate local 'CorrectedWhTotal' (a nil value)
2019-10-21 20:35:09.121 Status: dzVents: Info: NEO Coolcam kWh Fix: ------ Finished kWh_Correct

Re: Neo CoolCam Power plug 12A+ problem with kWh

Posted: Wednesday 06 November 2019 12:58
by xvisor
Same problem here with the CoolCam 12A+, i own 2 types:
5x Shenzhen Neo Electronics Co Ltd NAS-WR01Z Power plug 12A+ Shenzhen Neo Electronics Co Ltd 0x1087 0x0003
2x Shenzhen Neo Electronics Co Ltd NAS-WR01ZE Power plug 12A+ Shenzhen Neo Electronics Co Ltd 0x1027 0x0200

Both are having these issues, my Fibaro's have no issues at all. This started somewhere around the time I updated to OZW 1.6 I guess...

Any working solution would be great!

@akamming: Can I put multiple devices at once in your script, or would it be better to use a unique one for every device???

Thanks,
Peter

Re: Neo CoolCam Power plug 12A+ problem with kWh

Posted: Sunday 22 December 2019 18:01
by klin34970
Hello,
thx akamming for your script, I didn't have to do it from scratch. I had to improve it.
I received 1 day ago, 10 NAS-WR01Z and same problem for all.

During my investigation, sometimes domoticz.data[device.name].max() return nil.
In this case, it's a error and negative value will be written.
Here is my little changes:

Code: Select all

return {
    
    on = { 
       devices = { 
           "Spa kWh Meter" -- add your to be corrected neo coolcam kwh meter here 
       }
    },
        
    logging =   {   
        level     =   domoticz.LOG_DEBUG,
        marker    =   "NEO Coolcam kWh Fix"      
    },
    data = {
             ["Spa kWh Meter"] = { history = true, maxItems = 10 } -- add your to be corrected neo coolcam kwh meter here
    },
    
    execute = function(domoticz,device)
        domoticz.log("device["..device.name.."] was changed to ["..device.state.."]",domoticz.LOG_DEBUG);
        
        domoticz.log("total is "..device.WhTotal..", usage="..device.usage,domoticz.LOG_DEBUG)
        if (device.WhTotal>0) then
            domoticz.log("adding to history",domoticz.LOG_DEBUG)
            domoticz.data[device.name].add(device.WhTotal)
        else
            local CorrectedWhTotal=0
            if (domoticz.data[device.name].max()) then
                CorrectedWhTotal=domoticz.data[device.name].max()
            end
            device.updateElectricity(device.usage,CorrectedWhTotal).silent()
            domoticz.log("Negative number, correcting WhTotal from "..device.WhTotal.." to "..CorrectedWhTotal,domoticz.LOG_DEBUG)
        end
        
    end
}
I also delete all negatives values from Database.

Code: Select all

sqlite3 domoticz.db
DELETE FROM Meter WHERE value < 0;
BEFORE
Image

AFTER
Image

Re: Neo CoolCam Power plug 12A+ problem with kWh

Posted: Monday 23 December 2019 17:53
by JuanUil
Same problem here

Re: Neo CoolCam Power plug 12A+ problem with kWh

Posted: Saturday 11 January 2020 10:03
by roblom
Following because I also have this problem.