In this tutorial we will learn more about automation functions in EasyIoT server. 

 

Basics terminology

Before we start programming we should describe some basics terminology in EasyIoT server

Driver

Driver is used to communicate with hardware sensors. It can be Raspberry Pi GPIO port, MySensors modules, Virtual modules or ESP8266 modules. Currently supported drivers are:

  • MySensors - Domains.MYSENSORS
  • RPiGPIO - Domains.RPIGPIO
  • Esp8266 - Domains.ESP8266
  • Virtual - Domains.VIRTUAL

This driver names are used when addressing module. Modules are added in EasyIoT server in diver configuration.

Modules

Module or sensor node is sensor displayed in EasyIoT server WEB UI. When you add sensor in EasyIoT server it gets instance of module with unique address. This address can be visible in WEB display and later used in programming. Each module has its sensor type. Current sensor types are:

  •  S_GENERIC - AI, DI
  •  S_DIGITAL_INPUT - DI
  •  S_DIGITAL_OUTPUT - DO
  •  S_DOOR - DI
  •  S_ANALOG_INPUT - AI
  •  S_TEMP - AI
  •  S_HUM - AI
  •  S_LEAK - DI
  •  S_BARO - AI
  •  S_ANALOG_OUTPUT - AO
  •  S_DIMMER - AO, DO
  •  S_TEMP_AO - AO
  •  S_HUM_AO - AO
  •  S_LIGHT_LEVEL - AI
  •  S_DISTANCE - AI
  •  S_DUST - AI
  •  S_POWER - AI 
  •  S_WATER - AI
  •  S_UV - AI
  •  S_MOTION - DI

There may be more sensor types in new releases.

Module driver and address is visible in WEB interface. Use this driver and address to use module in automation program.

Parameters

Each module has one or may parameters or properties. Parameter can be sensor value or internal variable. Some parameters are used to display value in WEB display of module. For example module type S_TEMP can show parameter Sensor.Temperature.

Current supported parameters are:

  • Sensor.DigitalValue
  • Sensor.DoorWindow
  • Sensor.Leak
  • Sensor.Motion
  • Sensor.AnalogValue
  • Sensor.Humidity
  • Sensor.Temperature
  • Sensor.Pressure
  • Sensor.LightLevel
  • Sensor.Distance
  • Sensor.DustLevel
  • Sensor.Power
  • Sensor.PowerPerTime
  • Sensor.WaterFlow
  • Sensor.WaterVolume
  • Sensor.UVIndex
  • Sensor.DigitalOutput
  • Sensor.DimmerLevel
  • Status.Battery
  • Status.Connection
  • Sensor.Forecast
  • Settings.MinValue
  • Settings.MaxValue
  • Settings.ValueStep

 

You can always add your own custom parameters.

Events

When some value in driver is changed it triggers event. Event update database value, value of sensor property and UI (WEB or mobile app.). Event can also be used to trigger automation program execution. In fact it's recommended to use events to trigger automation programs not scheduler whenever is possible. 

Interface

Interface is used to interact with end user. In most cases it's WEB interface or mobile app interface, but it can be also SMS interface.

Helper function

Helper functions are used to access EasyIoT components. Helper functions can help to catch events, trigger events, read and write properties of modules, send SMS, send email...

 

In next tutorial we will go in details with helper functions and show some program examples.

See also:

EasyIoT server automation - part I

EasyIoT server automation - part III

 

See more tutorials at ​http://iot-playground.com/build​

Buying guide

To support this site and EasyIoT framework development please buy in our store.

RASPBERRY PI 3 - Model B. 1GB RAM

New Raspberry Pi 3

Raspberry Pi 512MB Model B +

Raspberry Pi Model B+, ARM1176JZF-S Running at 700MHz, 512MB RAM.

Raspberry Pi 3 Ultimate Starter Kit - Wifi, HDMI, Breadboard, SD Card

Everything you need to build basic EasyIoT server on Raspberry Pi platform.

MICRO SD 64GB 32GB 16GB MEMORY CARD

USB STICK SIM Modem 7.2MBPS 3G Wireless USB Dongle

To control EasyIoT server by SMS message.

Acrylic Case Clear Transparent Shell Enclosure Computer Box Kit For Raspberry Pi

Acrylic Case Shell Enclosure for Raspberry Pi B+

Raspberry Pi to NRF24l01+ Shield EasyIoT server compatibile

Raspberry Pi to NRF24l01+ Shield EasyIoT server compatibile, Raspberry Pi, Raspberry PI B, Raspberry Pi 2

Prototyping Shield Module For Raspberry Pi

To build custom sensors and NRF24L01 transmitter/receiver on Raspberry Pi.

NRF24L01+PA+LNA SMA Antenna Wireless Transceiver communication module 2.4G

5V 2A Charger Micro USB

For Raspberry Pi or sensor modules, cheap and easy power solution.

USB Wifi Dongle Adapter 802.11n for for Raspberry Pi Model B+ B

No need for network cables on EasyIoT server. Use WiFI USB dongle.

 


Comments   

+1 #7 Clan 2016-01-08 15:28
I struggled for quite a while to compile this project. I could not find the libraries for these 3 include lines.
SevenSegNumFontPlus.h
SevenSeg_XXXL_Num.h
arial_normal.h



In the end I just deleted these three lines and it compiled without a problem. I do not know why this works but it does. Using Arduino 1.6.7
+1 #6 Muller 2015-03-01 09:24
Quoting Oscar Alvarez Valle:
I hope I can have Mysensor network and ESP8266 network working simultaneous.

Yes it will
+1 #5 Oscar Alvarez Valle 2015-02-27 17:17
Quoting Oscar Alvarez Valle:
Quoting Muller:
Quoting Oscar Alvarez Valle:
I cannot see Mysensor driver in "Configure"

Yes, windows version only works on ESP8266. MySensors serial gateway is not supported.


MQTT Gateway not serial, but is clear that it is not work, still..........



I ordered my first R.Pi. I hope I can have Mysensor network and ESP8266 network working simultaneous.
+1 #4 Oscar Alvarez Valle 2015-02-26 09:26
Quoting Muller:
Quoting Oscar Alvarez Valle:
I cannot see Mysensor driver in "Configure"

Yes, windows version only works on ESP8266. MySensors serial gateway is not supported.


MQTT Gateway not serial, but is clear that it is not work, still..........
#3 Muller 2015-02-25 21:35
Quoting Oscar Alvarez Valle:
I cannot see Mysensor driver in "Configure"

Yes, windows version only works on ESP8266. MySensors serial gateway is not supported.
#2 Константин 2015-02-25 19:56
people need examples :oops:
#1 Oscar Alvarez Valle 2015-02-25 17:20
:sad:
Windows. IoT It suppose that it is supported by MQTT Gateway of Mysensors but, I cannot see Mysensor driver in "Configure", so I can't configure mi network

You have no rights to post comments