Forum KNX francophone / English KNX forum
[pKNyX] Passerelle Helios EasyControls - Version imprimable

+- Forum KNX francophone / English KNX forum (https://www.knx-fr.com)
+-- Forum : Français (https://www.knx-fr.com/forumdisplay.php?fid=3)
+--- Forum : Logiciels libres (linknx, knxweb, pKNyX,...) (https://www.knx-fr.com/forumdisplay.php?fid=10)
+--- Sujet : [pKNyX] Passerelle Helios EasyControls (/showthread.php?tid=3823)



[pKNyX] Passerelle Helios EasyControls - fma38 - 21/07/2015

Hello,

J'ai avancé sur mon package python pour s'interfacer avec le modbus à la noix des nouvelles régulations vmc Helios (EasyControls) :

https://github.com/fma38/PeasYcontrols

Voici un exemple qui utilise ce package dans pKNyX, pour lire les sondes de température, et les balancer sur le bus KNX :

Code :
# -*- coding: utf-8 -*-

from peasycontrols.modbusEC import ModbusEasyControls

from pknyx.api import FunctionalBlock
from pknyx.api import schedule

import settings


class VmcFB(FunctionalBlock):
    DP_01 = dict(name="temp_outside_air", access="output", dptId="9.001", default=19.)
    DP_02 = dict(name="temp_supply_air", access="output", dptId="9.001", default=19.)
    DP_03 = dict(name="temp_outgoing_air", access="output", dptId="9.001", default=19.)
    DP_04 = dict(name="temp_extract_air", access="output", dptId="9.001", default=19.)

    GO_01 = dict(dp="temp_outside_air", flags="CRT", priority="low")
    GO_02 = dict(dp="temp_supply_air", flags="CRT", priority="low")
    GO_03 = dict(dp="temp_outgoing_air", flags="CRT", priority="low")
    GO_04 = dict(dp="temp_extract_air", flags="CRT", priority="low")

    DESC = "Vmc FB"

    def init(self):
        self._modbusEC = ModbusEasyControls(settings.HOSTNAME, settings.UNIT)

    @schedule.every(minutes=5)
    def updateTemperature(self):
        self.dp["temp_outside_air"].value = self._modbusEC.readVariable("v00104")
        self.dp["temp_supply_air"].value = self._modbusEC.readVariable("v00105")
        self.dp["temp_outgoing_air"].value = self._modbusEC.readVariable("v00106")
        self.dp["temp_extract_air"].value =  self._modbusEC.readVariable("v00107")