Hi All, I’m new to scripts and rules and not rely sure how to start !
I want to use Microsoft Visual Studio (VSC) with the OH extension to create the code because of all the features of VSC. So I want to start with a simple “problem”. I want to create a item to sum every hour all the energy used by all infrared panels and display this total in a graph.
To explain it in more “structured way” I put something on paper.
How can I program this with VSC? or where can I find similar examples (create a item that sums on the values and reset the sum at a moment in time)?
Dim
…IR_Total_Power as value
…IRKamerNode022_ElectricmeterkWh1 as value
…IRKamerNode022_ElectricmeterkWh2 as value
…IRKantoor_kWh2_Sensor_003 as value
…IRSerre011wallplug_ElectricmeterkWh as value
-IF
—Every hour
------Then // sum IR panel energy
------IR_Total_Power = IRKamerNode022_ElectricmeterkWh1 +
----------IRKamerNode022_ElectricmeterkWh2 +
----------IRKantoor_kWh2_Sensor_003 +
----------IRSerre011wallplug_ElectricmeterkWh
—Else if
------Time = 00:00:10 hour // reset all meter readings 10 seconds after midnight
--------Then
--------IR_Total_Power = “0”
--------IRKamerNode022_ElectricmeterkWh1 = “0”
--------IRKamerNode022_ElectricmeterkWh2 = “0”
--------IRKantoor_kWh2_Sensor_003 = “0”
--------IRSerre011wallplug_ElectricmeterkWh = “0”
----End if
–End if
End