Outils pour utilisateurs

Outils du site


serialkiller-plugins-x10

PLUGINS EN COURS DE DEVELOPPEMENT

Installation plugin X10

Installation des prérequis

# Superviseur
sudo su
 
# Installation libusb
apt-get install libusb-1.0.0-dev
 
# Installation mochad
cd /usr/local/src
wget -O mochad.tgz http://sourceforge.net/projects/mochad/files/latest/download
tar xf mochad.tgz
cd mochad*
./configure
make
make install
#!/usr/bin/env python
# -*- coding: utf-8 -*-
 
import os
import time
 
from skplugins import addValuePlugin, addEventPlugin, addValue, addEvent
from skplugins.protocol.x10 import x10
 
server = '192.168.1.1'
while True:
 
    # X10 sensors
    plugin = x10(mochad='192.168.1.2')
    addValue(server, 'livingroom:shuttersroad:state', 'boolean', int(plugin.results['result']['A5'])*255)
    addValue(server, 'livingroom:shutterskitchen:state', 'boolean', int(plugin.results['result']['A6'])*255)
    addValue(server, 'livingroom:lamp:state', 'boolean', int(plugin.results['result']['A2'])*255)
    addValue(server, 'lucasroom:lamp:state', 'boolean', int(plugin.results['result']['A3'])*255)
 
    #Sleep
    time.sleep(5)
serialkiller-plugins-x10.txt · Dernière modification: 2015/08/12 22:29 (modification externe)