<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Calculate KWH from random samples - need help. in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Calculate-KWH-from-random-samples-need-help/m-p/473060#M33249</link>
    <description>&lt;PRE&gt;&lt;CODE&gt;index="sense_power_monitor"  | bin _time span=1h
  | stats count as samples sum(usage_info.solar_w) as watt_sum by _time
  | eval kW_Sum=watt_sum/1000
  | eval avg_kWh=kW_Sum/samples
  | eval kWhCost=avg_kWh*0.095
  | addcoltotals
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 16 Apr 2020 23:45:04 GMT</pubDate>
    <dc:creator>pir8radio</dc:creator>
    <dc:date>2020-04-16T23:45:04Z</dc:date>
    <item>
      <title>Calculate KWH from random samples - need help.</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Calculate-KWH-from-random-samples-need-help/m-p/473052#M33241</link>
      <description>&lt;P&gt;Ok so i am grabbing watt readings every 10 or so seconds, but not EVERY 10 seconds, maybe its some samples are 5 seconds apart, some are 13, most are 10, long story short i have about 310-380 watt samples. so those samples can be any number from 0-10,000watts. With me so far? Now i need to take whatever quantity of samples I have within the hour, and figure out my KWH cost. that cost is 0.095 (9,5 cents) per kWh. I dont know how to do that. I dont want to average stuff too much, I want the kwh price to be as accurate as possible. I will be using this calculation in a splunk dashboard, so if anyone could help i would greatly appreciate it.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jun 2020 03:54:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Calculate-KWH-from-random-samples-need-help/m-p/473052#M33241</guid>
      <dc:creator>pir8radio</dc:creator>
      <dc:date>2020-06-08T03:54:36Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate KWH from random samples - need help.</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Calculate-KWH-from-random-samples-need-help/m-p/473053#M33242</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;...
| bin _time span=1h
| stats count as total sum(watt) as watt_sum by _time
| eval hourly_cost=0.095*(watt_sum/1000)
| eval avg_kwh=hourly_cost/total
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;like this? &lt;/P&gt;</description>
      <pubDate>Thu, 16 Apr 2020 02:34:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Calculate-KWH-from-random-samples-need-help/m-p/473053#M33242</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-04-16T02:34:49Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate KWH from random samples - need help.</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Calculate-KWH-from-random-samples-need-help/m-p/473054#M33243</link>
      <description>&lt;P&gt;that gets me $495  instead of $4.95 for the day.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Apr 2020 03:04:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Calculate-KWH-from-random-samples-need-help/m-p/473054#M33243</guid>
      <dc:creator>pir8radio</dc:creator>
      <dc:date>2020-04-16T03:04:45Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate KWH from random samples - need help.</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Calculate-KWH-from-random-samples-need-help/m-p/473055#M33244</link>
      <description>&lt;P&gt;divide by a hundred.&lt;BR /&gt;
that's good.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Apr 2020 03:13:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Calculate-KWH-from-random-samples-need-help/m-p/473055#M33244</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-04-16T03:13:13Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate KWH from random samples - need help.</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Calculate-KWH-from-random-samples-need-help/m-p/473056#M33245</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;index="sense_power_monitor"  | bin _time span=1h
 | stats count as samples sum(usage_info.d_w) as watt_sum by _time
 | eval hourly_cost=0.095*(watt_sum/1000)
 | eval avg_kwh=hourly_cost/samples
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Doesnt seem to work......   what am I missing...  I put this in a chart and have no "watt_sum" value, but i do have a total value...   not sure why the watt sum isnt working.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Apr 2020 03:41:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Calculate-KWH-from-random-samples-need-help/m-p/473056#M33245</guid>
      <dc:creator>pir8radio</dc:creator>
      <dc:date>2020-04-16T03:41:56Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate KWH from random samples - need help.</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Calculate-KWH-from-random-samples-need-help/m-p/473057#M33246</link>
      <description>&lt;P&gt;&lt;CODE&gt;I put this in a chart&lt;/CODE&gt;&lt;BR /&gt;
try line by line.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;| stats count as samples sum(usage_info.d_w) as watt_sum by _time&lt;/CODE&gt;&lt;BR /&gt;
this result is following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; _time watt_sum sample
A:A:A 12345 200
B:B:B 23456 200
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;....&lt;/P&gt;

&lt;P&gt;at last:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;_time watt_sum sample horly_cost avg_kwh
A:A:A 12345 500 4.54
....
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;what's wrong? I don't know your log and your results.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Apr 2020 04:51:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Calculate-KWH-from-random-samples-need-help/m-p/473057#M33246</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-04-16T04:51:38Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate KWH from random samples - need help.</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Calculate-KWH-from-random-samples-need-help/m-p/473058#M33247</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;_time                        samples        watt_sum
2020-04-15 18:00    477     2364938
2020-04-15 19:00    472     2161773
2020-04-15 20:00    495         1540459
2020-04-15 21:00    345     393664
2020-04-15 22:00    569     600557
2020-04-15 23:00    557     579712
2020-04-16 00:00    521     475932
2020-04-16 01:00    537     524457
2020-04-16 02:00    531     553670
2020-04-16 03:00    541         560756
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Something is up with your calculation, i cant get close to the actual values. in dollars or kwh...    &lt;/P&gt;</description>
      <pubDate>Thu, 16 Apr 2020 23:33:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Calculate-KWH-from-random-samples-need-help/m-p/473058#M33247</guid>
      <dc:creator>pir8radio</dc:creator>
      <dc:date>2020-04-16T23:33:56Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate KWH from random samples - need help.</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Calculate-KWH-from-random-samples-need-help/m-p/473059#M33248</link>
      <description>&lt;P&gt;I think i figured it out @to4kawa   you got me on the right track, thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 16 Apr 2020 23:44:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Calculate-KWH-from-random-samples-need-help/m-p/473059#M33248</guid>
      <dc:creator>pir8radio</dc:creator>
      <dc:date>2020-04-16T23:44:15Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate KWH from random samples - need help.</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Calculate-KWH-from-random-samples-need-help/m-p/473060#M33249</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;index="sense_power_monitor"  | bin _time span=1h
  | stats count as samples sum(usage_info.solar_w) as watt_sum by _time
  | eval kW_Sum=watt_sum/1000
  | eval avg_kWh=kW_Sum/samples
  | eval kWhCost=avg_kWh*0.095
  | addcoltotals
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 16 Apr 2020 23:45:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Calculate-KWH-from-random-samples-need-help/m-p/473060#M33249</guid>
      <dc:creator>pir8radio</dc:creator>
      <dc:date>2020-04-16T23:45:04Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate KWH from random samples - need help.</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Calculate-KWH-from-random-samples-need-help/m-p/473061#M33250</link>
      <description>&lt;P&gt;This is what was throwing me off...  some of my values are negative numbers...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2020-04-15 00:00    512 -1453.1523723602295000  -0.0028381882272660733000   -1.4531523723602295000  -0.00027
2020-04-15 01:00    525 -1413.8822467327118000  -0.0026931090413956416000   -1.4138822467327120000  -0.00026
2020-04-15 02:00    526 -1470.4220585823060000  -0.0027954791988256770000   -1.4704220585823060000  -0.00027
2020-04-15 03:00    524 -1379.7629923820496000  -0.0026331354816451326000   -1.3797629923820496000  -0.00025
2020-04-15 04:00    529 -1492.7082788944244000  -0.0028217547805187604000   -1.4927082788944244000  -0.00027
2020-04-15 05:00    518 -2029.8906929492950000  -0.0039187079014465160000   -2.0298906929492953000  -0.00037
2020-04-15 06:00    508 11771.73814809322400000 0.02317271288994729000000   11.77173814809322400000 0.0022
2020-04-15 07:00    507 42808.122723191980000000    0.084434167106887530000000  42.808122723191980000000    0.0080
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 16 Apr 2020 23:47:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Calculate-KWH-from-random-samples-need-help/m-p/473061#M33250</guid>
      <dc:creator>pir8radio</dc:creator>
      <dc:date>2020-04-16T23:47:09Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate KWH from random samples - need help.</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Calculate-KWH-from-random-samples-need-help/m-p/473062#M33251</link>
      <description>&lt;P&gt;I see, We should extract fields again.&lt;BR /&gt;
will you provide logs? maybe json.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Apr 2020 11:40:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Calculate-KWH-from-random-samples-need-help/m-p/473062#M33251</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-04-17T11:40:26Z</dc:date>
    </item>
  </channel>
</rss>

