Code Monkey home page Code Monkey logo

cbw's Introduction

ControlByWeb PHP App

This simple PHP-based application will let you monitor and graph sensors attached to a CBW device and send out email alerts when preset thresholds are crossed. Checkout this project, edit the config.json and email.json files in the conf/ directory and schedule bin/CBW.php to run periodically.

Configuration

Application behavior is controlled via two JSON configuration files. You can edit those at any point in time as they are continously read by the app. The config.json file contains an array of sensor objects coming from one or more CBW devices. The email.json file contains email server related settings. In the `conf1 directory you will find sample files for both.

[
	{
		"sensor":"sensor1",
		"host":"192.168.42.21",
		"type":"temperature",
		"name":"Outside temperature",
		"units":"F",
		"thresholdLow":0,
		"thresholdHigh":50,
		"notify":[
			"[email protected]"
		]
	}
]
  • sensor Name of the CBW's variable you ant to monitor. You can add one or more into the object.
  • host IP or domain name of the CBW device. You can add variables from multie CBW devices.
  • type This is not used right now, but it should name the physical attribute being monitored [temperature, humidity, voltage, etc.].
  • name Name the sensor. This is free text, you can put in whatever you want.
  • units Self explanatory - F, C, %RH, ...
  • thresholdLow An alert will be generated when current value dips below this value. To disable put in false.
  • thresholdHigh An alert will be generated when current value rises above this value. To disable put in false.
  • notify An array of email addresses that should be notified. To disable leave the array blank [].
{
	"host":"pod51009.outlook.com",
	"protocol":"tls",
	"port":587,
	"username":"[email protected]",
	"password":"XXXX",
	"fromAddress":"[email protected]"
}

How to deploy

The easiest way to get this application going is to schedule it via cron or Task scheduler. You can also wrap the execution of CBW.php inside a while(true) loop and run it more frequently than once a minute.

* * * * * root php /path/to/bin/CBW.php

cbw's People

Contributors

davidus-sk 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.