Addition of two IDX

Moderator: leecollings

Post Reply
Johan1974
Posts: 35
Joined: Monday 04 December 2017 20:56
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Addition of two IDX

Post by Johan1974 »

Hello,

I have two inverters for solar.

Image

IDX 227 and IDX 228

How can i addition both IDX in to a Total IDX.? ( IDX227 + IDX228 = IDX 230 )

Image
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Addition of two IDX

Post 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	
}
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Johan1974
Posts: 35
Joined: Monday 04 December 2017 20:56
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Addition of two IDX

Post 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
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Addition of two IDX

Post by waaren »

What is your Domoticz / dzVents version ?
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Johan1974
Posts: 35
Joined: Monday 04 December 2017 20:56
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Addition of two IDX

Post by Johan1974 »

Domoticz Version 3.8153 and dzvents 2.2.0
User avatar
laco
Posts: 86
Joined: Tuesday 30 October 2018 12:57
Target OS: NAS (Synology & others)
Domoticz version: 2021.1
Location: Slovensko
Contact:

Re: Addition of two IDX

Post by laco »

How simple and works properly :-)
2021-11-09 (1).png
2021-11-09 (1).png (20.08 KiB) Viewed 2149 times
User avatar
JackD
Posts: 68
Joined: Monday 02 November 2020 20:53
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Addition of two IDX

Post 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
User avatar
laco
Posts: 86
Joined: Tuesday 30 October 2018 12:57
Target OS: NAS (Synology & others)
Domoticz version: 2021.1
Location: Slovensko
Contact:

Re: Addition of two IDX

Post 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	
}
User avatar
JackD
Posts: 68
Joined: Monday 02 November 2020 20:53
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Addition of two IDX

Post by JackD »

Forgive me stupid questions, I have never done anything with DzVents until now :oops:

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	
}
User avatar
JackD
Posts: 68
Joined: Monday 02 November 2020 20:53
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Addition of two IDX

Post 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 :mrgreen:

So now I can get on with building the script with the functionality I need.... and so we keep on learning :idea:
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest