Page 1 of 1

Strange numbers

Posted: Saturday 26 January 2019 12:12
by Knibor
Hi,

I have 2 virtual counters, number 1 "stroom totaal verbruik" with IDX 74 and number 2 "stroom totaal levering" with IDX 75

I use the dzVents code:

Code: Select all

--[[ 
	Combinetest (dzVents 2.4.1)
 ]]--
 
return {
	on = { timer = { "every minute at daytime" , "every minutes at nighttime" } },

	execute = function(domoticz, _)
		domoticz.devices(78).updateCounter( 1000 * ( domoticz.devices(75).counter - domoticz.devices(74).counter ) )
	end	
}
But the output virtual counter "Stroom totaal" with IDX 78 gifs me strange numbers?
What to do to get it correct?

Re: Strange numbers

Posted: Saturday 26 January 2019 13:30
by waaren
Knibor wrote: Saturday 26 January 2019 12:12 But the output virtual counter "Stroom totaal" with IDX 78 gifs me strange numbers?
What to do to get it correct?
Your "levering" is more then "verbruik" that makes that the outcome of calculation is negative and the device type you picked for "totaal" is not designed to receive negative values (it uses unsigned integer)
If you switch to device type managed counter you can display negative values. But dzVents needs a (minor) update to be able to handle this type.
I will send you an updated device-adapter to test via PM and if OK I will create a PR for it.

Re: Strange numbers

Posted: Saturday 26 January 2019 17:34
by Knibor
Hi,

Thanks for the information, I will try the device adapter and it is OK to create PR for it.