Splunk Search

Watt to kWh

Greenwell01
New Member

Hi all,

I monitor my electricity consumption using a device which takes the current Watt consumption every minute and writes it to a file.

I would like to derive the kWh value from the readings for a specific time frame however the result I am getting do now align with the actually kWh difference (taken from the meter). Here is my search for time frame of Yesterday.

index=fibaro name="Youless-Mains" | rename properties.ui.ylmainpwr.value AS Watt | stats sum(Watt) as TotalWatt | eval kWh = (TotalWatt/1000)/24

Any ideas/suggestions?

Tags (1)
0 Karma

mayurr98
Super Champion

Hey

You want to measure your electricity consumption per hour for time range of yesterday?
Step 1: watts per day
Step 2: convert to kw

So your search query for kwh per day will be timerange=yesterday

 index=fibaro name="Youless-Mains" | rename properties.ui.ylmainpwr.value AS Watt | stats sum(Watt) as TotalWatt | eval kWh/day = (TotalWatt*24)/1000

If you want to find kwh per day In a time series with span of 1 day period then try below: timerange=month

index=fibaro name="Youless-Mains" | rename properties.ui.ylmainpwr.value AS Watt | timechart span=1d sum(Watt) as TotalWatt | eval kWh = (TotalWatt*24)/1000 | fields - TotalWatt

Let me know if this helps you!

0 Karma

nikita_p
Contributor

Hi @Greenwell01,
If you want to convert watt to kWh, first divide it to 1000 to convert watt to kw and then multiply it by No. of hours the device is used.
You are dividing it by 24, i think you should multiply.

0 Karma
Get Updates on the Splunk Community!

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...