Page 1 of 1
Addition of two IDX
Posted: Monday 26 March 2018 20:05
by Johan1974
Hello,
I have two inverters for solar.
IDX 227 and IDX 228
How can i addition both IDX in to a Total IDX.? ( IDX227 + IDX228 = IDX 230 )

Re: Addition of two IDX
Posted: Tuesday 27 March 2018 1:15
by waaren
Could be as simple as
Code: Select all
--[[
Combinetest (dzVents 2.4.1)
]]--
return {
on = { timer = { "every minute at daytime" , "every 30 minutes at nighttime" } },
execute = function(domoticz, _)
domoticz.devices(230).updateCounter(1000 * ( domoticz.devices(227).counter + domoticz.devices(228).counter ) )
end
}
Re: Addition of two IDX
Posted: Tuesday 27 March 2018 13:21
by Johan1974
waaren wrote: Tuesday 27 March 2018 1:15
Could be as simple as
Code: Select all
--[[
Combinetest (dzVents 2.4.1)
]]--
return {
on = { timer = { "every minute at daytime" , "every 30 minutes at nighttime" } },
execute = function(domoticz, _)
domoticz.devices(230).updateCounter(1000 * ( domoticz.devices(227).counter + domoticz.devices(228).counter ) )
end
}
I put the script in Domoticz in DzVents, and saved it as TotalZon.
Domoticz Log give a Error:
Code: Select all
2018-03-27 13:20:43.004 Error: dzVents: Error: error loading module 'TotalZon' from file '/home/pi/domoticz/scripts/dzVents/generated_scripts/TotalZon.lua':
.../domoticz/scripts/dzVents/generated_scripts/TotalZon.lua:10: '}' expected (to close '{' at line 5) near
Re: Addition of two IDX
Posted: Tuesday 27 March 2018 14:33
by waaren
What is your Domoticz / dzVents version ?
Re: Addition of two IDX
Posted: Tuesday 27 March 2018 14:46
by Johan1974
Domoticz Version 3.8153 and dzvents 2.2.0
Re: Addition of two IDX
Posted: Tuesday 09 November 2021 18:05
by laco
How simple and works properly

- 2021-11-09 (1).png (20.08 KiB) Viewed 4119 times
Re: Addition of two IDX
Posted: Tuesday 09 November 2021 22:41
by JackD
Tell us please how you made that work.......
laco wrote: Tuesday 09 November 2021 18:05
How simple and works properly

2021-11-09 (1).png
Re: Addition of two IDX
Posted: Thursday 11 November 2021 13:55
by laco
I used this DzVents script:
Code: Select all
--[[
Combinetest (dzVents 2.4.1)
]]--
return {
on = { timer = { "every minute at daytime" , "every 30 minutes at nighttime" } },
execute = function(domoticz, _)
domoticz.devices(82).updateCounter(1000 * ( domoticz.devices(60).counter + domoticz.devices(61).counter ) )
end
}
Re: Addition of two IDX
Posted: Thursday 11 November 2021 22:14
by JackD
Forgive me stupid questions, I have never done anything with DzVents until now
I have a P1 smart meter(idx 1) and a S0 energy meter(idx 93),for the solar pannels(gross watt's). Not RFX meter counters so the example does not work for me, and a don't know how to modify it to my needs. Anyone some pointer on how to get the actual watt's from my two devices. I want to do some calculations with them and send the results every minute to a "percent device". Made a dummy percent device for this with idx 312.
At the end I want to see every minute a percentage of how much solar power I have for the total energy needs of my entire household.
So everything above 100%, then my household run's fully on solar power. And anything below 100% than I need addition energy from the grid.
laco wrote: Thursday 11 November 2021 13:55
I used this DzVents script:
Code: Select all
--[[
Combinetest (dzVents 2.4.1)
]]--
return {
on = { timer = { "every minute at daytime" , "every 30 minutes at nighttime" } },
execute = function(domoticz, _)
domoticz.devices(82).updateCounter(1000 * ( domoticz.devices(60).counter + domoticz.devices(61).counter ) )
end
}
Re: Addition of two IDX
Posted: Saturday 13 November 2021 13:18
by JackD
Figured it out why nothing with DzVents seems to work for me, including the basic example stated in this threat.
Found out about full debug mode and saw a write error when I hit the save button in the Domoticz DzVents Editor.
It turns out that the script folder where the Domoticz DzVents Editor tries to save the scriptfile does not exists on my Domoticz system, and Domoticz does not seem to create it by itself. So I created the script folder by hand and then hit the save button again.......... and yes DzVents is alive
So now I can get on with building the script with the functionality I need.... and so we keep on learning
