Hello,
Is there someone who can help me to make a script ( i don't have any idea how to do that ).
I want to make the sum of two values from my enphase 8.302kwh-5629kwh=2673kwh
the idx enphase1 = 5291
The idx enphase2 = 5293
thank you in advance
help I want to make the sum of two values Topic is solved
Moderator: leecollings
-
- Posts: 84
- Joined: Sunday 18 February 2018 9:32
- Target OS: NAS (Synology & others)
- Domoticz version:
- Contact:
help I want to make the sum of two values
- Attachments
-
- enphase.png (23.87 KiB) Viewed 1603 times
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: help I want to make the sum of two values
Could look like below as dzVents script
___________________________________________________________________________________________________________________________
When not yet familiar with dzVents please start with reading Get started Before implementing (~ 5 minutes). Special attention please for "In Domoticz go to Setup > Settings > Other and in the section EventSystem make sure the checkbox 'dzVents enabled' is checked. Also make sure that in the Security section in the settings you allow 127.0.0.1 to not need a password. dzVents uses that port to send certain commands to Domoticz. Finally make sure you have set your current location in Setup > Settings > System > Location, otherwise there is no way to determine nighttime/daytime state."
___________________________________________________________________________________________________________________________
Code: Select all
return
{
on =
{
devices =
{
'Enphase1',
},
},
logging =
{
level = domoticz.LOG_DEBUG,
marker = 'Delta Enphase1 and 2',
},
execute = function(dz, item)
targetDevice = dz.devices('powerDelta') -- define as virtual custom sensor
local enphase1Today = item.counterToday
local enphase2Today = dz.devices('Enphase2').counterToday
local delta = enphase1Today - enphase2Today
dz.log('Delta of enphase1 en enphase2 counterToday: ' .. delta, dz.LOG_DEBUG)
targetDevice.updateCustomSensor(delta)
end
}
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Re: help I want to make the sum of two values
I did it with a room plan and a PHP script. There is somewhere a topic about adding two values.
Update: https://r.tapatalk.com/shareLink/topic? ... source=app
Update: https://r.tapatalk.com/shareLink/topic? ... source=app
-
- Posts: 84
- Joined: Sunday 18 February 2018 9:32
- Target OS: NAS (Synology & others)
- Domoticz version:
- Contact:
Re: help I want to make the sum of two values
waaren
the script works, absolutely great.
Thank you very much for the effort
-
- Posts: 84
- Joined: Sunday 18 February 2018 9:32
- Target OS: NAS (Synology & others)
- Domoticz version:
- Contact:
Re: help I want to make the sum of two values
Thanks for the link.nico4sen wrote: ↑Monday 12 October 2020 19:37 I did it with a room plan and a PHP script. There is somewhere a topic about adding two values.
Update: https://r.tapatalk.com/shareLink/topic? ... source=app
Who is online
Users browsing this forum: No registered users and 1 guest