Brink

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
prutzer
Normal user
Posts: 10
Joined: 16 Jun 2020, 16:45

Brink

#1 Post by prutzer » 14 Jan 2022, 10:36

Hi All,

I have a python3 script to read the status of my Brink Flair ventilation unit (WTW).
I have connected the Brink Flair wit a cable to a modbus (RS485) USB adapter directly to my Raspberry Pi wich is running domoticz.
With the Pyhton3 script I can see the status of the Brink flair in Domoticz.

However the cable I am using is needed for another project. :) So I would like to use a ESP8266 (wich is already nearby the Brink Flair and used as temperature monitor) to make a wireless solution. I'm not good in scripting. I can do copy and past and change some things, but writing a script on my own....

Can you help me? Is there a way to make this in ESPEasy with use of a RS485 to TTL adapter?
The Brink flair does have a wifi option by it self. But it is very bad. But maybe i have to search for a solution wich is using the wifi option of the Brink.

Python3 script:
#!/usr/bin/env python3

import minimalmodbus
import math
#import urllib2
#import urllib.request
from urllib.request import urlopen

#Domoticz URL
domoticz_url = "http://x.x.x.x:xxxx"

instrument = minimalmodbus.Instrument('/dev/ttyUSB_DEVICE3', 20) # port name, slave address (in decimal)

instrument.serial.baudrate = 19200 # Baud
instrument.serial.bytesize = 8
instrument.serial.parity = minimalmodbus.serial.PARITY_EVEN
instrument.serial.stopbits = 1
instrument.serial.timeout = 0.5 # seconds
instrument.mode = minimalmodbus.MODE_RTU # rtu or ascii mode
instrument.clear_buffers_before_each_transaction = True

value = instrument.read_register(8001, 0, 3, False) # Registernumber, number of decimals, function code
switchPositionEnum = { 0: 'afwezigheid', 1: 'normaal', 2: 'hoog', 3: 'ultra' }
print('Mate van prestatie:', value, '(' + switchPositionEnum[value] + ')')

value = instrument.read_register(4036, 0, 4, True)
print('Invoer temperatuur:', value / 10, 'C')
response= urlopen(domoticz_url+'/json.htm?type=command&param=udevice&idx='+str(118)+'&nvalue=0&svalue='+str(value/10))
response.read()

value = instrument.read_register(4046, 0, 4, True)
print('Temperatuur afvoer:', value / 10, 'C')
response= urlopen(domoticz_url+'/json.htm?type=command&param=udevice&idx='+str(119)+'&nvalue=0&svalue='+str(value/10))
response.read()

value = instrument.read_register(4023, 0, 4, False)
print('Inlaatdruk:', value / 10, 'Pa')

value = instrument.read_register(4024, 0, 4, False)
print('Uitlaatdruk:', value / 10, 'Pa')

value = instrument.read_register(4031, 0, 4, False)
print('Inlaatluchtvolume ingesteld:', value, 'm3')

value = instrument.read_register(4032, 0, 4, False)
print('Huidig ​​inlaatluchtvolume:', value, 'm3')
response= urlopen(domoticz_url+'/json.htm?type=command&param=udevice&idx='+str(120)+'&nvalue=0&svalue='+str(value))
response.read()

value = instrument.read_register(4041, 0, 4, False)
print('Uitlaatluchtvolume ingesteld:', value, 'm3')

value = instrument.read_register(4042, 0, 4, False)
print('Huidig ​​luchtuitlaatvolume:', value, 'm3')
response= urlopen(domoticz_url+'/json.htm?type=command&param=udevice&idx='+str(121)+'&nvalue=0&svalue='+str(value))
response.read()

value = instrument.read_register(6100, 0, 3, False)
bypassModeEnum = { 0: 'automatisch', 1: 'Gesloten', 2: 'open' }
print('Bypass modus:', bypassModeEnum[value])
response= urlopen(domoticz_url+'/json.htm?type=command&param=udevice&idx='+str(124)+'&nvalue=0&svalue='+str(bypassModeEnum[value]))
response.read()

value = instrument.read_register(4050, 0, 4, False)
bypassStateEnum = { 0: 'initialiseren', 1: 'Openen', 2: 'Sluiten', 3: 'Open', 4: 'Gesloten', 255: 'Fout' }
print('Bypass-toestand:', bypassStateEnum[value])
response= urlopen(domoticz_url+'/json.htm?type=command&param=udevice&idx='+str(123)+'&nvalue=0&svalue='+str(bypassStateEnum[value]))
response.read()

value = instrument.read_register(4100, 0, 4, False)
filterStateEnum = { 0: 'Niet_vervuild', 1: 'Vervuild' }
print('Filterstatus:', filterStateEnum[value])
response= urlopen(domoticz_url+'/json.htm?type=command&param=udevice&idx='+str(122)+'&nvalue=0&svalue='+str(filterStateEnum[value]))
response.read()

value = instrument.read_register(4060, 0, 4, False)
preheaterStateEnum = { 0: 'initialiseren', 1: 'inactief', 2: 'actief', 3: 'testmodus' }
print('Voorverwarmingsstatus:', preheaterStateEnum[value])

value = instrument.read_register(4061, 0, 4, False)
print('Voorverwarmingsprestaties:', value, '%')
response= urlopen(domoticz_url+'/json.htm?type=command&param=udevice&idx='+str(125)+'&nvalue=0&svalue='+str(value))
response.read()


value = instrument.read_register(6033, 0, 3, False)
imbalanceEnum = { 0: 'nepovolena', 1: 'povolena' }
print('onbalans:', imbalanceEnum[value])

value = instrument.read_register(6035, 0, 3, False)
print('Afwijking van onbalans in het aanbod:', value, '%')

value = instrument.read_register(6036, 0, 3, False)
print('Afwijking onbalansafwijking:', value, '%')

value = instrument.read_register(6000, 0, 3, False)
print('Prutok pro stupen 0 (nepritomnost):', value, 'm3')

value = instrument.read_register(6001, 0, 3, False)
print('Prutok pro stupen 1 (nizky):', value, 'm3')

value = instrument.read_register(6002, 0, 3, False)
print('Prutok pro stupen 2 (stredni):', value, 'm3')

value = instrument.read_register(6003, 0, 3, False)
print('Prutok pro stupen 3 (vysoky):', value, 'm3')

value = instrument.read_register(4115, 0, 4, False)
print('Voeg filter toe:', math.floor(value / 24), 'dni')



Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 15 guests