Coder Social home page Coder Social logo

exosense_insight_action_slack's Introduction

ExoSense™ Insight Action for Slack

Overview

Actions are ExoSense Insights that are subscribed to rule events and do not produce an outlet signal. They can be built in almost the exact same way as External Insight rules and transforms. They are intended to perform an action based on a particular rule status being triggered. For example, an action could post data to a spreadsheet, send a slack message, or send data to a custom API based on a desired rule status being triggered.

See https://github.com/exosite/exosense_insight_example_murano_lua for more general information on exosense insights.

Tutorial: Build an action to send Slack messages

1. Create a murano application from this template

  • This template already contains a functioning action for sending Slack messages
  • You can make changes to the code or add additional actions to the 'Module' -> 'your_code_here'
  • Copy the domain of your application by clicking 'copy app link' - you will use this in step 2, but will add /interface to the end if it

2. Publish your murano application as an insight service so that you can connect it to ExoSense

  • In Murano, go to IoT Marketplace and click on Publish on the left
  • Element Name: Recommend including 'Insight' in the name
  • Element Type: Service
  • Element Variation: ExoSense Insight
  • Configuration File (YAML): https://<the domain of your application>/interface

3. Connect your new insight service to ExoSense

  • Click on your ExoSense instance
  • From the "Manage Application" modal that pops up, select "Insight Services" on the left
  • Click "Add Insight Service"
  • Find the newly published service and click it
  • Click "Add to Solution"

4. Create a Slack App that is connected to your organization's Slack Workspace

  • Go to api.slack.com
  • Click "Create an app"
  • Add “Incoming Webhooks” feature and create a webhook
  • Copy the webhook URL
  • Note: Slack's updated API now requires that you set the username and emoji within the Slack App itself. The updated API also does not allow you to send messages to more than channel from a single webhook. You must create a unique webhook for each channel that you'd like to post to.

5. In ExoSense, create an action definition

  • Navigate to Configuration -> Actions
  • Add a new Action
  • Set the Webhook URL using the value copied from the Slack Incoming Webhook configuration

6. Add your action to a rule

  • Navigate to the modify asset page of an asset
  • Click the more-vert below a rule to add/edit actions
  • Add a new action using the action definition created in the previous step

exosense_insight_action_slack's People

Contributors

tadpol avatar patricklevy avatar maanenson avatar jaytcarlson avatar

Watchers

 avatar James Cloos avatar CharlieGN avatar Calvin Chu avatar  avatar sifeng avatar maggie davis avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.