Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • May 23 03:08
    github-actions[bot] closed #318
  • May 22 18:08
    ninjas005 commented #326
  • May 19 11:01
    ChristianTremblay commented #327
  • May 19 10:23
    AmauryLFc closed #327
  • May 19 10:23
    AmauryLFc commented #327
  • May 19 10:16
    ChristianTremblay commented #327
  • May 19 08:17
    AmauryLFc commented #327
  • May 18 20:39
    ChristianTremblay commented #327
  • May 18 20:33
    ChristianTremblay commented #326
  • May 18 20:32
    ChristianTremblay commented #325
  • May 18 15:34
    jetran01 commented #327
  • May 18 15:33
    jetran01 commented #327
  • May 18 13:34
    jetran01 commented #325
  • May 18 10:26
    jetran01 commented #325
  • May 18 09:04
    AmauryLFc opened #327
  • May 16 02:49
    github-actions[bot] labeled #318
  • May 16 02:49
    github-actions[bot] commented #318
  • May 13 17:54
    ninjas005 opened #326
  • May 09 12:11
    jetran01 commented #325
  • May 09 09:37
    jetran01 opened #325
Christian Tremblay
@ChristianTremblay
Everything runs on a RaspberryPi 4, built on Ubuntu Server 64bits. (InfluxDB + Grafana + Python script, all runs on the same Pi)
history_size = 50 is meant so in memory, fx['PointNameXYZ'].history will only have 50 records.... I don't want to but the RAM of the Pi.... and everything is sent to InfluxDB anyway
Develop branch is moving a lot those days.... this scripts showed me that BAC0 was not super resilient to network issues so I'm trying to improve it to be sure the polling will not fail too often and the thing will continue running...
Ben Bartling
@bbartling
Cool stuff, you should start adding IoT services to your company : )
Christian Tremblay
@ChristianTremblay
Still need to see how this would fit
Baggetun
@baggetun_twitter
Christian, I am just curious, how many points do you have in your home HVAC. I got over 600. I had to do a lot of trail and error, looping printing description etc to find what I was looking for.
That Grafana dashboard looks nice
Christian Tremblay
@ChristianTremblay

Not so many points. And I did made the sequence a few years ago so I knew what to look for…. And what I forgot to expose [sigh]…

On influxdb, I used tags to store point names, descriptions, etc this should help they have a nice search engine… records name are based on device IDs and object instances (to eliminate duplicates risks)

What could have helped you ?
hasmil
@hasmil:matrix.org
[m]
Hai, can anyone help me? @ChristianTremblay how to check if object has been created?
Ben Bartling
@bbartling
Hey Christian, can DDC math package convert enthalpy from dewpoint, drybulb, and wet bulb? I dont have humidity data but only dew, dry, and wet bulb
Christian Tremblay
@ChristianTremblay
@bbartling I played around with it this weekend and this is a challenge. You can look where I am if you check the latest master branch... it's not perfect as I still have some troubles dealing with SI and imperial units... You must know that reverting wet buld or dewpoint to get humidity leads to some errors as the formulas I found were all approximations.... but still a fun trip
from ddcmath.psychrometric import Psychrometric

In [5]: e = Psychrometric(temperature=25, humidity=50, SI=True)
25.00 degree_Celsius 50.00 percent
25.00 degree_Celsius 50.00 percent

In [6]: e
Out[6]: T: 25.00 degree_Celsius | H: 50.00 percent | DP: 13.86 degree_Celsius | WET: 18.00 degree_Celsius -> Enthalpy: 68.14 kilojoule / kilogram
e = Psychrometric(temperature=25, wetbulb=18, SI=True)
25.00 degree_Celsius 50.05 percent
25.00 degree_Celsius 50.05 percent

In [8]: e
Out[8]: T: 25.00 degree_Celsius | H: 50.05 percent | DP: 13.87 degree_Celsius | WET: 18.00 degree_Celsius -> Enthalpy: 68.17 kilojoule / kilogram
 e = Psychrometric(temperature=25, dewpoint=13.9, SI=True)
13.90 degree_Celsius 25.00 degree_Celsius
13.90 degree_Celsius 25.00 degree_Celsius

In [10]: e
Out[10]: T: 25.00 degree_Celsius | H: 50.11 percent | DP: 13.90 degree_Celsius | WET: 18.01 degree_Celsius -> Enthalpy: 68.20 kilojoule / kilogram
Christian Tremblay
@ChristianTremblay
This can also be of interest : https://unidata.github.io/MetPy/latest/index.html
But there are dependencies like ScikitLearn, numpy, etc...
Ben Bartling
@bbartling
Thanks for this stuff @ChristianTremblay its super helpful...
gjaehrling
@gjaehrling
image.png
HI Christian, I hope this channel is still alive. I'm struggeling with the following task. I need to fetch (extract or read) values from Building Control devices that are managed by a BacNET server. We are within one VPN and the analytical application (for example for anomaly detection) is on a different server. A simple illustraction is the one in thread above
image.png
Whatever I do, I'm not able to see any devices routing tables or alike. Maybe I'm missing here something fundamental
We only need to read the messages
Christian Tremblay
@ChristianTremblay
Is the BACnet server a BBMD ?
Just to be sure, add the subnet to your local IP (ex. 10.0.0.34/24)
If the points are in the BACnet server… use a device
bs=BAC0.device(“10.0.20.30”, deviceinstance, bacnet)
You need to know the device instance
Ricardo G
@rigavi_twitter
image.png
image.png
Matvey
@mtovts
Hi everyone! I have a question about COV. Can I unsubscribe? I found the cancel_cov method in the CoV mixin, but I continue to receive notifications after it is called. How’s that supposed to work?
Christian Tremblay
@ChristianTremblay
@rigavi_twitter Can you try using BAC0.lite instead of connect ?
@mtovts
dev['point'].subscribe_cov()
dev['point'].cancel_cov()
Christian Tremblay
@ChristianTremblay
@mtovts : I think I saw what you are talking about.... a subscription made in the past... cancelled.... and I still receive COV notifications.
I'll have to investigate, let me know if you find something on your side.
Ben Bartling
@bbartling

How do you ovrride an BO with BAC0? When I read the BO is comes thru as active

If I run:

import BAC0, time, random


bacnet = BAC0.lite()

address = '12345:2'
object_type = 'binaryOutput'
object_instance = '1'
value = 'False'


read_vals = f'{address} {object_type} {object_instance} presentValue'
check = bacnet.read(read_vals)
print("check ",check)

write_vals = f'{address} {object_type} {object_instance} presentValue {value}'
print("Excecuting write_vals statement:", write_vals)

write_result = bacnet.write(write_vals)

read_vals = f'{address} {object_type} {object_instance} presentValue'
check = bacnet.read(read_vals)
print("check ",check)

bacnet.disconnect()
print('BACnet disconnected')

I cant get to the end of the code it doesnt like what I am trying to write.

check  active
Excecuting write_vals statement: 12345:2 binaryOutput 1 presentValue False
Ben Bartling
@bbartling
Ah, I had to google whats the opposite of active using value = 'inactive' works
image.png
Christian Tremblay
@ChristianTremblay
:-)
John Jensen
@jensenja
hi all. trying to figure out where i'm going wrong. i have an instance of ALC that i'm doing testing with. I'm having ALC subscribe to an Analog Value that I'm creating within BAC0 in order for BAC0 to send out CoV notifications for.
it works, but only if the controller doing the subscribing is on the same subnet as the machine running BAC0
I thought that I'd have to tell BAC0 to connect to a BBMD using connect(), but when I do this, I'm no longer able to add analog values to BAC0 using add_objects_to_application()
I get this error
Traceback (most recent call last):
  File "/root/bacnet/./test_cov.py", line 49, in <module>
    main()
  File "/root/bacnet/./test_cov.py", line 41, in main
    initialize_objects(bacnet_device)
  File "/root/bacnet/./test_cov.py", line 25, in initialize_objects
    _new_objects.add_objects_to_application(bacdev)
  File "/usr/local/lib/python3.10/site-packages/BAC0/core/devices/local/object.py", line 186, in add_objects_to_application
    raise TypeError("Provide BAC0Application object or BAC0 Base instance")
TypeError: Provide BAC0Application object or BAC0 Base instance
John Jensen
@jensenja
here's the full code
#!/usr/bin/env python

import BAC0
from BAC0.core.devices.local.models import analog_value
import logging
import random
import sys
import time


logging.basicConfig(
    stream=sys.stderr,
    level=logging.DEBUG,
    format='%(asctime)s %(name)-12s %(levelname)-8s %(message)s'
)

log = logging.getLogger(__name__)


def initialize_objects(bacdev):
    _new_objects = analog_value(
        name='a_test_point',
        presentValue=0
    )
    _new_objects.add_objects_to_application(bacdev)


def update_values(bacdev):
    i = random.randint(1, 65535)
    log.debug('setting new value of a_test_point to {}'.format(i))
    bacdev['a_test_point'].presentValue = i


def main():
    #BAC0.log_level('silence')
    #bacnet_device = BAC0.lite(deviceId=4169000, localObjName='cov_test')
    bacnet_device = BAC0.connect(ip='10.15.4.253/24', bbmdAddress='10.15.88.48:47808', bbmdTTL=900)
    #for i in dir(bacnet_device):
    #    print(i)
    #print(type(bacnet_device))
    initialize_objects(bacnet_device)
    #while True:
        #pass
        #update_values(bacnet_device)
        #time.sleep(32)


if __name__ == "__main__":
    main()
if I basically comment out the call to connect() and uncomment everything else, it works fine, but again only if the controller doing the subscribing is on the same subnet (10.15.4.0/24) as the BAC0 device.
John Jensen
@jensenja
what i'm really not understanding is that if i do print(type(bacnet_device)) for each invocation of BAC0, they're both showing the exact same thing: <class 'BAC0.scripts.Lite.Lite'>
John Jensen
@jensenja
just as an FYI on the last messages, we're going to make sure that our existing BBMD's are functioning the way they should - my building engineer doesn't believe that BAC0 should be registering as a foreign device in order for the subscriptions to work
Christian Tremblay
@ChristianTremblay
@jensenja good catch.. if the app was defined as foreign device or BBMD, it failed... it is now fixed in the develop branch
John Jensen
@jensenja
hey thanks @ChristianTremblay! I'm not sure if this will solve our problem (myself and the other guy are now questioning if subscriptions were ever intended to cross subnet boundaries) but I'll check this out and give it a test!
Christian Tremblay
@ChristianTremblay
If your network is setup properly, and device 1 sees device 2, cov will work.
Safrone
@Safrone
image.png
Hey yall, trying to discover some bacnet devices and didn't have any luck. Sometimes this is because we have our device on the wrong subnet so I did some wireshark sniffing. Usually I'm able to use the output to find the broadcast IP to figure out what mask I should be using for the subnet to fix things but I got some different looking output