Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation since 11/05/2022 in Posts

  1. Hi Coolhunter, I have seen this requested multiple times and one solution might be to use a custom PI Vision symbol that enables you to embed Seeq content into PI Vision. A solution to this challenge can be found here: Get the most out of PI Vision - Seeq Analytics in PI Vision - Seeq in PI Vision (werusys.de) If you want to know more about the PI Vision integration with Seeq feel free to drop me a mail: julian.weber@werusys.de Cheers, Julian Seeq-WerusysPIVision.pdf
    2 points
  2. Hello Kemi, Thank you for your question. This chart can be created as follows; 1. Calculate the moving range in the formula tool; abs($signal.runningDelta()) 2. Create the monthly condition using Identify > Periodic Condition tool and select a monthly duration. 3. Use Quantify > Signal from Condition tool to find the average moving range over each month. This is “CL” as shown in the video. 4. In the formula tool, calculate the UCL parameter as follows 3.268*$average_movingrange Alternatively, create a new Signal from Condition to calculate the standard deviation of the moving average, and in formula use the following; 3*$stddev_movingrange 5. Add the signals to one lane and align their y-axis. We also have a very comprehensive blog post on creating a Control Chart and applying SPC run rules which may be of interest to you.
    1 point
  3. Was this a duplicated analysis? If so, I suspect that the IDs you're seeing are associated to items that couldn't be cloned successfully. If this is the case, you should find a journal in the (new) first worksheet of the cloned analysis, which will list items that couldn't be cloned successfully for some reason. Often this has to do with permissions. These items are created in the cloned analysis, but they're assigned placeholder IDs that are serial numbers preceded by an appropriate number of 0s to make a GUID. If that's what happened here, examining the journal on the first worksheet of the analysis should provide clues as to what needs to be fixed before a subsequent attempt at duplication.
    1 point
  4. Summary: Many of our users monitor process variables on some periodic frequency and are interested in a quick visual way of noting when a process variable is outside some limits. Perhaps you have multiple tiers of limits indicating violations of operating envelopes or violations of operating limits, and are interested in creating a visualization like that shown below. Solution: Method 1: Boundaries Tool One method to do this involves using the boundaries tool. This tool is discussed in Step 3 of this seeq.org post, and results in a graphic like that shown below. Some frequently asked questions around the above method are: Is there a way to make the different levels of boundaries different colors? Is there a way to color the section outside of the limits rather than inside of the limits? Method 2: Scorecard Metrics in Trend View Step 1. Load the signal you are interested in monitoring as well as the limits into the display pane. The limits can be added directly from the historian, or if they do not exist in the historian they can be created using Seeq Formula. Step 2. Open a new Scorecard Metric from the tools panel, create a simple scorecard metric on your signal of interest, with no statistic. Click the "+" icon to optionally enter thresholds, and add the threshold color limits that you are interested in visualizing. Note that the thresholds input in the boundary tool can be constant (entering a numeric value) or variable, selecting a signal or scalar.
    1 point
  5. The third example in your documentation image seems to be the equivalent... It's pretty evident why .setProperty() was enhanced! Until your server is upgraded, you'll likely have to use that $condition.transform() method to add signal-referenced, statistical property values to capsules.
    1 point
  6. When anything is deleted in Seeq, the Archived property gets set to "true". You can use API reference and POST Archived as "false" property. Check out this screenshot on how to do so. You can also do this programatically using SDK as shown in this post:https://www.seeq.org/index.php?/forums/topic/1291-how-to-use-the-seeq-apisdk-in-pythonseeq-data-lab/
    1 point
  7. Using formulas with trended data (temperature) I created a signal representing the density of a fluid in a vessel. I have reason to believe ambient conditions are impacting the temperature of the liquid inside of a level bridle thus changing the liquid properties. Using level measurements in the vessel and level bridle and the density/ specific gravity calculated for the liquid in the vessel (based on actual vessel temperature) I was able to calculate the density/ SG of the of the liquid in the level bridles based on the variation in level measurement. The equation for density is fairly complicated so manipulating the equation solving for temperature isn't a realistic option for me. Is there a way to have Seeq calculate/ trend a signal representing the temperature when I have a signal representing the solution (density) with temperature being the only variable? The equation I'm working with is shown below. I have the values for all of the constants and I'm wanting Seeq to calculate the value of T.
    1 point
  8. Seeq has functions to allow easy manipulation of the starts and ends of capsules, including functions like afterStart(), move(), and afterEnd(). One limitation of these functions is that they expect scalar inputs, which means all capsules in the condition have to be adjusted by the same amount (e.g. move all capsules 1 hour into the future). There are cases when you want to adjust each capsule dynamically, for instance using the value of a signal to determine how to adjust the capsule. Solution: This post will show how to accomplish a dynamic / signal-based version of afterStart(). This approach can be modified slightly to recreate other capsule adjustment functions. Assume I have an arbitrary condition 'Condition', and signal 'Capsule Adjustment Signal'. I want to find the first X hours after each capsule start, where X is the value of 'Capsule Adjustment Signal' at the capsule start. I can do this with the below formula. $condition .afterStart(3h) // has to be longer than an output capsule will ever be .transform($capsule -> { $newStartKey = $capsule.startKey() $newEndKey = $capsule.startKey() + $signal.valueAt($capsule.startKey()) capsule($newStartKey, $newEndKey) }) This formula only takes two inputs: $condition, and $signal. This formula goes through each capsule in the condition, and manipulates its start and end keys. In this case, the start key is the same as the original, but the new end key is set to the original start key plus the value of my signal. This formula produces the following purple condition: Some notes on this formula: The output capsules must be within the original capsules. Therefore, I have included .afterStart(3h) in the formula. This ensures the original capsules will always be larger than the outputted capsules. If you don't do this, you may see the following warning on your item, which indicates the formula is throwing away capsules: Your capsule adjustment signal must have units of time To accomplish other capsule adjustments, look at changing the definitions of the $newStartKey and $newEndKey variables to suit your needs.
    1 point
  9. Webhooks are a convenient method to send event data from Seeq to “channel” productivity tools such as Microsoft Teams or Slack. The following post describes how Seeq users can leverage Seeq Data Lab to send messages directly to MS Teams via Webhooks. Pre-Requisites: 1) Seeq Data Lab with Scheduled Notebooks enabled a. See Administration Panel -> Configuration and filter for “Features/DataLab/ScheduledNotebooks/Enabled” 2) MS Teams Channel with a Webhook Connector Assumptions: 1) Summary of capsules generated in a defined time range (i.e., every 12 or 24 hours) 2) Notifications are not near-real-time – script will run on a pre-defined schedule generally measured in hours, not minutes or seconds 3) Events of interest are contained in an Asset Tree or Group with one or more Conditions Step 1: Configure Webhook in MS Teams To send Seeq capsules/events to MS Teams, a Webhook for the target channel needs to be created. Detailed instructions on how to configure Webhooks in MS Teams can be found here: https://learn.microsoft.com/en-us/microsoftteams/platform/webhooks-and-connectors/how-to/add-incoming-webhook For the purpose of this post, we will create a Webhook URL in our “Seeq Notifications” Team to alert on Temperature Excursions. The alerts will be posted in the “Cooling Tower Temperature Monitoring” channel. Teams and Channel names can be configured to fit your need/operation, this is just an example for demonstration purposes: MS Teams will generate a Webhook URL which we will use in our script in Step 4. Step 2: Identify or Create an Asset Group or Asset Tree to define the Monitoring Scope To scope the events of interest, we will use an Asset Tree that contains “High Temperature” conditions for a collection of Monitoring Assets. While this is not a requirement for using Webhooks, it helps with scaling the Notification workflow. It also allows us to combine multiple Conditions from different Assets into a single workflow. To learn how create an Asset Tree, follow the “Asset Trees 1 – Introduction.ipynb” tutorial in the SPy Documentation folder contained in each new Seeq Datalab project. The script for the Monitoring Asset Tree used in this post is attached for reference: Monitoring Asset Tree.ipynb Alternatively, Asset Groups can be also used to create an asset structure directly in Workbench without using Python: Once the Asset Group/Tree containing the monitoring Conditions is determined, create a Worksheet with a Treemap or Table overview for monitoring use: Make note of the URL as it will be included in the Notification as a link to the monitoring overview whenever an event is detected. For locally scoped Asset Groups or Trees, it will also inform the script where to look for Conditions. Step 3: Install the “pymsteams” library in Seeq Datalab The pymsteams library allows users to compose and post messages (or cards) to MS Teams. The library can be installed from the pypi repository (pypi.org) using the “pip install” command. 1) Open a Seeq Datalab Project 2) Launch a Terminal session 3) Install the pymsteams library by executing pip install pymsteams Additional documentation on pymsteams can be found here: https://pypi.org/project/pymsteams/ Step 4: Create or Update the Monitoring script We are now ready configure a monitoring script that sends notifications to the Webhook configured in Step 1 using Conditions scoped to the Asset Tree in Step 2. a) Import the relevant libraries, including the newly installed pymsteams library import pandas as pd from datetime import datetime,timedelta import pytz import pymsteams b) Configure Input Parameters #Refer to Microsoft Documentation on how to configure a Webhook for a MS Teams channel webhook_url='YOUR WEBHOOK HERE' #Specify the monitoring workbook - this is where the alert will link with the associated timeframe monitoring_workbook_url='YOUR WORKBOOK HERE' #Specify the asset tree and associated condition for which the webhook should be triggered asset_tree='Compressor Monitoring' monitoring_condition='High Temperature' #Specify the lookback period and timezone to search for capsules lookback_interval_hours=24 timezone=('US/Mountain') c) Search for Event Capsules #Set time range to look for new conditions delta=timedelta(hours=lookback_interval_hours) end=datetime.now(tz=pytz.timezone(timezone)) start=end-delta #Parse the workbook information workbook_id=spy.utils.get_workbook_id_from_url(monitoring_workbook_url) worksheet_id=spy.utils.get_worksheet_id_from_url(monitoring_workbook_url) #This block is optional, it stores search results for the conditions once instead of searching each time the #script runs. Saves time if the search result is not expected to change. To reset, just delete the .pkl file. pkl_file_name=asset_tree+'_'+monitoring_condition+'_'+workbook_id+'.pkl' try: monitoring_conditions=pd.read_pickle(pkl_file_name) except: monitoring_conditions=spy.search({'Name':monitoring_condition, 'Type':'Condition', 'Path':asset_tree}, workbook=workbook_id,quiet=True) monitoring_conditions.to_pickle(pkl_file_name) #Pull capsules present during the specified time range events=spy.pull(monitoring_conditions,start=start,end=end,group_by=['Asset'],header='Asset',quiet=True) number_of_events=len(events) events d) Send Message to Webhook using the pymsteams library if a Capsule is detected in the time range #If capsules are present, trigger the webhook to compile and send a card to MS Teams if number_of_events != 0: events.sort_values(by='Condition',inplace=True) #Create url for specific notification time-frame using Seeq URL builder investigate_start=start.astimezone(pytz.utc).strftime('%Y-%m-%dT%H:%M:%SZ') investigate_end=end.astimezone(pytz.utc).strftime('%Y-%m-%dT%H:%M:%SZ') investigate_url=f"https://explore.seeq.com/workbook/builder?startFresh=false"\ f"&workbookName={workbook_id}"\ f"&worksheetName={worksheet_id}"\ f"&displayStartTime={investigate_start}"\ f"&displayEndTime={investigate_end}"\ f"&expandedAsset={asset_tree}" #Create message information to be posted in channel assets=[] text=[] for event in events.itertuples(): assets.append(event.Condition) #Capsule started before lookback window if pd.isnull(event[2]): if pd.isnull(event[3]) or event[4] == True: text.append(f'Event was already in progress at {start.strftime("%Y-%m-%d %H:%M:%S %Z")} and is in Progress') else: text.append(f'Event was already in progress at {start.strftime("%Y-%m-%d %H:%M:%S %Z")} and ended {event[3].strftime("%Y-%m-%d at %H:%M:%S %Z")}') #Capsule started during lookback window else: if pd.isnull(event[3]) or event[4] == True: text.append(f'Event started {event[2].strftime("%Y-%m-%d at %H:%M:%S %Z")} and is in Progress') else: text.append(f'Event started {event[2].strftime("%Y-%m-%d at %H:%M:%S %Z")} and ended {event[3].strftime("%Y-%m-%d at %H:%M:%S %Z")}') message='\n'.join(text) #Create MS Teams Card - see pymsteams documentation for details TeamsMessage = pymsteams.connectorcard(webhook_url) TeamsMessage.title(monitoring_condition+" Event Detected") TeamsMessage.text(monitoring_condition+' triggered in '+asset_tree+f' Asset Tree in the last {lookback_interval_hours} hours') TeamsMessageSection=pymsteams.cardsection() for i,value in enumerate(text): TeamsMessageSection.addFact(assets[i],value) TeamsMessage.addSection(TeamsMessageSection) TeamsMessage.addLinkButton('Investigate in Workbench',investigate_url) TeamsMessage.send() Step 5: Test the Script Execute the script ensuring at least one “High Temperature” capsule is present in the lookback duration. The events dataframe in step 4. c) will list capsules that were detected. If no capsules are present, adjust the lookback duration. If at least one capsule is detected, a notification will automatically be posted in the channel for which the Webhook has been configured: Step 6: Schedule Script to run on a specified Frequency If the script operates as desired, configure a schedule for it to run automatically. #Optional - schedule the above script to run on a regular interval spy.jobs.schedule(f'every day at 6am') The script will run on the specified interval and post a summary of “High Temperature” capsules/events that occur during the lookback period directly to the MS Teams channel. Refer to the spy.jobs.ipynb notebook in the “SPy Documentation” folder for additional information on scheduling options. Attached is a copy of the full example script: Seeq MS Teams Notification Webhook - Example Script.ipynb
    1 point
  10. Thanks for the post, Allison! I wanted to share how I took what you did and made it into rolling a "year to date" (YTD) metric, and other comparable metrics. I work in hydroelectric generation, so my utility operates a few dams. One of the things we want to track is how close our upstream water level (headwater) gets to our buffered operating limits (in this case I'm looking at buffered lower limit dips). Here's a screenshot of the example scorecard metrics I created: And here are the dependency trees: Here's how I did it: So, starting from the deepest part of the trees: ‘Yearly 1’ is common to all three. It is standard Periodic Condition for Yearly capsules. ‘Now Condition’ follows the forum post. Make this formula: condition(1min, capsule((now()-1min), now())) ‘Year Ago Now’ is based on the ‘Now Condition’ but you subtract off another year. Make this formula: condition(1min, capsule((now() - 1min - 1year), (now() - 1year))) ‘Current Year’ is a composite condition of ‘Yearly 1’ and ‘Now Condition’ using “Touches” ‘Last Year’ is a composite condition of ‘Yearly 1’ and ‘Year Ago Now’ using “Touches” ‘Rolling Year Condition’ is a formula. condition(1year, capsule((now()-1year), now())) ‘Year to Date’ is a composite condition of ‘Current Year’ and ‘Rolling Year Condition’ using “Intersection” (i.e. when is it both the current year and happening within the last year.) ‘Last Year to Date’ is a composite condition ‘Last Year’ and ‘Rolling Year Condition’ using “A minus B” (i.e. when is it last year but not within the last rolling year.) Then you can create your usual value based conditions. I used RI Headwater less than 610. Then you create your metrics! Here’s the screenshot of the Year to Date metric. To get Last YTD, you simply change the condition at the bottom to ‘Last Year to Date.’ The metrics refresh when you refresh the screen!
    1 point
  11. Overview This method will provide a simple visualization of externally determined control limits or help you accurately calculate new control limits for a signal. Using these limits we will also create a boundary and find excursions for how many times and for how long a signal deviates from the limits.These created signals can be used in follow-on analysis search for periods of abnormal system behavior. In this example we will be creating average, +3 Std Deviation and -3 Standard Deviation boundaries on a Temperature Signal. Setup Signals In the Data tab, select the following: Asset → Example → Cooling Tower 1 → Area A Signal → Temperature Option 1: Manually Define Simple Control Limits From the Tools tab, navigate to the Formula tool. The Formula can be used to easily plot simple scalar values. If you already have calculated values for the upper and lower limit just enter them in the formula editor with their units as shown in the screenshot below. Formula - Simple Upper Limit 103F Formula - Simple Lower Limit 70F Option 2: Calculate The Control Limits From the Tools tab, navigate to the Formula tool. In formula we are going to define the time period over which we want to calculate our control limits as well as the math behind those limits. Step 1 - Calculate the upper limit Variables Name Item Type $Series Temperature Signal Formula $calcPeriod = capsule("2018-01-01T00:00:00-06:00","2018-05-01T00:00:00-06:00") $tempAve = $Series.average($calcPeriod) $tempStdDev = $Series.standardDeviation($calcPeriod) $tempAve + 3*$tempStdDev Description of Code $calcPeriod → This is the time range over which we are going to calculate the average and standard deviation of our signal. The start and end time of our period must be written in ISO8601 format (Year - Month - Day "T" Hour : Minutes : Seconds . Fractional Seconds -/+ Timezone) $tempAve → Intermediate variable calculating the average of the temperature signal over our calculation period $tempStdDev → Intermediate variable calculating the standard deviation of the temperature signal over our calculation period $tempAve + 3*$tempStdDev → Example control limit calculation Step 2 - Duplicate your formula to calculate the lower limits Click the info icon in the details pane next to your calculated upper limit signal. From the info panel select duplicate to create a copy of the formula. With this copy simply edit the formula to calculate the lower limit. $calcPeriod = capsule("2018-01-01T00:00:00-06:00","2018-05-01T00:00:00-06:00") $tempAve = $Series.average($calcPeriod) $tempStdDev = $Series.standardDeviation($calcPeriod) $tempAve - 3*$tempStdDev **Alternate method number three -- if you wanted $calcperiod to actually changed based on the previous month or week of operation you could use signal from condition based off a periodic condition to achieve this solution. Step 3 - Visualize Limits as a Boundary Using the Boundary Tool to connect the process variable and upper and lower limits. Select Temperature as your primary signal and select "New" Select Boundary under relation type, name your new boundary and select the signals for your upper and lower limit. Click save to visualize the boundary on the trend. Using this same method you can create and visualize multiple boundaries (simple and calculated) at the same time Step 4 - Create Capsules when Outside the Boundary Using the Deviation Search tool create a condition for when the signal crosses the boundary. Name your new condition, select temperature as the input signal, select outside a boundary pair and the upper and lower signals. Estimate the maximum time you would expect any one out of boundary event to last and input that time in the max capsule duration field. Step 5 - Create a Scorecard to Quantify How Often and How Long Boundary Excursions Occur Create a Scorecard to count how many and how long and what % of total time these excursions are occurring. Create each metric using the Scorecard Metric tool and the Count, Total Duration and Percent Duration statistics. Use a Condition Based scorecard to get weekly or monthly metrics. Step 6 - Plot how these KPIs are Changing Over Time By creating a signal which plots these KPIs over time we can quantify how our process variable is changing relative to these limits. To begin, determine how often you would like to calculate the KPI per Hour/Day/Week/Month and create a condition for those time segments using the Periodic Condition tool. In the screenshot below we are creating a weekly condition with capsules every week. Using the Signal from Condition Tool count the number of Outside Simple Boundary capsules which occur within each weekly capsule. This same methodology can be used to create signals for total duration and % duration just like in the scorecard section above. For each week the tool will create a single sample. The timestamp placement and interpolation method selections will determine how those samples are placed within the week and visualized on the chart. The scorecard metrics that you created above can also be trended over time by switching from Scorecard View to Trend View.
    1 point
This leaderboard is set to Los Angeles/GMT-08:00
×
×
  • Create New...