I would like to ask you for help to create rule or JS script calculating energy cost and power usage as still not very familiar with scripting yet.
I already calculating device runtime so currently displaying minutes running and total runtime during day in sitemap.
MyDevice1_Time_Active - Time Since device started MyDevice1_Time_Day - Total Runtime for each day (reset at midnight)
I thoughts on that is this could be calculated using the following method but not exactly sure how to put it together hence asking for help in community.
My thoughts on calculations so far:
// This calculates power usage in kWh MyDevice1_Power_Used = ((1000W * MyDevice1_Time_Day) / 60 minutes ) / 1000
In terms of energy cost perhaps something like this could be used.
// Electricity_Unit_Cost = £0.18kWh MyDevice1_Energyused_Cost = MyDevice1_Power_Used * Electricity_Unit_Cost
I would really appreciate any support with the above