Page 1 of 1

After upgrade from 2022.2 to 2023.2 updateCounter stooped working on managed counter

Posted: Thursday 30 November 2023 16:41
by imdos
I have a few managed counters to calculate my GAS and Energy.

But they stopped updating the counters when I updated from 2022.2 to 2023.2.

Code: Select all

return {

        on = {
            -- timer = { 'every hour' }
             timer = { 'every 5 minutes' }
            --  timer = { 'every  minute' }
        },
        --[[logging = {
        level = domoticz.LOG_DEBUG,
        marker = "ytd"
        },]]--
        execute = function(dz, item)
        -- # Items uit de user variabelen
        local YTD_Gas_start = dz.variables("YTD-Gas-start").value
        local YTD_Laag_start = dz.variables("YTD-Laag-start").value
        local YTD_Laag_T_start = dz.variables("YTD-Laag-T-start").value
        local YTD_Hoog_start = dz.variables("YTD-Hoog-start").value
        local YTD_Hoog_T_start = dz.variables("YTD-Hoog-T-start").value
        -- # Uit de P1_meter
        local PowerT = dz.devices(1) -- Power
        local GasT = dz.devices(11) -- Gas
        local ElektraL = dz.devices(26)
        local ElektraH = dz.devices(25)
        local ElektraGL = dz.devices(28)
        local ElektraGH = dz.devices(29)
        local ElektraTL = dz.devices(31)
        local ElektraTH = dz.devices(30)
        local Gas_current = dz.utils.round(tonumber(GasT.rawData[1]/1000))
        local YTD_Laag_current = dz.utils.round(tonumber(PowerT.rawData[1]/1000))
        local YTD_Laag_T_current = dz.utils.round(tonumber(PowerT.rawData[3]/1000))
        local YTD_Hoog_current = dz.utils.round(tonumber(PowerT.rawData[2]/1000))
        local YTD_Hoog_T_current = dz.utils.round(tonumber(PowerT.rawData[4]/1000))
        -- calculatie
        -- from updateCounter to updateCustomSensor
        dz.devices(27).updateCounter( (Gas_current - YTD_Gas_start)*100) -- YTD_Gas
        ElektraGL.updateCounter( (YTD_Laag_current - YTD_Laag_start)*1000) -- YTD_Laag
        ElektraGH.updateCounter( (YTD_Hoog_current - YTD_Hoog_start)*1000) -- YTD_Hoog
        ElektraTH.updateCounter( (YTD_Hoog_T_current - YTD_Hoog_T_start)*1000) -- YTD_Hoog_T
        ElektraTL.updateCounter( (YTD_Laag_T_current - YTD_Laag_T_start)*1000) -- YTD_Laag_T
        ElektraH.updateCounter( ElektraGH.sValue - ElektraTH.sValue )
        ElektraL.updateCounter( ElektraGL.sValue - ElektraTL.sValue )
        -- logging
        --[[ dz.log("YTD_Gas_start = " .. YTD_Gas_start)
        dz.log("YTD_Laag_start = " .. YTD_Laag_start)
        dz.log("YTD_Laag_T_start = " .. YTD_Laag_T_start)
        dz.log("YTD_Hoog_start = " .. YTD_Hoog_start)
        dz.log("YTD_Hoog_T_start = " .. YTD_Hoog_T_start)
        dz.log("Gas_current = " .. Gas_current)
        dz.log("YTD_Laag_current = " .. YTD_Laag_current)
        dz.log("YTD_Laag_T_current = " .. YTD_Laag_T_current)
        dz.log("YTD_Hoog_current = " .. YTD_Hoog_current)
        dz.log("YTD_Hoog_T_current = " .. YTD_Hoog_T_current) ]]--
        dz.log("Gas verbruik is: " .. Gas_current - YTD_Gas_start .. " m3")
        dz.log("Elektra verbruik laag is: " .. YTD_Laag_current - YTD_Laag_start .. " kWh")
        dz.log("Elektra verbruik hoog is: " ..  YTD_Hoog_current - YTD_Hoog_start .. " kWh")
        dz.log("Elektra opwek hoog is: " .. YTD_Hoog_T_current - YTD_Hoog_T_start .. " kWh")
        dz.log("Elektra opwek laag is: " .. YTD_Laag_T_current - YTD_Laag_T_start .. " kWh")
        dz.log("Elektra gebruik hoog is: " .. ElektraH.counter/1000 .. " kWh" )
        dz.log("Elektra gebruik laag is: " .. ElektraL.counter/1000 .. " kWh" )
        end
}
This is logged btw:

2023-11-30 16:40:00.625 Status: dzVents: Info: ------ Start external script: ytd.lua:, trigger: "every 5 minutes"
2023-11-30 16:40:00.627 Status: dzVents: Info: Gas verbruik is: 942 m3
2023-11-30 16:40:00.627 Status: dzVents: Info: Elektra verbruik laag is: 1895 kWh
2023-11-30 16:40:00.627 Status: dzVents: Info: Elektra verbruik hoog is: 1981 kWh
2023-11-30 16:40:00.627 Status: dzVents: Info: Elektra opwek hoog is: 2638 kWh
2023-11-30 16:40:00.627 Status: dzVents: Info: Elektra opwek laag is: 1193 kWh
2023-11-30 16:40:00.627 Status: dzVents: Info: Elektra gebruik hoog is: -0.785 kWh
2023-11-30 16:40:00.627 Status: dzVents: Info: Elektra gebruik laag is: 0.593 kWh
2023-11-30 16:40:00.627 Status: dzVents: Info: ------ Finished ytd.lua

Re: After upgrade from 2022.2 to 2023.2 updateCounter stooped working on managed counter  [SOLVED]

Posted: Thursday 30 November 2023 16:53
by willemd
It seems 2023.2 has many issues related to managed counters. See earlier forum messages and issue list on github.

Those are fixed in latest beta and next stable release.

Re: After upgrade from 2022.2 to 2023.2 updateCounter stooped working on managed counter

Posted: Wednesday 06 December 2023 17:11
by hemant5400z
Hi,

I have the same issue here. None of my Managed counters seem to calculate anymore :( which I have been using to keep track of individual P1's.
Can I go back without loosing Data ? Or any other solution?

They are all marked with a "red" heading and have not been updated sinds the upgrade.

Hemant

Re: After upgrade from 2022.2 to 2023.2 updateCounter stooped working on managed counter

Posted: Wednesday 06 December 2023 17:13
by hemant5400z
In Addition, in my log i constantly see:

MQTT: Problem updating sensor (check idx, hardware enabled)

But not sure what it is reffering to.

All help appreaciated.

hemant

Re: After upgrade from 2022.2 to 2023.2 updateCounter stooped working on managed counter

Posted: Wednesday 06 December 2023 19:26
by waltervl
Start with updating to latest beta as the known managed counter issues are solved in this version.
Be aware that latest beta has no OpenZwave support anymore so Zwave has to be migrated to Zwave-JS-UI.

Re: After upgrade from 2022.2 to 2023.2 updateCounter stooped working on managed counter

Posted: Wednesday 06 December 2023 21:04
by jvdz
waltervl wrote: Wednesday 06 December 2023 19:26 Start with updating to latest beta as the known managed counter issues are solved in this version.
Be aware that latest beta has no OpenZwave support anymore so Zwave has to be migrated to Zwave-JS-UI.
I honestly think we should stop this advice to rolling into Beta version when a production version has problems.
Production should be a stable platform without issues and when it does have issues these should be fixed as Production, not being mixed with Beta changes.
Maybe the Devs should think about re-releasing the latest Production version when bugs are found by simply applying those PR's fixing these specific bugs into the production branch only.
Just my 2 cents! ;)

Re: After upgrade from 2022.2 to 2023.2 updateCounter stooped working on managed counter

Posted: Wednesday 06 December 2023 21:46
by hemant5400z
Hi,

I do agree. So much for stable.
We use it to make sure we do not run into basis issues.
Looks like more like Devops than stable.

Anyway i’m running docker, which exact verstion do i need to pull because upon checking latest beta release is from 29th of november 2023 i recal.

Hemant

Re: After upgrade from 2022.2 to 2023.2 updateCounter stooped working on managed counter

Posted: Wednesday 06 December 2023 22:56
by waltervl
@jdz it is what it is. I am not able to change it. The only way for this user to fix it now is to use beta or wait a couple of months for the next release.

Re: After upgrade from 2022.2 to 2023.2 updateCounter stooped working on managed counter

Posted: Wednesday 06 December 2023 22:58
by waltervl
hemant5400z wrote: Wednesday 06 December 2023 21:46 Hi,

I do agree. So much for stable.
We use it to make sure we do not run into basis issues.
Looks like more like Devops than stable.

Anyway i’m running docker, which exact verstion do i need to pull because upon checking latest beta release is from 29th of november 2023 i recal.

Hemant
Run the latest beta, it was already fixed early. If you run docker you could also setup a test environment and test there first.

Re: After upgrade from 2022.2 to 2023.2 updateCounter stooped working on managed counter

Posted: Thursday 07 December 2023 10:27
by jvdz
waltervl wrote: Wednesday 06 December 2023 22:56 @jdz it is what it is. I am not able to change it. The only way for this user to fix it now is to use beta or wait a couple of months for the next release.
My point is that you do not have any knowledge of what else could break for the user by giving this advice to go to a Beta version, so this needs to be given with caution, as sometimes the cure is worse than the decease. ;-)

Re: After upgrade from 2022.2 to 2023.2 updateCounter stooped working on managed counter

Posted: Thursday 07 December 2023 14:11
by hemant5400z
Hi,

I just updated to the latest beta. I have always been using linuxserver.io docker builds so there was a bit of config work I had to do because that build is not maintained after 2023.2 stable.


Alls counters are working again, i noticed my camera snapshots are not working anymore.

I noticed that wget is not installed by default in the container, I installed it manually and my snapshots from the camera are back.
Is there a way to install this with a script so it automatically gets installed after container is updated?

Cheers,
Hemant

Re: After upgrade from 2022.2 to 2023.2 updateCounter stooped working on managed counter

Posted: Thursday 07 December 2023 17:35
by waltervl
hemant5400z wrote: Thursday 07 December 2023 14:11
I noticed that wget is not installed by default in the container, I installed it manually and my snapshots from the camera are back.
Is there a way to install this with a script so it automatically gets installed after container is updated?

Cheers,
Hemant
Yes in the official Domoticz docker container there is the custom startup script you can use.

https://www.domoticz.com/wiki/Docker#cu ... _container