<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[How to have a point that is the sum of time of binary point is on..]]></title><description><![CDATA[<p dir="auto">i mean i have a modbus source that is binary on or off<br />
i want to create a metadatapoint the sums the accumulate hours of that binary is 1....</p>
<p dir="auto">i don't know what to put on the script part of the metadata point for achieving this</p>
<p dir="auto">what i need is to have a counter of working hours a day of a engine..</p>
<p dir="auto">thanks for the help..</p>
]]></description><link>https://forum.mango-os.com/topic/1324/how-to-have-a-point-that-is-the-sum-of-time-of-binary-point-is-on</link><generator>RSS for Node</generator><lastBuildDate>Mon, 15 Jun 2026 07:46:16 GMT</lastBuildDate><atom:link href="https://forum.mango-os.com/topic/1324.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 11 Apr 2013 05:37:41 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How to have a point that is the sum of time of binary point is on.. on Fri, 12 Apr 2013 20:09:30 GMT]]></title><description><![CDATA[<p dir="auto">I you set the update to start of day and use this it will work:  return 24*(b.past(DAY).get(true).proportion);</p>
]]></description><link>https://forum.mango-os.com/post/7688</link><guid isPermaLink="true">https://forum.mango-os.com/post/7688</guid><dc:creator><![CDATA[JoelHaggar]]></dc:creator><pubDate>Fri, 12 Apr 2013 20:09:30 GMT</pubDate></item><item><title><![CDATA[Reply to How to have a point that is the sum of time of binary point is on.. on Fri, 12 Apr 2013 14:15:16 GMT]]></title><description><![CDATA[<p dir="auto">Hi and thanks for the help, what i need is not the last 24hours but by day i mean  some thing like return (b.past**(TODAY).**get(true).proportion);</p>
<p dir="auto">[quote=</p>
<pre><code>return 24*(b.past(HOUR, 24).get(true).proportion);
</code></pre>
<p dir="auto">I think this will take the % of time it was true for the 24 hour period and then convert that to how many hours.[/quote]</p>
]]></description><link>https://forum.mango-os.com/post/7687</link><guid isPermaLink="true">https://forum.mango-os.com/post/7687</guid><dc:creator><![CDATA[fca]]></dc:creator><pubDate>Fri, 12 Apr 2013 14:15:16 GMT</pubDate></item><item><title><![CDATA[Reply to How to have a point that is the sum of time of binary point is on.. on Thu, 11 Apr 2013 06:47:23 GMT]]></title><description><![CDATA[<p dir="auto">This is from the documentation on Meta Data Points (click on the ? icon)</p>
<blockquote>
<p dir="auto"><strong>The StartsAndRuntimeList object is returned by Binary and Multistate points. It contains the following properties:</strong></p>
</blockquote>
<p dir="auto">realStart: (integer) the actual start time used for calculations (in case the start time precedes the point's first known value)<br />
end: (integer) the end time used for calculations<br />
data: (array) the list of individual StartAndRuntime objects.<br />
Each StartAndRuntime object has the following properties:<br />
value: (boolean for Binary, integer for Multistate) the point state to which the remaining properties apply<br />
starts: (integer) the number of times the state was entered over the period<br />
runtime: (integer) the amount of time in milliseconds the point was in the state over the period<br />
proportion: (float) the proportion of the period the point was in the state (runtime / real duration)<br />
percentage: (float) proportion * 100</p>
<p dir="auto">To access a specific StartAndRuntime object in the list, use the get() function. For example, the following returns the proportion of time that 'b' was in state 'false' over the previous 2 months.</p>
<p dir="auto">return b.past(MONTH, 2).get(false).proportion;</p>
<p dir="auto">you could do</p>
<pre><code>return 24*(b.past(HOUR, 24).get(true).proportion);
</code></pre>
<p dir="auto">I think this will take the % of time it was true for the 24 hour period and then convert that to how many hours.</p>
]]></description><link>https://forum.mango-os.com/post/7682</link><guid isPermaLink="true">https://forum.mango-os.com/post/7682</guid><dc:creator><![CDATA[JoelHaggar]]></dc:creator><pubDate>Thu, 11 Apr 2013 06:47:23 GMT</pubDate></item></channel></rss>