Skip to content
This repository has been archived by the owner on May 17, 2021. It is now read-only.

MailControl Binding

Vlad Ivanov edited this page Jun 21, 2015 · 5 revisions

Introduction

MailControl binding provides possibility to receive commands sent via email in JSON format.

Commands of the following types can be sent:

  • decimal
  • HSB
  • increase - decrease
  • on - off
  • open - closed
  • percent
  • stop - move
  • string
  • up - down

Commands are parsed, converted into instances of classes from org.openhab.core.library.types package and published by event publisher.

MailControl binding is getting use of the following libraries:

  1. access-email-1.0.2.jar which needs the following jars: mail-1.4.jar, activation-1.1.jar
  2. openhab-mailcontrol-model-1.0.0.jar which needs json-simple-1.1.jar

MailControl binding allows to send commands to the OpenHAB home server remotely without any additional server running somewhere else (for example, in a cloud).

Configuration

Example of configuration properties for the Message Control binding:

mailcontrol:username=email.address@some.com
mailcontrol:password=XXXXXXXXXX
mailcontrol:smtphost=smtp.mail.some.com
mailcontrol:smtpport=587
mailcontrol:smtpauth=true
mailcontrol:smtpstarttls=true
mailcontrol:smtpsocketfactoryport=995
mailcontrol:pop3host=pop.mail.some.com
mailcontrol:pop3port=995
mailcontrol:pop3socketfactoryport=995
mailcontrol:pop3socketfactoryclass=javax.net.ssl.SSLSocketFactory

Examples of Messages

The subject of an email message must be OpenHAB.

Examples of messages for different types of commands:

decimal: {"messageType":"110","productVersion":"1.0","itemCommand":{"timeSent":"0","command":{"commandType":"DECIMAL","value":"1.2"},"item_id":"Item"},"senderEmail":"email.address@some.com"}

HSB: {"messageType":"110","productVersion":"1.0","itemCommand":{"timeSent":"0","command":{"brightness":30,"saturation":50,"commandType":"HSB","hue":150},"item_id":"Item"},"senderEmail":"email.address@some.com"}

increase: decrease: {"messageType":"110","productVersion":"1.0","itemCommand":{"timeSent":"0","command":{"commandType":"INCREASE_DECREASE","value":"INCREASE"},"item_id":"Item"},"senderEmail":"email.address@some.com"}

on - off: {"messageType":"110","productVersion":"1.0","itemCommand":{"timeSent":"0","command":{"commandType":"ON_OFF","value":"ON"},"item_id":"Item"},"senderEmail":"email.address@some.com"}

open - closed: {"messageType":"110","productVersion":"1.0","itemCommand":{"timeSent":"0","command":{"value":"OPEN","commandType":"OPEN_CLOSED"},"item_id":"Item"},"senderEmail":"email.address@some.com"}

percent: {"messageType":"110","productVersion":"1.0","itemCommand":{"timeSent":"0","command":{"value":"12","commandType":"PERCENT"},"item_id":"Item"},"senderEmail":"email.address@some.com"}

stop - move: {"messageType":"110","productVersion":"1.0","itemCommand":{"timeSent":"0","command":{"commandType":"STOP_MOVE","value":"STOP"},"item_id":"Item"},"senderEmail":"email.address@some.com"}

string: {"messageType":"110","productVersion":"1.0","itemCommand":{"timeSent":"0","command":{"value":"someValue","commandType":"STRING"},"item_id":"Item"},"senderEmail":"email.address@some.com"}

up - down: {"messageType":"110","productVersion":"1.0","itemCommand":{"timeSent":"0","command":{"value":"UP","commandType":"UP_DOWN"},"item_id":"Item"},"senderEmail":"email.address@some.com"}

Installation


User Interfaces


Community

(link to openHAB forum)

Development



Misc


Samples

A good source of inspiration and tips from users gathered over the years. Be aware that things may have changed since they were written and some examples might not work correctly.

Please update the wiki if you do come across any out of date information.

Use case examples

Collections of Rules on a single page

Single Rules

Scripts


Release Notes

Clone this wiki locally