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
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...

Modernize your Splunk Apps – Introducing Python 3.13 in Splunk

We are excited to announce that the upcoming releases of Splunk Enterprise 10.2.x and Splunk Cloud Platform ...

Step into “Hunt the Insider: An Splunk ES Premier Mystery” to catch a cybercriminal ...

After a whole week of being on call, you fell asleep on your keyboard, and you hit a sequence of buttons that ...