Ci-dessous, les différences entre deux révisions de la page.
installserialkillerpluginsraspberry [2014/02/09 19:11] badele created |
installserialkillerpluginsraspberry [2015/08/12 22:29] (Version actuelle) |
||
---|---|---|---|
Ligne 52: | Ligne 52: | ||
</code> | </code> | ||
- | === Installation plugin teleinfo === | + | ==== Installation des plugins ==== |
- | <code bash> | + | * **Actuactor** |
- | sudo pip install pyserial | + | * **Multimedia** |
- | </code> | + | * [[serialkiller-plugins-tts|tts]] |
+ | * **Checker** | ||
+ | * **Energy** | ||
+ | * [[serialkiller-plugins-teleinfo|teleinfo]] | ||
+ | * **Network** | ||
+ | * [[serialkiller-plugins-ping|ping]] | ||
+ | * **Protocol** | ||
+ | * [[serialkiller-plugins-x10|X10]] | ||
+ | * **System** | ||
+ | * [[serialkiller-plugins-process|process]] | ||
+ | * **Weather** | ||
+ | * [[serialkiller-plugins-metar|metar]] | ||
+ | * [[serialkiller-plugins-sunshine|sunshine]] | ||
+ | * [[serialkiller-plugins-vigilance|vigilance]] | ||
- | |||
- | sudo nano /usr/local/bin/check_sensors.py | ||
- | |||
- | <code python> | ||
- | #!/usr/bin/env python | ||
- | # -*- coding: utf-8 -*- | ||
- | |||
- | import os | ||
- | import time | ||
- | |||
- | from skplugins import addValuePlugin, addEventPlugin, addValue, addEvent | ||
- | from skplugins.energy.teleinfo import teleinfo | ||
- | |||
- | server = '192.168.1.1' | ||
- | while True: | ||
- | |||
- | # Check teleinfo informations | ||
- | result = teleinfo(dev='/dev/ttyUSB0') | ||
- | |||
- | if 'HCHC' in result.results: | ||
- | addValue(server, 'washroom:teleinfo:hchc', result.types['HCHC'], result.results['HCHC']) | ||
- | |||
- | if 'HCHP' in result.results: | ||
- | addValue(server, 'washroom:teleinfo:hchp', result.types['HCHP'], result.results['HCHP']) | ||
- | |||
- | if 'IINST' in result.results: | ||
- | addValue(server, 'washroom:teleinfo:iinst', result.types['IINST'], result.results['IINST']) | ||
- | |||
- | if 'IINST' in result.results: | ||
- | addValue(server, 'washroom:teleinfo:test', result.types['IINST'], result.results['IINST']) | ||
- | |||
- | if 'ISOUSC' in result.results: | ||
- | addValue(server, 'washroom:teleinfo:isousc', result.types['ISOUSC'], result.results['ISOUSC']) | ||
- | |||
- | if 'PAPP' in result.results: | ||
- | addValue(server, 'washroom:teleinfo:papp', result.types['PAPP'], result.results['PAPP']) | ||
- | |||
- | #Sleep | ||
- | time.sleep(5) | ||
- | </code> | ||
- | |||
- | === Installation plugin metar === | ||
- | |||
- | <code bash> | ||
- | git clone https://github.com/tomp/python-metar.git | ||
- | cd python-metar | ||
- | python setup.py install | ||
- | </code> | ||
- | |||
- | <code python> | ||
- | #!/usr/bin/env python | ||
- | # -*- coding: utf-8 -*- | ||
- | |||
- | import os | ||
- | import time | ||
- | |||
- | from skplugins import addValuePlugin, addEventPlugin, addValue, addEvent | ||
- | from skplugins.weather.skmetar import skmetar | ||
- | |||
- | server = '192.168.1.1' | ||
- | while True: | ||
- | |||
- | # Check metar for LFMT station | ||
- | result = skmetar(cachefile='/tmp/metar_34.cache', station='LFMT') | ||
- | addValue(server, 'city:weather:temp', 'float', result.results['result']) | ||
- | addValue(server, 'city:weather:dewpt', 'float', result.results['dewpt']) | ||
- | addValue(server, 'city:weather:humidity', 'float', result.results['humidity']) | ||
- | addValue(server, 'city:weather:pressure', 'float', result.results['pressure']) | ||
- | addValue(server, 'city:weather:wind_chill', 'float', result.results['wind_chill']) | ||
- | addValue(server, 'city:weather:wind_speed', 'float', result.results['wind_speed']) | ||
- | addValue(server, 'city:weather:visibility', 'ushort', result.results['visibility']) | ||
- | |||
- | #Sleep | ||
- | time.sleep(5) | ||
- | </code> |