<?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" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Frederik Van Leeckwyck on Medium]]></title>
        <description><![CDATA[Stories by Frederik Van Leeckwyck on Medium]]></description>
        <link>https://medium.com/@vleeckf?source=rss-41ac8faed201------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*6R0skShUJTuPqj_JV6lwwA.png</url>
            <title>Stories by Frederik Van Leeckwyck on Medium</title>
            <link>https://medium.com/@vleeckf?source=rss-41ac8faed201------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 19:35:08 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@vleeckf/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Tried and tested: the Grafana Canvas panel. How far could I take it?]]></title>
            <link>https://vleeckf.medium.com/tried-and-tested-the-grafana-canvas-panel-how-far-could-i-take-it-e8c902cc9891?source=rss-41ac8faed201------2</link>
            <guid isPermaLink="false">https://medium.com/p/e8c902cc9891</guid>
            <category><![CDATA[grafana]]></category>
            <category><![CDATA[svg]]></category>
            <category><![CDATA[iot]]></category>
            <dc:creator><![CDATA[Frederik Van Leeckwyck]]></dc:creator>
            <pubDate>Fri, 26 Apr 2024 13:29:40 GMT</pubDate>
            <atom:updated>2024-05-10T08:43:09.820Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Read this review to learn from my experiences with the current version of Grafana’s Canvas panel. We’ll not only explore its standard functionality, but also push the boundaries of what’s currently possible with it.</strong></p><h3>Introduction</h3><p>Recently, I spent a few hours experimenting with <strong>Grafana’s new</strong> <strong>Canvas panel</strong>, to determine its viability <strong>as an alternative to the </strong><a href="https://github.com/algenty/grafana-flowcharting"><strong>Flowcharting plugin</strong></a>. Although that plugin has been available for a few years already, its development has recently stalled. Therefore, it seems a good moment to assess the capabilities of the <a href="https://grafana.com/docs/grafana/latest/panels-visualizations/visualizations/canvas/">Canvas panel</a>, and discover the extent to which it can serve as a solid alternative.</p><p>Additionally, we are often asked to migrate old-school historian systems to Factry Historian. In addition to time-series and event data, there are occasions when we also need to migrate existing trends and visualisations. Although the migration of trends and status panels is quite easy, traditional SCADA or DCS-type visualisations (such as reactors, pumps, tanks) can be somewhat of a challenge.</p><p><strong>Read this blog post to learn from my experiences with the current version of the Canvas panel, explore the basic features, and see how far we can take it.</strong></p><p>The subject of this experiment is Grafana 11-pre.</p><h3>The Good</h3><p>Let’s start with the functionality that is already available out of the box, including:</p><ul><li>Metric Value</li><li>Text</li><li>Ellipse</li><li>Rectangle</li><li>Icon</li><li>Server</li></ul><p>This allows us to build <strong>simple graphical visualisations</strong> that go beyond status panels or time-series trends. We can easily add a new element, assign it a measurement, and configure its visualisation by choosing a fixed or dynamic background (allowing for dynamic background, based on the value of the same or another measurement), border, text (sizing, alignment) and layout (alignment, scaling).</p><p>Each element can furthermore be connected to other elements using Connections, which by themselves can also be made dynamic by changing the colour and size based on a fixed value or a measurement from your queries.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*U_zG-8lGdLswei5l" /><figcaption>In this example, we see a fixed background on the Canvas panel, and various Metric Values that display measurement data coming from the PLCs into Factry Historian. Metric Values have conditional colouring.</figcaption></figure><h3>The Bad</h3><p>The ‘Icon’ element offers significant flexibility as it allows for SVG format icons to be loaded and placed within the Canvas. Grafana includes a set of default icons that can be dynamically configured to c<strong>hange colour based on measurement values</strong>. This is particularly useful for indicating operational statuses, such as whether a pump is running. As of this writing, only 3 “IoT type” icons are included, namely a faucet, pump and drone.</p><p>Additional icons can be imported via a URL. Although in theory this opens up lots of capabilities, my experience is that public SVGs often have a hardcoded fill colour, limiting the functionality of dynamically colouring the icon in Grafana.</p><p>Furthermore, this would introduce an additional dependency on an HTTP server, somewhere on a place that is accessible for the Grafana dashboard end user.</p><p><strong>In short, expanding this functionality and potentially including a broader default set of icons related to Industrial IoT / process equipment, is necessary.</strong></p><p>To expand the functionality to custom icons, we will need to:</p><ol><li>Search for free to use SVG icons on sites such as <a href="https://www.svgrepo.com/">svgrepo.com</a></li><li>Edit them using your favourite editor to remove the hard coded fill colours</li><li>Upload/symlink them to the “$GRAFANA$/public/img/icons/iot/” folder</li><li>Reload the Grafana browser window</li></ol><p><strong>For example:</strong></p><ul><li>Download <a href="https://www.svgrepo.com/svg/109133/valve">https://www.svgrepo.com/svg/109133/valve</a></li><li>Open the file and remove the fill attribute fill=”#000000&quot;</li><li>Save the file and place/upload it in the folder $GRAFANA$/public/img/icons/iot/</li><li>Reload the browser</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*2tizFsZYquy3e-4N" /><figcaption>Adding our newly added valve icon.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*nCTA6l3xl2yvt7YL" /><figcaption>Dynamically changing the colour of our new valve icon.</figcaption></figure><p>Bottom line: with a minimal bit of work, we can make a custom icon available for our Canvas dashboard users.</p><h3>The Ugly</h3><p>What’s still missing in our exploration is the possibility to <strong>animate</strong> <strong>icons</strong> based on your data. Animations would allow you to display a running pump or agitator, or to show the current fill level of a vessel.</p><p>A couple of experimental animated elements are already available when toggling the experimental setting. Two additional elements are available:</p><ul><li>Wind Turbine: the rotation speed of the blades can be set dynamically, for example based on an ‘RPM’ tag from a wind turbine.</li><li>Drones: similar to the wind turbine, the behaviour of the element mirrors the drone’s blades</li></ul><p>While they are a good demonstration of more advanced animation capabilities, their use case in the industrial settings is limited, unless you happen to operate wind turbines or drones.</p><p>Unfortunately, for now, animated objects in the Canvas panel have to be hardcoded in Grafana’s frontend code, as can be read in the Github issue. So, let’s try that.</p><p>The <a href="https://github.com/grafana/grafana/blob/main/public/app/features/canvas/elements/windTurbine.tsx">Windturbine example</a> that ships with Grafana provides a good starting point.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*bsC3wPzQuB0r2Rrk" /></figure><p>Let’s begin by downloading a free to use SVG from <a href="https://www.svgrepo.com/">SVG Repo</a>. For my example, I chose a <a href="https://www.svgrepo.com/svg/424627/chemical-education-experiment">flask icon</a>. Next, we extract the relevant SVG elements into the .tsx file and build our animation code, following the example code from the <a href="https://github.com/grafana/grafana/blob/main/public/app/features/canvas/elements/windTurbine.tsx">Windturbine.tsx</a> file as a guide. You can find this example file on <a href="https://gist.github.com/HogeBlekker/cc7a4e3099b0a4296397d8ea6c592594">Gist</a>.</p><p>Finally, we add a reference to the file in the <a href="https://github.com/grafana/grafana/blob/89638238e5ea4a65854c8057301e3dcf1549add2/public/app/features/canvas/registry.ts#L38">registry</a>. Unfortunately, this last step reveals that the current implementation is not suitable for production use, as it is impractical to recompile Grafana’s frontend every time a new custom icon needs to be added.</p><blockquote>The current implementation is not suitable for production use, as it is impractical to recompile Grafana’s frontend every time a new custom icon needs to be added.</blockquote><p>Once added, we can leverage Grafana’s capabilities for conditional formatting, similar to the valve example previously discussed. In this case, if the flask level is below 50%, the colour changes to red, and when it exceeds 80%, it turns green.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*wT2yCGsDQ2jzL3f1" /></figure><h3>In Conclusion</h3><p>Let’s recap: we started by exploring the basic out of the box functionality. We then created custom SVG icons, which can expand the standard icon set shipped with Grafana. Finally, we added an experimental step by creating a custom animated element and plugging this into the Grafana frontend source code.</p><p>It still needs some work, but despite this, we are <strong>optimistic about the future of the Grafana Canvas plugin</strong> for several reasons:</p><ul><li>The panel is developed by Grafana, known for its excellent track record in maintaining their panels and data sources, including ensuring backwards compatibility.</li><li>The panel ties in really well with functionality that has become available in the major Grafana releases of the last few years: panel overrides, menu structure, etc.</li><li>The panel currently includes only a limited number of icons, making it somehow restricted for industrial use cases at Factry. However, this is countered with it being incredibly easy to upload your own SVGs.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e8c902cc9891" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Weekend project: energy monitoring with telegraf, modbus, InfluxDB, Flux and Grafana]]></title>
            <link>https://vleeckf.medium.com/weekend-project-energy-monitoring-with-telegraf-modbus-influxdb-flux-and-grafana-770480136410?source=rss-41ac8faed201------2</link>
            <guid isPermaLink="false">https://medium.com/p/770480136410</guid>
            <category><![CDATA[energy]]></category>
            <category><![CDATA[modbus]]></category>
            <category><![CDATA[influxdb]]></category>
            <category><![CDATA[raspberry-pi]]></category>
            <dc:creator><![CDATA[Frederik Van Leeckwyck]]></dc:creator>
            <pubDate>Fri, 16 Apr 2021 15:46:12 GMT</pubDate>
            <atom:updated>2021-04-16T15:46:12.311Z</atom:updated>
            <content:encoded><![CDATA[<p>In this blog post, I will share how to obtain a view on the net electricity use and generation of my and your house. We’ll use modbus RTU and TCP to get our data, store it in InfluxDB, query it with InfluxQL and Flux and visualize it with Grafana. The end result looks a bit like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pt1VawBrGJ07bLI4cTdcWA.png" /></figure><p>Curious? Read on!</p><h3>The premise</h3><p>Our house is designed according to the <a href="https://en.wikipedia.org/wiki/Passive_house#Standards">passive house standard</a>, which means it’s designed and oriented in such a way that it requires less than 15kWh/m2/year for heating and cooling. A small air/water heat pump, powered by electricity, supplies the little energy still required for a comfortable home environment.</p><p>Recently, I had some time for a small weekend project. My goal was to:</p><ol><li>Collect data to gain insights into the energy use during the day</li><li>Collect data from the PV installation about energy production</li><li>Calculate the level of <a href="https://blog.se.com/power-management-metering-monitoring-power-quality/2020/05/19/understanding-solar-energy-self-consumption/">self-consumption</a> we have without a home battery. In the future, I will use this to calculate the ROI of a home battery.</li></ol><p>So, let’s do this!</p><h3>Collecting data for energy use</h3><p>Since electricity is the only energy source for our house, I can resort to monitoring the energy use of all our devices with a simple electricity meter. I bought a 3-phase DIN-rail mounted energy meter with <strong>modbus RTU</strong> interface. There are plenty of cheap modules to be found. I bought a <a href="https://www.aliexpress.com/item/33024113617.html">DDS024MR</a>.</p><p>Next, I used a Kunbus <a href="https://revolution.kunbus.de/shop/en/revpi-core-3-plus">RevPI Core 3+</a> with <a href="https://revolution.kunbus.de/shop/en/usb-rs485-konverter">USB to RS485 converter</a>. The <a href="https://revolution.kunbus.com/success-stories/water-treatment/">RevPI</a> is an industrial-grade Raspberry PI which <a href="https://www.factry.io/use-cases/ekopak-fighting-water-shortage-historian/">Ekopak</a> also uses to monitor its water treatment installations. It’s a rather expensive module for a home project but I intend to use this for more automation projects in the future so I think it’s worth it.</p><p>First I built a small cabinet to wire everything up. See the picture below. Hardware is not my forte :)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6F9-mDuQ1cHHTZEjRVjGoQ.jpeg" /><figcaption>Small cabinet I put together. A bit messy, I know.</figcaption></figure><p>Since I will use <a href="https://github.com/influxdata/telegraf/tree/master/plugins/inputs/modbus">Telegraf</a> with the modbus input plugin, I therefore used the following config in the telegraf.conf TOML file to get data from the DDS024MR module.</p><pre>[[inputs.modbus]]<br>name = &quot;energymeter&quot;<br>slave_id = 11<br>timeout = &quot;1s&quot;<br>busy_retries = 2<br>busy_retries_wait = &quot;1s&quot;<br>controller = &quot;file:///dev/ttyUSB0&quot;<br>baud_rate = 9600<br>data_bits = 8<br>parity = &quot;E&quot;<br>stop_bits = 1<br>transmission_mode = &quot;RTU&quot;</pre><pre>input_registers = [<br>   { measurement = &quot;voltage_phase_a&quot;, name = &quot;value&quot;, byte_order = &quot;ABCD&quot;, data_type = &quot;FLOAT32-IEEE&quot;, scale=1.0, address = [0,1]}{ measurement = &quot;voltage_phase_b&quot;, name = &quot;value&quot;, byte_order = &quot;ABCD&quot;, data_type = &quot;FLOAT32-IEEE&quot;, scale=1.0, address = [2,3]},{ measurement = &quot;voltage_phase_c&quot;, name = &quot;value&quot;, byte_order = &quot;ABCD&quot;, data_type = &quot;FLOAT32-IEEE&quot;, scale=1.0, address = [4,5]},{ measurement = &quot;current_phase_a&quot;, name = &quot;value&quot;, byte_order = &quot;ABCD&quot;, data_type = &quot;FLOAT32-IEEE&quot;, scale=1.0, address = [8,9]},{ measurement = &quot;current_phase_b&quot;, name = &quot;value&quot;, byte_order = &quot;ABCD&quot;, data_type = &quot;FLOAT32-IEEE&quot;, scale=1.0, address = [10,11]},{ measurement = &quot;current_phase_c&quot;, name = &quot;value&quot;, byte_order = &quot;ABCD&quot;, data_type = &quot;FLOAT32-IEEE&quot;, scale=1.0, address = [12,13]},{ measurement = &quot;power_active_total&quot;, name = &quot;value&quot;, byte_order = &quot;ABCD&quot;, data_type = &quot;FLOAT32-IEEE&quot;, scale=1.0, address = [16,17]},{ measurement = &quot;power_active_a&quot;, name = &quot;value&quot;, byte_order = &quot;ABCD&quot;, data_type = &quot;FLOAT32-IEEE&quot;, scale=1.0, address = [18,19]},{ measurement = &quot;power_active_b&quot;, name = &quot;value&quot;, byte_order = &quot;ABCD&quot;, data_type = &quot;FLOAT32-IEEE&quot;, scale=1.0, address = [20,21]},{ measurement = &quot;power_active_c&quot;, name = &quot;value&quot;, byte_order = &quot;ABCD&quot;, data_type = &quot;FLOAT32-IEEE&quot;, scale=1.0, address = [22,23]},{ measurement = &quot;power_reactive_total&quot;, name = &quot;value&quot;, byte_order = &quot;ABCD&quot;, data_type = &quot;FLOAT32-IEEE&quot;, scale=1.0, address = [24,25]},{ measurement = &quot;power_reactive_a&quot;, name = &quot;value&quot;, byte_order = &quot;ABCD&quot;, data_type = &quot;FLOAT32-IEEE&quot;, scale=1.0, address = [26,27]},{ measurement = &quot;power_reactive_b&quot;, name = &quot;value&quot;, byte_order = &quot;ABCD&quot;, data_type = &quot;FLOAT32-IEEE&quot;, scale=1.0, address = [28,29]},{ measurement = &quot;power_reactive_c&quot;, name = &quot;value&quot;, byte_order = &quot;ABCD&quot;, data_type = &quot;FLOAT32-IEEE&quot;, scale=1.0, address = [30,31]},{ measurement = &quot;power_factor_a&quot;, name = &quot;value&quot;, byte_order = &quot;ABCD&quot;, data_type = &quot;FLOAT32-IEEE&quot;, scale=1.0, address = [42,43]},{ measurement = &quot;power_factor_b&quot;, name = &quot;value&quot;, byte_order = &quot;ABCD&quot;, data_type = &quot;FLOAT32-IEEE&quot;, scale=1.0, address = [44,45]},{ measurement = &quot;power_factor_c&quot;, name = &quot;value&quot;, byte_order = &quot;ABCD&quot;, data_type = &quot;FLOAT32-IEEE&quot;, scale=1.0, address = [46,47]},{ measurement = &quot;frequency&quot;, name = &quot;value&quot;, byte_order = &quot;ABCD&quot;, data_type = &quot;FLOAT32-IEEE&quot;, scale=1.0, address = [54,55]},{ measurement = &quot;energy_active_total&quot;, name = &quot;value&quot;, byte_order = &quot;ABCD&quot;, data_type = &quot;FLOAT32-IEEE&quot;, scale=1.0, address = [256,257]},{ measurement = &quot;energy_reactive_total&quot;, name = &quot;value&quot;, byte_order = &quot;ABCD&quot;, data_type = &quot;FLOAT32-IEEE&quot;, scale=1.0, address = [1024,1025]},<br>]</pre><h3>Collecting data from PV inverter</h3><p>Our SMA PV inverter allows to retrieve data from it via a REST API, a cloud service, modbus RTU and modbus TCP. Since I hadn’t used modbus TCP before and the REST API needed a client implementation, I decided to opt for the modbus TCP route.</p><p>First step: add the PV inverter to the network and enable <strong>modbus TCP</strong> in the SMA control panel by opening the control panel as the installer and activating modbus TCP. See the SMA manual for this.</p><p>Second step: get a list of modbus addresses. This should have been easy but took me a while to find the proper document. Here it is: <a href="https://my.sma-service.com/s/article/SMA-Modbus-Interface-SMA-SunSpec-Modbus-Interface?language=en_US">https://my.sma-service.com/s/article/SMA-Modbus-Interface-SMA-SunSpec-Modbus-Interface?language=en_US</a> (scroll to <em>SMA_Modbus-TI-en-15.pdf</em>)</p><p>Now, bring everything together with the following telegraf.confsnippet:</p><pre>[[inputs.modbus]]<br>  name = &quot;SMA&quot;<br>  slave_id = 3<br>  timeout = &quot;5s&quot;<br>  controller = &quot;tcp://a.b.c.d:502&quot;<br>  holding_registers = [<br>    { measurement = &quot;sma_status&quot;, name = &quot;value&quot;, byte_order = &quot;ABCD&quot;, data_type = &quot;UINT32&quot;, scale=1.0address = [30201,30202]},<br>    { measurement = &quot;sma_temperature_derating&quot;, name = &quot;value&quot;, byte_order = &quot;ABCD&quot;, data_type = &quot;UINT32&quot;, scale=1.0 address = [30219,30220]},<br>    { measurement = &quot;sma_total_ac_energy_fed&quot;, name = &quot;value&quot;, byte_order = &quot;ABCDEFGH&quot;, data_type = &quot;UINT64&quot;, scale=1.0 address = [30513,30514,30515,30516]},<br>    { measurement = &quot;sma_daily_ac_energy_fed&quot;, name = &quot;value&quot;, byte_order = &quot;ABCDEFGH&quot;, data_type = &quot;UINT64&quot;, scale=1.0 address = [30517,30518,30519,30520]},<br>    { measurement = &quot;sma_operating_time&quot;, name = &quot;value&quot;, byte_order = &quot;ABCDEFGH&quot;, data_type = &quot;UINT64&quot;, scale=1.0 address = [30521,30522,30523,30524]},<br>    { measurement = &quot;sma_feedin_time&quot;, name = &quot;value&quot;, byte_order = &quot;ABCDEFGH&quot;, data_type = &quot;UINT64&quot;, scale=1.0 address = [30525,30526,30527,30528]},<br>    { measurement = &quot;sma_active_power_total&quot;, name = &quot;value&quot;, byte_order = &quot;ABCD&quot;, data_type = &quot;UINT32&quot;, scale=1.0 address = [30775,30776]},<br>  ]</pre><p>Now just start telegraf and the data is flowing in.</p><p>Well, not actually. It took me a while to find the correct <strong>modbus RTU</strong> and the <strong>modbus TCP</strong> configuration, even with the right documentation. For the interested reader, see the bottom of this article on how to sniff both protocols for debugging.</p><h3>Visualizing the data in Grafana</h3><p>Once the data is being collected, the visualization in Grafana is pretty straightforward. To keep things simple, I used InfluxQL to retrieve the raw data from both the PV panel production and the electricity consumption.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/980/1*J6PrV9AQpXM4AmuzgGHVrQ.png" /><figcaption>Selecting the raw data from InfluxDB with InfluxQL. Query A gets the electricity consumption data. I selected the max() value for each window rather than the default mean, because that gives me a more accurate depiction of peak usage rather than an average. The same goes for query B.</figcaption></figure><p>Next, using Grafana’s <a href="https://grafana.com/docs/grafana/latest/panels/transformations/">transformations</a>, we multiple the energy consumption with -1 to make these values negative so they appear below 0 on the y-axis. Finally, the sum of both values gives a Net Energy use, a line that will indicate when I’m putting power on the net or drawing from it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1014/1*12Dh6EjKqv67Dlr_Uvp9Hw.png" /><figcaption>Two transformations are used. The first multiplication is used to invert the Power Usage on the y-axis. The second to get a view on the net power generation or use.</figcaption></figure><p>Finally, a few series overrides in Grafana hide the original (positive) power usage curve and hides it from the legend and tooltip. Then, the Netto Energy (one of the calculated fields) is drawn without a fill and a wider line thickness.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/518/1*RDYM3H1eeyDjbmRvX1yBvQ.png" /></figure><p>The end result looks like the image above, or like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*bjICHizqJNe44ma8jfKPzg.png" /><figcaption>Green: energy production. Red: energy use. Blue: the difference, put on the grid when above 0 and drawn from the grid when below 0.</figcaption></figure><h3>Calculate how effectively I’m using the energy I’m generating</h3><p>The Grafana visualization above gives a good first impression. But actually, we’re interested in calculating how “self-sufficient” we are.</p><blockquote>What is our level of self-consumption?</blockquote><p>Flux allows me to calculate this, with the following pseudo-code.</p><pre>1. Get raw data in Watt units of measure at original resolution<br>2. Calculate the difference between production and consumption<br>3. Split the data sets on values above and below zero, that is, moments where we&#39;re injecting into or consuming from the electricity grid.<br>4. Integrate all points over time to get KWh units of measure.<br>5. Calculate the ratio of self-consumption.</pre><p>Let’s turn that into an actual script:</p><pre>import &quot;math&quot;</pre><pre>NET_ENERGY = from(bucket: &quot;smarthome&quot;)<br>  |&gt; range(start: v.timeRangeStart, stop: v.timeRangeStop)<br>  |&gt; filter(fn: (r) =&gt; (r._measurement == &quot;sma_active_power_total&quot; and r._value &lt; 7000.0) or r._measurement == &quot;power_active_total&quot;)<br>  |&gt; keep(columns: [&quot;_time&quot;, &quot;_start&quot;, &quot;_stop&quot;, &quot;_value&quot;, &quot;_field&quot;, &quot;_measurement&quot;])<br>  |&gt; pivot(rowKey:[&quot;_time&quot;], columnKey: [&quot;_measurement&quot;], valueColumn: &quot;_value&quot;)<br>  |&gt; fill(column: &quot;sma_active_power_total&quot;, usePrevious: true) // fill some gaps<br>  |&gt; fill(column: &quot;power_active_total&quot;, usePrevious: true) // fill some gaps<br>  |&gt; map(fn: (r) =&gt; ({ r with _value: float(v: r.sma_active_power_total) - r.power_active_total })) // convert int to float and calculate the difference<br>  |&gt; sort(columns: [&quot;_time&quot;], desc: false) // clean it up a little<br>  |&gt; window(every: 1d) // offset at UTC, should be local timezone but unsupported for now (<a href="https://github.com/influxdata/flux/issues/406">https://github.com/influxdata/flux/issues/406</a>)</pre><pre>TOTAL_CONSUMPTION = NET_ENERGY<br>  |&gt; integral(unit: 1h, column: &quot;power_active_total&quot;)</pre><pre>TOTAL_PRODUCTION = NET_ENERGY<br>  |&gt; integral(unit: 1h, column: &quot;sma_active_power_total&quot;)</pre><pre>NET_PRODUCTION = NET_ENERGY<br>  |&gt; map(fn: (r) =&gt; ({ r with _value: if r._value &gt; 0.0 then r._value else 0.0 }))<br>  |&gt; integral(unit: 1h, column: &quot;_value&quot;)</pre><pre>NET_CONSUMPTION = NET_ENERGY<br>  |&gt; map(fn: (r) =&gt; ({ r with _value: if r._value &lt;= 0.0 then math.abs(x: r._value) else 0.0 }))<br>  |&gt; integral(unit: 1h, column: &quot;_value&quot;)</pre><pre>NET = join(tables: {C: NET_CONSUMPTION, P: NET_PRODUCTION}, on: [&quot;_field&quot;, &quot;_start&quot;], method: &quot;inner&quot;)<br>NETTP = join(tables: {N: NET, TP: TOTAL_PRODUCTION}, on: [&quot;_field&quot;, &quot;_start&quot;], method: &quot;inner&quot;)<br>  join(tables: {NTP: NETTP, TC: TOTAL_CONSUMPTION}, on: [&quot;_field&quot;, &quot;_start&quot;], method: &quot;inner&quot;)<br>  |&gt; rename(columns: {_value_C: &quot;net_consumption&quot;, _value_P: &quot;net_production&quot;, power_active_total: &quot;total_consumption&quot;, sma_active_power_total: &quot;total_production&quot;}) // make it more readable<br>|&gt; group() // makes for a nice table in Grafana<br>|&gt; map(fn: (r) =&gt; ({ r with<br>  _error: (r.total_consumption - r.net_consumption) - (r.total_production - r.net_production ), // to check whether our calculations are correct<br>  own_use_ratio: 1.0 - r. net_consumption / r.total_consumption, // to define the percentage of our daily electricity use that we generated ourselves<br>  self_consumption_ratio: 1.0 - r.net_production / r.total_production // to define how much energy we used ourselves from the total amount we generated.<br>}))<br>|&gt; drop(columns: [&quot;_stop_C&quot;, &quot;_stop_NTP&quot;, &quot;_stop_P&quot;, &quot;_stop_TC&quot;]) // clean up our table</pre><p>And add units to our table in Grafana:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/532/1*lb75AyB6wA6vTK_4FiwBeA.png" /></figure><p>The end result is a table that tells us quite a lot:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*usr4_WHRWGSVZd0S1JYEfg.png" /><figcaption>As you can see, on most days this time of year I produce a lot more energy than I use. This is reflected in the bad self consumption ratio. The own use ratio is not that great either, still getting about 50% of energy from the grid.</figcaption></figure><p>To complete this view and calculate the ROI of a home battery, I would need to compare the costs and revenue of having a utility contract with separate injection and usage counters, with the current costs of a ‘prosumer tariff’ in Belgium. For now, I still have an analog meter which basically functions as an infinitely large battery.</p><p>In conclusion, the open source tools I used here have shown their value in being able to build this in just a couple of hours time.</p><h3>Debugging Modbus RTU traffic</h3><p>To debug <strong>modbus RTU</strong> traffic with telegraf, I needed to monitor what data was flowing in and out of the ttyUSB0 serial device. I used socatto achieve this, shamelessly stolen from a blog somewhere.</p><pre>$ socat /dev/ttyUSB0,raw,echo=0 SYSTEM:&#39;tee in.txt | socat - &quot;PTY,link=/tmp/ttyV0,raw,echo=0,waitslave&quot; | tee out.txt&#39;</pre><p>The file in.txt will contain the raw data that was sent to the modbus RTU slave. The out.txt file will contain the raw data replied by the modbus RTU slave.</p><p>Afterwards, you can open both files with a hex editor and see the bytes transferred.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/330/1*r8RE7aEbWh7Sn0PLW1wAPw.png" /><figcaption>Reply by the modbus RTU slave.</figcaption></figure><h3>Debugging Modbus TCP traffic</h3><p>This is easier. I used a simple <a href="https://oceancontrols.com.au/ocs-011.html">modbus debugging tool</a> on a Windows VM running on my Mac and captured the network traffic.</p><pre>sudo tcpdump -s 0 -W 10 -C 10 -w vm.pcap -i en0 tcp port 502</pre><p>Afterwards, the vm.pcap file can be opened with Wireshark to see which commands are sent and how the device replies.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/962/1*pXATKEFeWtT_qTeHIFgp0A.png" /><figcaption>Request to the SMA Modbus TCP device</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/932/1*nHiGgmORJB_JKEk-ObHoRg.png" /><figcaption>Reply by the SMA Modbus TCP device</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=770480136410" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How data historians help reduce energy use in Industry 4.0]]></title>
            <link>https://medium.com/factry/how-data-historians-help-reduce-energy-use-in-industry-4-0-a3f1ae385b7f?source=rss-41ac8faed201------2</link>
            <guid isPermaLink="false">https://medium.com/p/a3f1ae385b7f</guid>
            <category><![CDATA[energy-management-system]]></category>
            <category><![CDATA[industry-4-0]]></category>
            <category><![CDATA[data-historian-market]]></category>
            <dc:creator><![CDATA[Frederik Van Leeckwyck]]></dc:creator>
            <pubDate>Wed, 17 Mar 2021 11:21:36 GMT</pubDate>
            <atom:updated>2021-06-02T06:30:03.844Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_t1bS3w_Qy-xaqqx.png" /></figure><p><strong><em>When buying a data historian, expected ROI comes in the form of improved operations, higher efficiency and reduced downtime. But what if the historian paid for itself, and then — surprise! — generated a number of cascading benefits? In this new blog series, we will explore the unexpected benefits of the data historian. First in line: monitoring and lowering energy use.</em></strong></p><h3>Using a historian for energy monitoring</h3><p>The main reason why businesses start with a process historian is not because they need an energy monitoring solution. It’s because they need <strong>instant, actionable insights</strong> into their production processes. Therefore, process data is gathered and stored in a time series database, and visualised in user-friendly dashboards. This allows them to perform root-cause analysis in real-time, put the data in a historical context and continuously improve operations.</p><p><strong>Yet historians are not limited to collecting and visualising process data</strong>. They will also easily capture and visualise data that is indirectly related to the production process, such as energy or gas consumption, or even process steam usage (e.g. <a href="https://www.factry.io/use-cases/a-s-energie-data-integration-and-data-visualisation/">A&amp;S Energie</a>). In this blog article, we will highlight the historian’s possibilities for <strong>monitoring and lowering energy use</strong>.</p><h3>Why is this needed?</h3><p>Energy consumption is <strong>one of the most substantial costs</strong> in the production industry. Having accurate data on energy consumption for each part of the production line has therefore become a need by itself. Furthermore, in the light of the EU’s 2030 energy efficiency targets, large industrial consumers are <a href="https://ec.europa.eu/energy/topics/energy-efficiency/targets-directive-and-rules/energy-efficiency-directive_en">obliged to audit energy consumption, and formulate initiatives to reduce it</a>.</p><p><strong>The historian enables you to do just that, in the blink of an eye.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ou3zAnxGZbf4Rqtc.png" /></figure><h3>Why not implement a point solution?</h3><p>Let’s say your business wants to start monitoring energy use. You decide to implement a point solution. Works fine. Six months later, you implement an application for production monitoring. Does the trick. Next year, you want to start monitoring your OEE performance. You’re getting the point: <strong>separate point solutions eventually will turn into an unmanageable cesspool of applications</strong>.</p><p>An industrial historian, however, will gather all your data in a <strong>single data management platform</strong>, and will therefore enable you to leverage its power for obtaining a multitude of insights, including energy use, while <strong>keeping your technology stack clean, simple and thus easy to maintain</strong>.</p><h3>Data historians: versatility over complexity</h3><p>Looking for a quick and easy solution for monitoring energy use? This is exactly where the historian proves one of its biggest <strong>unexpected benefits</strong>. Simply place energy meters on any machine you want to monitor, configure the collectors, add the data to a dashboard and you’re set for action. In just a few simple actions, the need for specific energy monitoring software becomes obsolete.</p><p>Through <strong>custom dashboards and reports</strong>, the historian will allow you to:</p><ul><li>Find the biggest energy consumers within your plant or production lines</li><li>Integrate data and link energy usage to production runs, batches, etc.</li><li>Identify energy-related production issues and improvement potential</li><li>Set priorities within a sustainability roadmap, and follow-up on progress</li><li>Drastically lower your plant’s energy use and impact the bottom line</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*kTEu9tgWS0Xt5pwj.png" /></figure><h3>Use case: monitoring and lowering energy use with Factry Historian</h3><p>Once an industrial historian is already in place, leveraging it for energy management becomes an absolute no-brainer. Puratos, one of the world’s largest suppliers of ingredients for the bakery industry, neatly proves this point. After implementing <a href="https://www.factry.io/historian/">Factry Historian</a> on its site in Pennsauken, USA, they immediately started using the software for monitoring energy use.</p><p>Easily built custom dashboards and automated reports offer Puratos both real-time and historical insights on <strong>energy consumption patterns, resource usage, and progress on sustainability efforts</strong>. Plant managers, process engineers or operators can now quickly navigate energy-related data and discover new improvement potential. Without having to leverage any other software tool.</p><p><em>Originally published at </em><a href="https://www.factry.io/blog/how-data-historians-help-reduce-energy-use-in-industry-4.0/"><em>https://www.factry.io</em></a><em> on March 17, 2021.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a3f1ae385b7f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/factry/how-data-historians-help-reduce-energy-use-in-industry-4-0-a3f1ae385b7f">How data historians help reduce energy use in Industry 4.0</a> was originally published in <a href="https://medium.com/factry">Factry</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[UX/UI and why it matters for Industry 4.0 software]]></title>
            <link>https://medium.com/factry/ux-ui-and-why-it-matters-for-industry-4-0-software-938e15400893?source=rss-41ac8faed201------2</link>
            <guid isPermaLink="false">https://medium.com/p/938e15400893</guid>
            <category><![CDATA[industry-4-0]]></category>
            <category><![CDATA[scrum]]></category>
            <category><![CDATA[manufacturing-software]]></category>
            <category><![CDATA[ux]]></category>
            <dc:creator><![CDATA[Frederik Van Leeckwyck]]></dc:creator>
            <pubDate>Wed, 06 Jan 2021 16:42:20 GMT</pubDate>
            <atom:updated>2021-02-08T08:29:16.564Z</atom:updated>
            <content:encoded><![CDATA[<p>In this blogpost, our front-end developer Lumi De Smedt shares her views on UX/UI in today’s industrial environment and lifts the veil on how <a href="https://www.factry.io/blog/ux-ui-and-why-it-matters-for-industry-4.0-software/">UX/UI principles</a> are applied to Factry’s software development process.</p><blockquote><em>Users should be able to switch half of their brains off and still work with the software.</em></blockquote><p>As a front-end developer and UX expert, I mostly work on <a href="https://www.factry.io/use-cases/helioscreen-smart-factory-mes/">client-specific MES applications</a>. Before customers decided to implement our software, they had often been limited to paper or had to rely on outdated systems. It’s up to me to deliver a user interface that works fast, and is both simple and intuitive, regardless of the amount of data that needs to be displayed.</p><p>However, a great user experience is in the eye of the beholder. What is logical to me, does not necessarily feel right to someone else. That is why at Factry, <strong>UX/UI is considered a team effort</strong>. Having different people with various backgrounds around the table proves to be of huge value to the development process, as it enables a more critical and iterative way of thinking.</p><h3>Industrial UX vs. website development</h3><p>In my previous working experience as a developer, part of my job was developing government websites. These websites had to be <strong>easily accessible to different target groups</strong>, including people with disabilities. However the basic context is completely different, this experience still pays off when I am doing UX work for Factry clients today.</p><p>Compared to developing websites for a general audience, building an industrial user interface is just as much about making different screens work in the best way possible for many different people. Through, for instance, setting up a clear and concise information architecture. Or, by providing buttons which are sufficiently large and stand out for the visually impaired.</p><p>The main similarity between website development and industrial UX is that <strong>user demands</strong> are central to the process. The main difference, on the other hand, is that our MES software needs to display a lot more data. I’m not talking about blocks of text, but rather tables and a lot of numbers. This requires a rather specific approach.</p><p><strong>Striking the right balance between instant information and in-depth process insights is crucial</strong>. For the most part, screens are either made for the factory floor or the office environment. In case there is an overlap, information tends to be hidden, depending on its relevance for a specific user. This way, we prevent anyone from getting lost in an information overload.</p><h3>The UX process at Factry</h3><p>UX/UI-focused software development can never be described as a linear process. However, we could roughly break it down into <strong>three phases</strong>, whereby, at the beginning, we try to move from <strong>concept</strong> to <strong>creation</strong> fairly quickly.</p><h3>1. Project requirements &amp; specifications</h3><p>We start by identifying the client’s needs and goals. A large part of that job is carried out by our COO Yves. He talks the whole project through with our clients and translates their needs and the desired software specifications into a detailed technical briefing for the development team.</p><p>As a front-end developer, it is important to fully understand the scope of a project right from the outset. First, we discuss the broad outlines of the project and brainstorm on how the requirements fit into our framework. Once we’re on the same page, it’s up to me to deliver a fresh UX perspective, supported by <strong>continuous interaction with our technical experts</strong>.</p><h3>2. Wireframe &amp; prototype</h3><p>Building a <strong>wireframe</strong> usually starts out with drawing a few simple squares on a sheet of paper. I begin by designing the bigger blocks and try to keep it simple. For me, this process is all about making data easily digestible for users, and getting the balance right between showing too much and too little information.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oiyKWyKqCuNVvDpWyaSD2A.png" /></figure><p>Afterwards, I move on to working in the browser in order to create a digital version. I come up with a few variations, which I then share to my team members for a first review. Once again, as everybody has a different take on things, getting feedback from colleagues is hugely important.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qO5R0iz-bjKyOjWJw0xClA.png" /></figure><p>In a follow-up <strong>client meeting</strong>, we take a screen-by-screen look at the wireframe, during which we find out which buttons should be added, or which ones will probably not be used as much. As developers are not present on the factory floor, these evaluation meetings prove to be extremely useful. Next step in the process is building the <strong>prototype</strong>, i.e., a more detailed user interface.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DFPxtSpS43caeSMmVx0RfA.png" /><figcaption>On this screen, information is provided on a material definition for phosphoric acid. An advanced search function is displayed on the left. On the right, you can find more detailed information, including any material properties.</figcaption></figure><p>Our MES software is browser-based. When creating wireframes and prototypes for a new project, I start to work in browser mode straightaway. Doing so makes clear from the start what a user screen will look like when it is finally introduced on the factory floor.</p><p>Wireframing and prototyping goes beyond design. Another part of my job is to deliver suggestions on UX writing. It’s important everything is phrased in a similar fashion, making sure the user is guided throughout the screens, and not a single button lacks supportive text or icons.</p><h3>3. Feedback &amp; testing</h3><p>As soon as the prototype is wrapped up, it’s time for fresh client feedback. The <strong>software can be tested easily through visiting an URL</strong>, making iteration more efficient. The client can immediately jump into the software, using dummy or even real data, and watch the magic happen in a live environment. A nice improvement to how it used to be.</p><p>Afterwards, we keep in touch with the customer, and continue to interact on matters. Let’s say a button is displayed too small on a tablet device. In that case, the client can quite effortlessly create a support ticket in order to solve the issue. We genuinely take the time to look into every client suggestion. Depending on priorities, iterations can be implemented in a matter of days.</p><h3>The value of a UX style guide</h3><p>When joining Factry in 2019, I mainly focused on improving the branding of our software. Later on, I turned my attention to creating a style guide, as it is the foundation for any solid UX strategy. When multiple developers are working on a single project, guidelines guarantee the style is applied consistently throughout every screen of the software.</p><p>Many frontend developers are incredible perfectionists. I, for one, am no different. The devil is in the detail: spaces around objects should always be identical and pixel-perfect. Buttons should be similar throughout every screen and have the same color, location and accompanying icon.</p><p>Visual uniformity of software benefits anyone who works with it. It allows users to automatically know what to expect when clicking a button, without having to think things through. In fact, it should enable people to turn half their brains off and still use the software.</p><h3>UX &amp; Industry 4.0 in 2021</h3><p>Even though many mobile software applications nowadays are built for very specific purposes, half of them are actually websites. While a fast iteration process has become a standard in the web and mobile app world, industry software has taken a backseat — until now, that is. As the web has increasingly matured, and Industry 4.0 is swiftly catching up on this trend, I’m convinced that industrial businesses will further embrace browser-based software, including modern UX, in 2021.</p><p><em>Originally published at </em><a href="https://www.factry.io/blog/ux-ui-and-why-it-matters-for-industry-4.0-software/"><em>https://www.factry.io</em></a><em> on January 6, 2021.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=938e15400893" width="1" height="1" alt=""><hr><p><a href="https://medium.com/factry/ux-ui-and-why-it-matters-for-industry-4-0-software-938e15400893">UX/UI and why it matters for Industry 4.0 software</a> was originally published in <a href="https://medium.com/factry">Factry</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Process data integration: open source or proprietary software?]]></title>
            <link>https://medium.com/factry/process-data-integration-open-source-or-proprietary-software-f64502128b2e?source=rss-41ac8faed201------2</link>
            <guid isPermaLink="false">https://medium.com/p/f64502128b2e</guid>
            <category><![CDATA[data-integration]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[industry-4-0]]></category>
            <dc:creator><![CDATA[Frederik Van Leeckwyck]]></dc:creator>
            <pubDate>Wed, 23 Dec 2020 06:59:00 GMT</pubDate>
            <atom:updated>2021-02-08T08:45:28.409Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1020/1*v2QQpeOldd3sb5d_la6F8g.jpeg" /></figure><p>In 2018, Belgian yeast supplier Algist Bruggeman replaced its proprietary historian software with Factry’s <a href="https://www.factry.io/historian/">open source-based historian</a>. Next, a custom reporting tool and MES were built on top of the historian, once again with open technology at the core. We asked decision-maker Ivo Lemmens why he chose to switch from proprietary to open source software for industrial data integration.</p><p>“I discovered the world of open source software just a few years ago,” says Ivo Lemmens, the driving force behind the company’s ongoing process automation. “Right then, I started to realise that businesses should look beyond their own little private islands. Surely, process-related software will always be proprietary in one way or another, as no company wants to spill the beans and let everyone in on their production secrets. However, if people start to collaborate more, wonderful things can happen.”</p><h3>What prompted you to implement Factry Historian?</h3><blockquote>We believed that the more data would be available, the more this could work to our advantage.</blockquote><p>The main reason why we started collecting real-time process data using Factry Historian was our desire to get recipe management, process data management, and preventive maintenance up to the top IT layer of production as soon as possible. In particular, because at that level, the biggest progress is being made.</p><p>It’s almost impossible to keep track of every new development and feature. Fortunately, the people at Factry are there to keep me in the loop.”</p><p>Continue reading below the picture.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*bGzYe-4opRvkQQ48.jpg" /></figure><h3>What were some of the other key factors?</h3><p>“I felt very confident about the technology behind it, especially since the <a href="https://www.influxdata.com/">InfluxDB</a> database is considered to be an extremely solid and stable system. It is no coincidence that it is also used by huge organisations such as NASA or IBM. At the same time, the <a href="https://www.grafana.com/">Grafana</a> interface is built with widespread technologies such as HTML, Golang and JavaScript. Few things could go wrong. As it is not rocket science, it did not imply great risks.”</p><blockquote>Factry combines expert knowledge on open technology with a very direct and professional approach, like you would expect from renowned names in the industry.</blockquote><p>“Another key factor was its usability and modern look and feel. The thing with proprietary industrial software is that it lags a bit behind on the fast-evolving IT world, while a smooth user experience is crucial for a good working atmosphere. Working with Factry software often feels like playing a board game: it doesn’t need a lengthy explanation. Through trial-and-error, you can move forward with it and gain experience you can build on.”</p><p>“The people behind the software also played a crucial role in our decision,” Lemmens adds. “We instantly felt like we were on the same page, which turned out to be the case. Factry truly understands the tools and technology they work with; InfluxDB and Grafana are in their blood. Expert knowledge is combined with a direct and professional approach, like you’d expect from renowned names in the industry.”</p><h3>What, for you, was the biggest difference between open and proprietary?</h3><p>“When we still had a proprietary historian running, it was barely used. Even though we had hoped it would be a flexible and accomplished tool, this was not the case. A lot of custom-made software had to be written in order to be able to report the production data we required. Naturally, custom developments were also needed for the open source historian and visualisation tool, but now it is completely tailored to our needs.”</p><h3>Who uses the software, and to which end?</h3><p>“Today, about 25 people work with it on a daily basis, ranging from people at maintenance and production over to floor operators. The software allows them to build custom dashboards of visualisations that are useful to them in a specific context, which makes them very willing to use it. The proof of its success lies in the fact that I get a lot of questions. ‘How would you do this?’, ‘How can you visualise that?’ Two weeks later, I notice they’ve figured out things I hadn’t before, or discovered features that I wasn’t even aware of.”</p><h3>How does that reflect on the working environment?</h3><p>“<strong>Very positively</strong>. The proprietary historian we used before was overly complex. You had to read half the manual before you could actually start doing something. Instead of being held back by a rigid system or static reporting, people now feel encouraged to propose innovations, without having to fear huge costs, and risking the standard ‘no’ to their optimisation requests.”</p><p>Related use case: <a href="https://www.factry.io/use-cases/algist-bruggeman-insight-production-process/">How we helped Algist Bruggeman gain insight in its production process and make better yeast.</a></p><h3>What advice would you give to businesses with similar challenges?</h3><p>“<strong>Just give it a try</strong>. Many great initiatives fall to pieces because they are overwrought or overly engineered. Overthinking it for two years doesn’t bring you any closer to a solution. As the components are open source, you can simply download them online, and start playing around with them immediately. That’s a world away from having an engineer come over to install and parametrise an application, and exactly getting the results you signed up for.”</p><blockquote>In my experience, open source software makes people smarter.</blockquote><blockquote>Ivo Lemmens, Senior Project Manager Automation at Algist Bruggeman</blockquote><p><em>Originally published at </em><a href="https://www.factry.io/blog/process-data-integration-open-source-or-proprietary-software/"><em>https://www.factry.io</em></a><em> on December 23, 2020.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f64502128b2e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/factry/process-data-integration-open-source-or-proprietary-software-f64502128b2e">Process data integration: open source or proprietary software?</a> was originally published in <a href="https://medium.com/factry">Factry</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introducing the Untimely Grafana Panel]]></title>
            <link>https://medium.com/factry/introducing-the-untimely-grafana-panel-7d1ea61e2e3a?source=rss-41ac8faed201------2</link>
            <guid isPermaLink="false">https://medium.com/p/7d1ea61e2e3a</guid>
            <category><![CDATA[process-improvement]]></category>
            <category><![CDATA[industry-4-0]]></category>
            <category><![CDATA[industry]]></category>
            <category><![CDATA[grafana]]></category>
            <category><![CDATA[influxdb]]></category>
            <dc:creator><![CDATA[Frederik Van Leeckwyck]]></dc:creator>
            <pubDate>Tue, 17 Mar 2020 13:48:21 GMT</pubDate>
            <atom:updated>2020-03-17T20:01:28.904Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vJUC9_J8S7k3Slvwfg9ZTA.png" /></figure><p>Industry 4.0 starts with time series data collected from various sensors from production equipment. What is stored is always a combination of a timestamp, sensor value and potentially metadata such as the equipment where the data originated.</p><p>However, when reading values, time is not necessarily the best dimension to obtain insights from the collected data. In particular, we have encountered a couple of use cases where we’d prefer to look at the data from a length perspective instead of time.</p><p>So in this blog post, we’ll describe why we decided to write and release the Untimely Grafana panel for displaying time series data in function of another dimension. It is meant for the reader with a basic understanding of Grafana plugins and ideally with an industrial use case.</p><h3>Where is this useful?</h3><p>We believe this Grafana panel is useful for industries that produce at length, for example in the process industry. Sensors might be placed at the extrusion die or further down the line to measure temperature, thickness, defects or other material properties. In particular, cases we have encountered are:</p><ul><li>Plastic sheet or tube extrusion e.g. for shrink wrap film</li><li>Woven and non-woven textile e.g. looms</li><li>Metal coil processing e.g. rolling and cutting</li></ul><p>The end result looks like this:</p><figure><img alt="Panel of Untimely plugin showing the value of 2 metrics at length 1502 m." src="https://cdn-images-1.medium.com/max/1024/0*SO1o829rrzOz2DvW.png" /><figcaption>Panel of Untimely plugin showing the value of 2 metrics at length 1502 m.</figcaption></figure><h3>Features and known points of improvement</h3><p>The initial release has the following features:</p><ul><li>X-axis reset: useful when dealing with e.g. rolls of a certain length. Each time a new roll is loaded for processing, the distances recorded are reset to 0 at the beginning. This is marked on the x-axis with a downward facing arrow.</li><li>Specifying offset: useful if the sensor is not at the zero position.</li><li>Tooltip when hovering: useful for inspecing values at a certain strip position.</li></ul><p>Known points of improvement:</p><ul><li>The panel rendering speed can be improved, especially the algorithm used to display ticks on the x-axis feels like it can be improved.</li><li>When there are little points in the series used for the x-axis, the resulting graph is not very accurate. There is no linear interpolation as of now.</li><li>The new @grafana/ui package does not export many of the components that are used. Because of this, things like the tooltip had to be reimplemented.</li></ul><h3>How to use it</h3><p>Install the plugin according to the <a href="https://github.com/factrylabs/untimely-grafana-panel">readme</a> on GitHub. Once installed, the panel is available for use.</p><p>Add at least 2 separate queries to a Grafana panel, each representing a single time series, after which you can select the Untimely visualization type and mark which series should be used for the x-axis.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*5F7bcooySFlDRRuo.png" /><figcaption>Grafana query builder shows the addition of multiple metrics, one of which (A in this case) will be used for the X-axis.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Utut56MkV-jbu6ED.png" /><figcaption>Options for the Untimely panel.</figcaption></figure><p>In our case, raw data looked like this:</p><pre>&gt; SELECT max(&quot;value&quot;) FROM &quot;metercounter&quot; WHERE time &gt;= &#39;2019-11-06T04:08:00Z&#39; and time &lt;= &#39;2019-11-06T04:28:00Z&#39; GROUP BY time(1m)<br>name: metercounter<br>time                 max<br>----                 ---<br>2019-11-06T04:08:00Z 0<br>2019-11-06T04:09:00Z 1<br>2019-11-06T04:10:00Z 4<br>2019-11-06T04:11:00Z 6<br>...<br>&gt; SELECT min(&quot;value&quot;) FROM &quot;temperature&quot; WHERE time &gt;= &#39;2019-11-06T04:08:00Z&#39; and time &lt;= &#39;2019-11-06T04:28:00Z&#39; GROUP BY time(1m)<br>name: temperature<br>time                 min<br>----                 ---<br>2019-11-06T04:08:00Z 22.04<br>2019-11-06T04:09:00Z 22.04<br>2019-11-06T04:10:00Z 21.28<br>2019-11-06T04:11:00Z 21.28<br>...<br>&gt; SELECT min(&quot;value&quot;) FROM &quot;draw_speed&quot; WHERE time &gt;= &#39;2019-11-06T04:08:00Z&#39; and time &lt;= &#39;2019-11-06T04:28:00Z&#39; GROUP BY time(1m)<br>name: draw_speed<br>time                 min<br>----                 ---<br>2019-11-06T04:08:00Z 0<br>2019-11-06T04:09:00Z 0<br>2019-11-06T04:10:00Z 2<br>2019-11-06T04:11:00Z 7<br>...</pre><h3>How is this different from other Grafana plugins?</h3><p>Other Grafana panel plugins that display time series data in relation to another dimension are e.g. <a href="https://grafana.com/grafana/plugins/agenty-flowcharting-panel">flowcharting panel</a> or <a href="https://grafana.com/grafana/plugins/natel-plotly-panel">plotly</a>. We initially tried using the latter, but the manufacturing-specific aspects — multiple sensors and distance resets — made us decide to build a separate plugin.</p><h3>Feedback and improve</h3><p>Please feel free to mark your <a href="https://github.com/factrylabs/untimely-grafana-panel/issues">issues</a> or submit a <a href="https://github.com/factrylabs/untimely-grafana-panel/pulls">pull request</a> to make this Grafana panel plugin better.</p><p><em>Originally published at </em><a href="https://www.factry.io/blog/introducing-untimely-grafana-panel/"><em>https://www.factry.io</em></a><em> on March 17, 2020.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7d1ea61e2e3a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/factry/introducing-the-untimely-grafana-panel-7d1ea61e2e3a">Introducing the Untimely Grafana Panel</a> was originally published in <a href="https://medium.com/factry">Factry</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Tutorial: How to build an InfluxDB query using Flux?]]></title>
            <link>https://medium.com/factry/tutorial-how-to-build-an-influxdb-query-using-flux-f44c15961be?source=rss-41ac8faed201------2</link>
            <guid isPermaLink="false">https://medium.com/p/f44c15961be</guid>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[opc]]></category>
            <category><![CDATA[flux]]></category>
            <category><![CDATA[influxdb]]></category>
            <category><![CDATA[industry-4-0]]></category>
            <dc:creator><![CDATA[Frederik Van Leeckwyck]]></dc:creator>
            <pubDate>Tue, 17 Dec 2019 21:45:00 GMT</pubDate>
            <atom:updated>2020-06-23T08:49:46.523Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q6_z6dmJcJJw0bU1fubqtw.jpeg" /><figcaption>This tutorial is about candy! And Flux!</figcaption></figure><h3>An advanced use case for the new Flux query language</h3><p>Process historians are used to gather high-resolution sensor data from industrial controllers like PLCs and SCADA systems. Once the data is collected, it is available for further processing and query building. This blog post describes the use of Flux, a new language for querying InfluxDB, the time series database behind <a href="https://www.factry.io/historian">Factry Historian</a>.</p><p>It is recommended for <strong>advanced readers</strong> with profound technical knowledge.</p><p>Ever since it was first announced in June 2018, we have been eagerly following <a href="https://www.factry.io/blog/flux-real-world-iiot-examples/">the development of the Flux query language</a>. We started experimenting with Flux’s capabilities pretty early on and are now confident that it has matured enough for it to be really useful in a production or manufacturing context.</p><p>However, we think it can be difficult to translate the <em>theoretical</em> documentation into an approach that solves a real-life challenge.</p><p>You can read the case here: <a href="https://www.factry.io/blog/tutorial-how-to-build-an-influxdb-query-using-flux/">https://www.factry.io/blog/tutorial-how-to-build-an-influxdb-query-using-flux/</a></p><p><em>Originally published at </em><a href="https://www.factry.io/blog/influxdb-query-tutorial-and-use-case/"><em>https://www.factry.io</em></a><em> on December 17, 2019.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f44c15961be" width="1" height="1" alt=""><hr><p><a href="https://medium.com/factry/tutorial-how-to-build-an-influxdb-query-using-flux-f44c15961be">Tutorial: How to build an InfluxDB query using Flux?</a> was originally published in <a href="https://medium.com/factry">Factry</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Flux in the industry: 3 real world IIoT examples]]></title>
            <link>https://medium.com/factry/flux-in-the-industry-3-real-world-iiot-examples-1c3da6562870?source=rss-41ac8faed201------2</link>
            <guid isPermaLink="false">https://medium.com/p/1c3da6562870</guid>
            <category><![CDATA[influxdb]]></category>
            <category><![CDATA[factory]]></category>
            <category><![CDATA[iiot]]></category>
            <category><![CDATA[flux]]></category>
            <category><![CDATA[grafana]]></category>
            <dc:creator><![CDATA[Frederik Van Leeckwyck]]></dc:creator>
            <pubDate>Tue, 10 Sep 2019 11:47:00 GMT</pubDate>
            <atom:updated>2019-12-11T10:21:08.893Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4Li62aMip2QklmHrcjSnfQ.png" /><figcaption>Analog pressure gauge.</figcaption></figure><p>We have been using InfluxDB in an industrial setting since 2016. This started with the development of an <a href="https://coussej.github.io/2016/04/18/Building-An-Open-Source-Process-Historian/">open-source OPC-UA collector</a>, which is used across the globe. The OPC-UA protocol is important in the industrial setting since it can be used to gather sensor data, a form of time series data. Sensor data is collected from manufacturing equipment via programmable logic controllers (PLCs) and the supervisory control and data acquisition (SCADA) systems and then stored into InfluxDB. The sensor data includes measurements collected from equipment that help to ensure that the manufacturing process is running effectively.</p><p>Once in InfluxDB, the data is set to be visualized. This is the most common use case for manufacturers — the ability to see all sensor data, centrally in one location.</p><p>One of the first meetings I attended after joining Factry was with a food producer in Belgium who said to me, “If you can’t visualize it, you can’t understand it.” And while I do not necessarily agree, it touches upon the fact that if we can properly visualize an event, it becomes much easier to understand and make sense of the said event. When we analyze time series data, what we seek are new insights from the data, not just the data itself.</p><p>So in this post we describe 3 real-world cases where Flux brings new and meaningful insights into time series data collected from industrial equipment, ultimately supporting improved decision making.</p><h3>First some context</h3><p>We’ve thus received positive responses from engineers and operators regarding the functionality of InfluxQL, InfluxDB’s query language, in an industrial context. With the help of Grafana’s excellent query editor, in their dashboarding product, it’s easy to use, easy to learn and very readable. Despite this, advanced functionality was often lacking because the context was missing.</p><p>What do we mean by context? Imagine you’re sitting in a history class and you’re learning about event X in the year 1721, event Y in 1857 and so on. This history class is boring because all you’re being taught are dates and times of events, in order. This is comparable to time series data — data presented by date and in sequential order.</p><p>Imagine now that instead of learning just the dates and times, you receive information about the people that lived at that time, how they thought, what their days looked like, what their surroundings looked like, etc. This is context. This information provides you the context behind the history and behind the events, so now you can start understanding why people made the decisions they made. While the dates and times are important, an understanding of the people, the time periods and the events teach you so much more. Similarly, time series data is crucial but it is far more informative when coupled with contextual data and vice versa.</p><p>In an industrial setting, there are two levels of context seen from a technical perspective. The first level derives context from other data that is available in the time series data database. Examples of this include knowing that the value of a sensor only matters when a machine is in production and not in maintenance. Another example consists of calculating the difference between two pressure sensors at the beginning and end of a process. In short, this boils down to the functionality that was missing in the versions of InfluxDB prior to the introduction of their new query language, Flux. Flux comes with the ability to perform math across measurements (measurements are the container of the time series collected).</p><p>The second level of functionality comes from integration with other IT systems in a manufacturing context, typically described as the manufacturing execution system, or the MES-layer. Knowing the pressure or temperature evolution of a certain sensor in a machine tells you something, but it will tell you a lot more if you know what product was being produced, which operator was responsible for the line, what shift it was, what the machine’s setpoints were set to, etc. This information is typically present in other software and databases that support the manufacturing process. As this is often relational data, this currently falls out of scope with what we have currently achieved with Flux. But Flux will bring us the ability to bring multiple data sources together, so we anticipate interesting things to come.</p><h3>Examples of Flux and math across measurements in industry</h3><p>With InfluxDB and Flux, we’ve been able to extract more insights and value out of the time series data we collect. We will review a few use cases mentioned above, in more detail.</p><h3>Use case 1: Calculating pressure drop across a filter</h3><p>A company with a water purification system needs to determine when they should replace filters used in the purification process. They can physically walk up to the filter (if accessible) and inspect the filter to determine if it needs to be replaced or they can rely on data. In the graph below, the top panel shows the water pressure measurement collected at the input and the panel below that shows the water pressure measurement collected at the output. If you take the difference between the two measurements, you can see the pressure difference increase over time. This is depicted below. With this data, you can see that when the pressure drop exceeds a certain threshold, the filter needs to be replaced.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*D9SNpFo0XeoHEY4x.png" /></figure><p>Raw pressure sensor data from PT01 (Pressure Transmitter 01) on the input side before the filter is plotted above. PT02 on the output side. The calculated pressure difference is plotted in the bottom graph.</p><p>The Flux query to achieve this:</p><pre>// Create a generic function that can be reused to compute the 3m average avg3m = (measurement) =&gt; from(bucket: &quot;historian&quot;)<br>  |&gt; range(start:2018-05-01T23:30:00Z, stop: 2018-05-23T00:00:00Z)<br>  |&gt; filter(fn: (r) =&gt; r._measurement == measurement)<br>  |&gt; aggregateWindow(every: 3m, fn: mean)</pre><pre>// Use the function we just defined to get the data for the first<br>// and second pressure transmitters<br>pt01 = avg3m(measurement: &quot;PT01&quot;)<br>pt02 = avg3m(measurement: &quot;PT02&quot;)</pre><pre>// Join data and calculate the pressure drop<br>join(tables: {pt01:pt01, pt02:pt01}, on: [&quot;_time&quot;])<br>  |&gt; map(fn: (r) =&gt; ({ _time: r._time, _pressureDrop: r._value_pt01 - r._value_pt02 }))<br>  |&gt; aggregateWindow(columns: [&quot;_pressureDrop&quot;], every: 1h, fn: mean) // to smoothen the graph a bit</pre><h3>Use case 2: Sensor values in the context of a machine state</h3><p>In some cases, you might have a machine that runs 24⁄ 7 but is only doing meaningful work some of the time. We often encounter this with discrete workstations, for example, Computer Numerical Control (CNC) machines. In these cases, you might only be interested in the values of certain sensors given that the machine is in a state of “production” and not in the state of “waiting for operator input” or “maintenance.” In this case, we’re adding context (i.e. the machine state). Let’s construct this graph in four steps.</p><p><strong>Step 1</strong>: First, we retrieve the raw machine status. This is different for every machine, as is the way each machine is programmed by the supplier or automation partner. In this case, we have over 200 status codes. As such, the resulting graph is pretty meaningless by itself.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*OwMCXHbY9WK1XiKM.png" /></figure><p>Raw Status Codes from the Machine</p><p>The Flux query to achieve this:</p><pre>// Retrieve status data. We&#39;re not downsampling here because status codes are only written to the database on change, which means this is a very small dataset.<br>from(bucket: &quot;historian&quot;)<br>  |&gt; range(start: dashboardTime, stop: upperDashboardTime)<br>  |&gt; filter(fn: (r) =&gt; r._measurement == &quot;Status&quot;)</pre><p><strong>Step 2</strong>: Each status code represents a certain machine state. In our case, we’re only interested in status codes 5 and 10, because they represent the machine being in production. All other codes are irrelevant for our use case. So, let’s map these raw status codes to 1 when the machine is in production and 0 in all other cases.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ix1D8QXNKdTJUL36.png" /></figure><p>Mapped Status Codes</p><p>The Flux query to achieve this:</p><pre>Status = from(bucket: &quot;historian&quot;)<br>  |&gt; range(start: dashboardTime, stop: upperDashboardTime)<br>  |&gt; filter(fn: (r) =&gt; r._measurement == &quot;Status&quot;)<br>  |&gt; map(fn: (r) =&gt; ({_time: r._time, _status: float(v: contains(value: int(v: r._value), set: [5,10])}), mergeKey: false) // map to 0 or 1<br>// The statements below could probably be optimized. They work for our use case but should be improved.<br>// Because the raw status code is only written to the database on change but we want to join on time later, we need to create time windows and fill these with the last known 0 or 1. So, we first create this windows with averages between 0 and 1.<br>  |&gt; aggregateWindow(every: 30s, fn: mean, columns: [&quot;_status&quot;], createEmpty: true)<br>// Then we fill the empty windows with the previous values.<br>  |&gt; fill(column: &quot;_status&quot;, usePrevious: true) // We don&#39;t have a previous value at the beginning of our time window, so we cheat by filling it with 0. Ideally, we would fill with the last status value that falls just outside the start: dashboardTime range.<br>  |&gt; fill(column: &quot;_status&quot;, value: 0.0)<br>// Every window that contains a status &gt; 0 should be categorized as &quot;in production&quot;.<br>  |&gt; map(fn: (r) =&gt; ({_time: r._time, _status: math.ceil(x: r._status)}), mergeKey: false)</pre><p><strong>Step 3</strong>: Retrieve the raw sensor data. This is standard Flux functionality.</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*b31hiO4ynbDLRrXWEFF4aQ.png" /></figure><p>We notice noise on the sensor between 17:00 and 18:30. This is because the machine is switched on but not in production. As such, these values are meaningless to us.</p><p>The Flux query to achieve this:</p><pre>NTU = from(bucket: &quot;historian&quot;)<br>  |&gt; range(start: dashboardTime, stop: upperDashboardTime)<br>  |&gt; filter(fn: (r) =&gt; r._measurement == &quot;S01&quot;)<br>  |&gt; aggregateWindow(every: 30s, fn: mean)<br>  |&gt; keep(columns: [&quot;_value&quot;, &quot;_time&quot;]) // Like in Step 2, we first fill with previous and finally 0 at the beginning of our time window<br>  |&gt; fill(column: &quot;_value&quot;, usePrevious: true)</pre><p><strong>Step 4</strong>: Finally, we’re ready to put all of the pieces together. From Step 2, we have 0/1 data telling us when the machine is in production and when it is not. From Step 3, we have the raw sensor data. Now, let’s bring these data sets together by joining them. The resulting graph shows us the sensor values when the machine is in production status.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vggA_1busDV-XCcj.png" /></figure><p>The raw sensor data, in the context of the machine being in production status.</p><p>The Flux query to achieve this:</p><pre>Sensor = from(bucket: &quot;historian&quot;)<br>  |&gt; range(start: dashboardTime, stop: upperDashboardTime)<br>  |&gt; filter(fn: (r) =&gt; r._measurement == &quot;S01&quot;)<br>  |&gt; aggregateWindow(every: 30s, fn: mean)<br>  |&gt; keep(columns: [&quot;_value&quot;, &quot;_time&quot;])<br>  |&gt; fill(column: &quot;_value&quot;, usePrevious: true)<br>  |&gt; fill(column: &quot;_value&quot;, value: 0.0)</pre><pre>Status = from(bucket: &quot;historian&quot;)<br>  |&gt; range(start: dashboardTime, stop: upperDashboardTime)<br>  |&gt; filter(fn: (r) =&gt; r._measurement == &quot;Status&quot;)<br>  |&gt; map(fn: (r) =&gt; ({_time: r._time, _status: float(v: contains(value: int(v: r._value), set: [5,10])}), mergeKey: false)<br>  |&gt; aggregateWindow(every: 30s, fn: mean, columns: [&quot;_status&quot;], createEmpty: true) |&gt; fill(column: &quot;_status&quot;, usePrevious: true)<br>  |&gt; fill(column: &quot;_status&quot;, value: 0.0)<br>  |&gt; map(fn: (r) =&gt; ({_time: r._time, _status: math.ceil(x: r._status)}), mergeKey: false)</pre><pre>join( tables: {n:Sensor, s:Status}, on: [&quot;_time&quot;] )<br>  |&gt; map(fn: (r) =&gt; ({ _time: r._time, // All raw sensor values get multiplied by 0 when the machine is not in production _filteredValue: r._value * r._status }))<br>  |&gt; yield()</pre><h3>Use case 3: Calculating the error between a forecast and the measured value</h3><p>A third and final use case involves calculating the mean absolute error (MAE) to score the accuracy of a forecast compared to the measured values. This could be helpful in cases where your service is dependent on weather forecasts, for example. This formula returns a single value.</p><p>The MAE is calculated as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/346/0*mkqTi2bw3XakkM6r.png" /></figure><p>The Flux query to achieve this:</p><pre>WINDSPEED = from(bucket: &quot;meteo&quot;)<br>  |&gt; range(start: dashboardTime, stop: upperDashboardTime) // same window from which we have forecast data<br>  |&gt; filter(fn: (r) =&gt; r._measurement == &quot;WindSpeed&quot;)<br>  |&gt; aggregateWindow(every: 10m, fn: mean)<br>  |&gt; keep(columns: [&quot;_value&quot;, &quot;_time&quot;])<br>  |&gt; fill(column: &quot;_value&quot;, value: 0.0) // fill nulls (in the future) with 0<br>  |&gt; map(fn: (r) =&gt; ({_time: r._time, _real: r._value})) // map value column to new name</pre><pre>WINDSPEED_FORECAST = from(bucket: &quot;meteo_forecast&quot;)<br>  |&gt; range(start: dashboardTime, stop: upperDashboardTime)<br>  |&gt; filter(fn: (r) =&gt; r._measurement == &quot;WindSpeed&quot;)<br>  |&gt; keep(columns: [&quot;_value&quot;, &quot;_time&quot;])<br>  |&gt; aggregateWindow(every: 10m, fn: mean)<br>  |&gt; fill(column: &quot;_value&quot;, usePrevious: true)<br>  |&gt; fill(column: &quot;_value&quot;, value: 0.0)<br>  |&gt; map(fn: (r) =&gt; ({_time: r._time, _forecast: r._value}))</pre><pre>RES = join(tables: {curr: WINDSPEED, forecast: WINDSPEED_FORECAST}, on: [&quot;_time&quot;], method: &quot;inner&quot;)</pre><pre>NUMERATOR = RES |&gt; map(fn: (r) =&gt; ({_time: r._time, _diff: math.abs(x: r._forecast - r._real)}))<br>  |&gt; sum(columns: [&quot;_diff&quot;])</pre><pre>DENOMINATOR = RES |&gt; count(columns: [&quot;_real&quot;])</pre><pre>MAE = join(tables: {num: NUMERATOR, denom: DENOMINATOR}, on: [&quot;_start&quot;], method: &quot;inner&quot;)<br>  |&gt; map(fn: (r) =&gt; ({_value: float(v: r._diff) / float(v: r._real)}))</pre><pre>MAE |&gt; yield()</pre><h3>Some remarks</h3><p>The primary drawback we’ve encountered is the trade-off between functionality and simplicity, at least to the casual, non-technical user. While we see InfluxQL in Grafana as a piece of functionality that is easily taught to non-technical people in an industrial context, this is much less the case with Flux.</p><p>Members of the community can take steps in mitigating this drawback by providing examples, such as the ones described in this post, which others can build on. Furthermore, the extensibility of Flux will make it possible to build predefined functions to cover the most common use cases encountered in the manufacturing world.</p><h3>In conclusion</h3><p>We’re sure we will encounter more use cases for Flux as functionality becomes more readily available and the language becomes more widely supported.</p><h3>Want to know more?</h3><p>Factry is hosting the 3rd Time Series Belgium meetup on November 13th, 2019, with talks about Flux and other uses of time series databases. Sign up for free on the <a href="https://www.meetup.com/Time-Series-Belgium">meetup page</a>.</p><p><em>Originally published at </em><a href="https://www.factry.io/blog/flux-real-world-iiot-examples/"><em>https://www.factry.io</em></a><em> on September 10, 2019.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1c3da6562870" width="1" height="1" alt=""><hr><p><a href="https://medium.com/factry/flux-in-the-industry-3-real-world-iiot-examples-1c3da6562870">Flux in the industry: 3 real world IIoT examples</a> was originally published in <a href="https://medium.com/factry">Factry</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why operator involvement is key to Industry 4.0]]></title>
            <link>https://medium.com/factry/why-operator-involvement-is-key-to-industry-4-0-ef7b4a4ab9e5?source=rss-41ac8faed201------2</link>
            <guid isPermaLink="false">https://medium.com/p/ef7b4a4ab9e5</guid>
            <category><![CDATA[industry]]></category>
            <category><![CDATA[motivation]]></category>
            <category><![CDATA[manufacturing]]></category>
            <category><![CDATA[industry-4-0]]></category>
            <category><![CDATA[management]]></category>
            <dc:creator><![CDATA[Frederik Van Leeckwyck]]></dc:creator>
            <pubDate>Mon, 18 Sep 2017 06:01:01 GMT</pubDate>
            <atom:updated>2017-09-18T06:45:01.593Z</atom:updated>
            <content:encoded><![CDATA[<p>Ever since the term Industry 4.0 was coined in 2011, it has taken the world of manufacturing by storm. Business and market drivers like production reshoring converge with technological advances such as ever cheaper sensors. Even though lots of attention is going to the technologies that enable Industry 4.0, the importance of employee involvement in general and operator involvement in particular is greatly underappreciated.</p><p>As a consequence, operations managers are at risk of outpacing the adaptive capacity of their operators, resulting in a state-of-the-art manufacturing apparatus with uninvolved and unmotivated operators to run it. Additionally, long-term absenteeism numbers rise year after year. In Belgium, an average of <a href="https://overheid.vlaanderen.be/bedrijfsinformatie/ziekteafwezigheidspercentage">7% of employees</a> was absent in 2016 on any given working day, with 3% in total being absent for longer than a year.</p><p>In contrast, highly motivated and involved employees are <a href="https://www.sdworx.be/nl-be/sd-worx-r-d/blog/hr-management/drijfveren-voor-engagement">50% less likely</a> to be absent from work and are 13% more productive.</p><p>Management is aware of this challenge. Philipp Ramin, CEO of <a href="https://www.i40.de/">I40.de</a>, the German Innovation center for Industry 4.0, recently polled an audience of Industry 4.0-practitioners on the question “What are the main challenges behind industry 4.0?”. With 34 responses in total, the answer “to get the employees involved” received the most votes, followed by “to adapt the current business model” and “to get the necessary knowledge”. Counterintuitively, finding money and the right technology appear to be the least of their worries.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FQfXPiRQ46PAO6dn-YJExg.png" /><figcaption>Poll question: What are the main challenges for Industry 4.0? Source: Philipp Ramin, “Industrie 4.0: What’s in it for me?”, I40.de</figcaption></figure><p>In this article, we focus on the challenge of employee involvement. As President Kennedy once said in his infamous Moon Speech: “Not because it is easy, but because it is hard”.</p><blockquote>Michelin’s future plants will be considerably different from those of today. But we must always — and even more and more — build them around man.</blockquote><blockquote>Dominique Foucard, Head of Industrial Performance at Michelin</blockquote><h3>The importance of goal setting for employee involvement</h3><p>Already in 1968, the psychologist Frederick Herzberg described the role of employee involvement on job satisfaction in his Two-Factor Theory. According to the theory, high involvement can be stimulated by giving employees a sense of performance, recognition, growth and achievement. All of these so-called satisfiers can be stimulated by goal setting.</p><p>Goal setting still is a crucial aspect of heightened operator involvement according to Cédric Velghe and Maxime Loose from Ghent University’s spin-off <a href="http://vigorunit.com/">The VIGOR Unit</a>. In this context, they define it as giving operators the ability to set manufacturing goals in consultation with their peers and superiors.</p><p>Interestingly however, goal setting in and of itself is not primarily driving increased operator motivation. Instead, the motivational aspect comes from having the possibility to regularly and independently monitor the progress towards the goal you set yourself; aptly named feedback-seeking behaviour.</p><p>Unfortunately, I too often see poorly implemented feedback mechanisms. Monthly feedback systems are not unheard of. Naturally, you cannot expect an operator to be thoroughly involved in the production performance of two months ago.</p><p>In summary, it is crucial for operational performance to master the use of feedback through goal setting and accompanying feedback-seeking behaviour. The implications and benefits are numerous:</p><ol><li>Operators have the opportunity to extend their job description and content, which is proven to further benefit job involvement and, correspondingly, motivation. Furthermore, goals should not always have to be production-related; especially for your most experienced operators.</li><li>Operations can more easily spot where and why production is lacking, allowing for ample time to take corrective action on the short and longer term. This requires the instillment of a culture where not meeting goals is not automatically linked to repressive action.</li><li>It creates the opportunity to introduce a competitive edge in the team. Care must be taken however to not let <em>gamification</em> of the job take on <a href="http://www.bbc.com/future/story/20121204-can-gaming-transform-your-life">perversive results</a>.</li><li>Goals can be regularly adapted in order to meet the acute needs of the organization. In doing so, they will probably increase job satisfaction even more, as mentioned in the first point.</li></ol><blockquote>Motivation is a result of the ability to regularly and independently monitor your progress towards the goal you have set yourself.</blockquote><h3>Operator motivation in Industry 4.0</h3><p>Within Lean Manufacturing, the <em>Performance Board</em> is a well-known tool that serves to inform everyone on the state of production by displaying progress towards set goals. Ideally, the board is readily available by placing it conveniently in the production hall and by presenting the metrics in such a way that they are easily understood. Mostly, shift supervisors gather data from different information systems manually to complete the board at the beginning of the day or shift.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nh86er6kMP277N-u_9HWhA.jpeg" /></figure><p>In theory, this performance board gets the job done of providing regular feedback, even though it is labour intensive to keep it up to date and relevant. In practice however, many of these boards get buried over time in general announcements, safety warnings, old and irrelevant metrics. When this is the case, the board essentially becomes useless. In addition, due to the limited size of the board, the information on it is often the result of a trade-off between individual and company relevance.</p><p>With the onset of Industry 4.0 and the accompanying increased availability of data, the time is right to bring the performance board into the modern day.</p><p>On site level, real-time dashboards have the potential to replace the performance board by bringing the most up to date and relevant information into full view and into perspective.</p><p>While this seems like a trivial step at first, information silos prevent this aggregated view. Lots of effort is still needed to centralize and contextualize relevant data, commonly referred to as horizontal and vertical data integration.</p><p>We envisage further individualisation of real-time dashboards to facilitate regular and independent progress monitoring by the operators, enabling their goal-setting and feedback-seeking behaviour. Once data is centrally available, dashboards per production line or machine are not far off. Even truly individual dashboards are within reach.</p><p>To be fair, with overly automated data interpretation comes the danger of operators overlooking it, as they loose touch with it. Care must be taken to avoid this by making sure the information is relevant and correct at all times.</p><h3>1–2–3 Go!</h3><p>To enable operators’ goal-seeking behaviour, companies first need to lay the foundations by setting up initiatives to <a href="http://www.factry.io/?utm_source=medium&amp;utm_medium=blog%20link&amp;utm_campaign=operators_key_industry40">gather and contextualize data</a> from different systems in production.</p><p>Secondly, motivating operators through goal setting requires a cultural shift towards feedback-driven management. Operators should be given the freedom to set their goals, directly related to manufacturing output or otherwise, in consultation with their superiors and colleagues.</p><p>Finally, the cultural shift can be sustained by giving operators the tools to enable, sustain and encourage their feedback-seeking behaviour by accessing data and information when they need it. Even better, they should be involved in designing and developing such tools.</p><p>Operator involvement is a hard challenge but one we should not be willing to postpone. Industry 4.0 will only work if we manage to align people and technology.</p><p>Thanks to <a href="https://www.linkedin.com/in/lucdecleir/">Luc De Cleir</a> for his constructive feedback on the article.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ef7b4a4ab9e5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/factry/why-operator-involvement-is-key-to-industry-4-0-ef7b4a4ab9e5">Why operator involvement is key to Industry 4.0</a> was originally published in <a href="https://medium.com/factry">Factry</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>