Page 1 of 1

Add sum of two dewices in to another total sum device

Posted: Tuesday 23 April 2024 22:21
by McLund
Hi.

I have a heat pump from which I receive many measurement values ​​via MQTT to Domoticz, including device (336) "5C54 Compr. consump. tot" and device (339) "5C57 Aux consumption tot".

Now, I want to add these two MQTT devices (336) 5C54 + (339) 5C57 and display the total sum in device TotalActual (342) as it looks in red ring 1 and 2 in device (336) and (339).

Everything in the script works but I do not see the result in kWh in device TotalActual (342) at yellow ring 4 as it appears in device (339) at red ring 2 and (336) at red ring 1 where the sum for today is displayed on row two.

Additionally, I can only see Watt value in TotalActual (342) at yellow ring 3, but no value is displayed in the graphs for device TotalActual (342). I want to see value in device TotalActual (342) as it looks in device (336) 5C54 and device (339) 5C57.

I would be grateful if someone could help me and show what I do wrong in the script.


Thank you for all help! ;-)


Best regard's
McLund

Code: Select all

return {

on = {
timer = { 'every 5 minutes' }
},

execute = function(domoticz, item)
local Husdata_5C54 = domoticz.devices(336).WhToday -- = Husdata "5C54 Compr. consump. tot" via MQTT - use WhToday?
local Husdata_5C57 = domoticz.devices(339).WhToday -- = Husdata "5C57 Aux consumption tot" via MQTT - use WhToday?
local TotalActual = Husdata_5C54 + Husdata_5C57

domoticz.devices(342).updateElectricity(TotalActual)

end

}

2024-04-22_21-10-21_75.png
2024-04-22_21-10-21_75.png (75.89 KiB) Viewed 550 times
2024-04-22_21-19-51_50.png
2024-04-22_21-19-51_50.png (19.41 KiB) Viewed 550 times
2024-04-22_21-25-41_50.png
2024-04-22_21-25-41_50.png (108.29 KiB) Viewed 550 times

Re: Add sum of two dewices in to another total sum device

Posted: Tuesday 23 April 2024 22:57
by waltervl
If you only need total whtoday you have to make device 342 a custom sensor and not a electricity device.