Beispiel #1
0
import select
import time

from pytomation.interfaces import Serial, W800rf32, InsteonPLM, Wtdio, NamedPipe, \
                                StateInterface, Command, HTTPServer
from pytomation.devices import Motion, Door, Light, Location, InterfaceDevice, Room, \
                                Photocell, Generic, StateDevice, State, Attribute


###################### INTERFACE CONFIG #########################
web = HTTPServer()

insteon = InsteonPLM(Serial('/dev/ttyR2', 19200, xonxoff=False))
wtdio = Wtdio(Serial('/dev/mh_weeder_port', 9600))
w800 = W800rf32(Serial('/dev/mh_w800_port', 4800, xonxoff=False))

# Set the I/O points as inputs on the wtdio board, these are all set as inputs
wtdio.setChannel('ASA')
wtdio.setChannel('ASB')
wtdio.setChannel('ASC')
wtdio.setChannel('ASD')
wtdio.setChannel('ASE')
wtdio.setChannel('ASF')
wtdio.setChannel('ASG')

#wtdio.dio_invert('G')

###################### DEVICE CONFIG #########################

# ______ REMOTES ____________________________________________________ 
Beispiel #2
0
import select
import time

from pytomation.interfaces import Serial, W800rf32, InsteonPLM, Wtdio, NamedPipe, \
                                StateInterface, Command, HTTPServer
from pytomation.devices import Motion, Door, Light, Location, InterfaceDevice, Room, \
                                Photocell, Generic, StateDevice, State, Attribute


###################### INTERFACE CONFIG #########################
web = HTTPServer()

insteon = InsteonPLM(Serial('/dev/ttyR2', 19200, xonxoff=False))
wtdio = Wtdio(Serial('/dev/mh_weeder_port', 9600))
w800 = W800rf32(Serial('/dev/mh_w800_port', 4800, xonxoff=False))

# Set the I/O points as inputs on the wtdio board, these are all set as inputs
wtdio.setChannel('ASA')
wtdio.setChannel('ASB')
wtdio.setChannel('ASC')
wtdio.setChannel('ASD')
wtdio.setChannel('ASE')
wtdio.setChannel('ASF')
wtdio.setChannel('ASG')

#wtdio.dio_invert('G')

###################### DEVICE CONFIG #########################

# ______ REMOTES ____________________________________________________
import select

# import time
# from pytomation.interfaces.config import *
from pytomation.config import *
from pytomation.interfaces import Wtdio, Serial


def on_digital_input(command=None, address=None):
    print "Weeder Digital Input Board " + address[0] + " Channel " + address[1] + " -> " + command


debug["Wtdio"] = 1
debug["Serial"] = 0
serial = Serial("/dev/mh_weeder_port", 9600)
wtdio = Wtdio(serial)
# wtdio.start()

# Set the I/O channels on the WTDIO board according to the command set
# S = Switch, L = Output default low
#
# Inputs are set according to the wtdio manual by sending the board
# data in the following sequence.  BOARD TYPE CHANNEL
# Example:  Board 'A', Type SWITCH, Channel D  - 'ASD'
# Currently only SWITCH inputs are handled.
#
# Outputs are set as follows: BOARD LEVEL CHANNEL
# Example:  Board 'A', Level LOW, Channel 'M', - 'ALM'
#
# I'll change this later to make full use of the weeder boards
# capabilities