Bepacom-Raalte / Bepacom-BACnet-IP-Integration

Bepacom BACnet Integration Repository
Apache License 2.0
12 stars 2 forks source link

Configuration #19

Closed rudgej closed 2 months ago

rudgej commented 3 months ago

I have a Variheat 600 running Bepacom. This is a pool heater / ventilation system

It has IP address of 192.168.1.211

I can see this on the network using Wacnet

Screenshot 2024-03-22 at 11 24 35

I have Bepacom IP running

The UI interface shows nothing.

I have Become Ip interface running but this has some default ip addresses ( that show in the logs of Bepacom Ip but ate not a range I use ( 127.0.0.1) and anything I add leads to an error

Screenshot 2024-03-22 at 11 28 14

Given BacNet runs and I can see it with Wacnet then I have a configuration issue somewhere but cant see anything obvious in the documentations.

Could you please point me in the right direction.

Thank you

![Uploading Screenshot 2024-03-22 at 11.30.46.png…]()

s6-rc: info: service s6rc-oneshot-runner: starting s6-rc: info: service s6rc-oneshot-runner successfully started s6-rc: info: service base-addon-banner: starting


Add-on: Bepacom BACnet/IP Interface Bepacom BACnet/IP interface for the Bepacom EcoPanel. Allows BACnet/IP devices to be available to Home Assistant through an API.

Add-on version: 1.3.3 You are running the latest version of this add-on. System: Home Assistant OS 12.1 (amd64 / generic-x86-64) Home Assistant Core: 2024.3.1 Home Assistant Supervisor: 2024.03.0

Please, share the above information when looking for help or support in, e.g., GitHub, forums or the Discord chat.

s6-rc: info: service base-addon-banner successfully started s6-rc: info: service fix-attrs: starting s6-rc: info: service base-addon-log-level: starting s6-rc: info: service fix-attrs successfully started s6-rc: info: service base-addon-log-level successfully started s6-rc: info: service legacy-cont-init: starting s6-rc: info: service legacy-cont-init successfully started s6-rc: info: service init-nginx: starting s6-rc: info: service init-interface: starting [11:14:25] INFO: Running init-nginx. [11:14:25] INFO: Running init-interface. [11:14:25] INFO: Allowed addresses for NGINX: 127.0.0.1 192.168.20.177 192.168.20.57 172.30.232.1 172.30.32.1 [11:14:25] INFO: Generated ingress configuration successfully! s6-rc: info: service init-nginx successfully started Using enp0s25 as address: 192.168.20.177/24 [BACpypes] objectName: EcoPanel address: 192.168.20.177/24 objectIdentifier: 420 maxApduLengthAccepted: 1476 segmentation: segmentedBoth vendorIdentifier: 15 foreignBBMD: - foreignTTL: 255 maxSegmentsAccepted: 64 loglevel: WARNING defaultPriority: 15 updateInterval: 600 s6-rc: info: service init-interface

rudgej commented 2 months ago

I have just come back to the computer and Connection Status: CLOSED. Disconnected by the server.

GravySeal commented 2 months ago

Alright, so it seems to be somewhat unstable. Could you share logs of when the add-on closed the connection?

rudgej commented 2 months ago

Which logs from which application please?

rudgej commented 2 months ago

2 sets logs from the add on below.

bacnet_addon_logs (2).txt

Info Documentation Configuration Log Bepacom BACnet/IP Interface Development Version

2024/04/24 20:01:34 [warn] 364#364: *983 an upstream response is buffered to a temporary file /var/lib/nginx/tmp/proxy/2/00/0000000002 while reading upstream, client: 172.30.32.2, server: , request: "GET /apiv1/diagnostics/logs HTTP/1.1", upstream: "http://127.0.0.1:7813/apiv1/diagnostics/logs", host: "192.168.20.177:8123", referrer: "http://192.168.20.177:8123/api/hassio_ingress/EZSPXayxQe3KBK7RKahbMB8sSxqY8aAdE5duMPJfm2U/webapp"

GravySeal commented 2 months ago

WARNING |BACnetIOHandler.py->do_ReadPropertyMultipleRequest : device,1338 failed to read device,417 []: ('object', 'unknown-object')

This error is WACnet trying to read the add-on, so I think we don't have to worry about that. What puzzles me is how inconsistent the disconnects are. If you disable the integration, does it ever disconnect that way?

rudgej commented 2 months ago

Could you please clarify what integration you want me to disable ? The add on ?

I suppose to me there std possibly 2 issues.

  1. The. Connection maybe unstable

but more significantly

  1. The hacs integration only has headers and no values as they are all unavailable.

So something is broken between the add on and the hacs component.

rudgej commented 2 months ago

If the add on is stopped then I can't connect. I have disabled the has integration and it is running. I will see how long it lasts

GravySeal commented 2 months ago

Right, the integration is the part you downloaded from HACS and creates the entities within Home Assistant. The add-on can be seen as an application running besides Home Assistant. Let's see whether it'll disconnect this way.

rudgej commented 2 months ago

I have come back to check and it has disconnected. So it lasted circa 15 min maybe. I don't know the time it stopped.

Logs below bacnet_addon_logs (3).txt

loglevel: WARNING defaultPriority: 15 s6-rc: info: service init-interface successfully started s6-rc: info: service interface: starting s6-rc: info: service interface successfully started s6-rc: info: service nginx: starting s6-rc: info: service nginx successfully started s6-rc: info: service legacy-services: starting [20:54:31] INFO: Running interface s6-rc: info: service legacy-services successfully started [20:54:34]|ERROR |BACnetIOHandler.py->subscription_task : ErrorRejectAbortNack: device,1338, analog-value,53: object: unknown-object

[20:54:37]|WARNING |h11_impl.py ->handle_events : Invalid HTTP request received. [20:54:37] INFO: Running NGINX 2024/04/24 20:54:37 [notice] 314#314: using the "epoll" event method 2024/04/24 20:54:37 [notice] 314#314: nginx/1.24.0 2024/04/24 20:54:37 [notice] 314#314: OS: Linux 6.6.25-haos 2024/04/24 20:54:37 [notice] 314#314: getrlimit(RLIMIT_NOFILE): 1073741816:1073741816 2024/04/24 20:54:37 [notice] 314#314: start worker processes 2024/04/24 20:54:37 [notice] 314#314: start worker process 364

Bepacom-Raalte commented 2 months ago

I managed to replicate the web UI not updating issue with my controller and add-on, so I can do some slightly more detailed testing. The strange thing is, the integration does work for me even though the web UI doesn't update.

Could you provide me with your Home Assistant logs after restarting Home Assistant. The logs I want are at Settings > System > Logs > Load Full Logs. Then please press the download button to get the logs in a neat .txt file.

afbeelding

rudgej commented 2 months ago

Firstly thank you for sticking with this !

I re enabled the integration and then restarted.

The logs are attached home-assistant_2024-04-25T13-53-35.755Z.log

rudgej commented 2 months ago

There are quite a lot of errors like this

TypeError: 'NoneType' object is not subscriptable 2024-04-25 14:52:49.966 ERROR (MainThread) [homeassistant.components.select] Error adding entity select.variheat_address_on_board_2 for domain select with platform bacnet_interface Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 580, in _async_add_entities await coro File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 890, in _async_add_entity await entity.add_to_platform_finish() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1334, in add_to_platform_finish self.async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 998, in async_write_ha_state self._async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1119, in _async_write_ha_state state, attr, capabilities, shadowed_attr = self.async_calculate_state() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1056, in async_calculate_state state = self._stringify_state(available) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1004, in _stringify_state if (state := self.state) is None: ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/select/init.py", line 152, in state current_option = self.current_option ^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/bacnet_interface/select.py", line 222, in current_option self.coordinator.data.devices[self.deviceid] TypeError: 'NoneType' object is not subscriptable 2024-04-25 14:52:49.970 ERROR (MainThread) [homeassistant.components.select] Error adding entity select.variheat_data_bit_on_board_2 for domain select with platform bacnet_interface

rudgej commented 2 months ago

There are also lots of these

Bepacom BACnet/IP Interface Development Version

rudgej commented 2 months ago

And an expanded error message

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 258, in _handle_refresh_interval await self._async_refresh(log_failures=True, scheduled=True) File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 416, in _async_refresh self.async_update_listeners() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 168, in async_update_listeners update_callback() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 494, in _handle_coordinator_update self.async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 998, in async_write_ha_state self._async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1119, in _async_write_ha_state state, attr, capabilities, shadowed_attr = self.async_calculate_state() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1056, in async_calculate_state state = self._stringify_state(available) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1004, in _stringify_state if (state := self.state) is None: ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/select/init.py", line 152, in state current_option = self.current_option ^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/bacnet_interface/select.py", line 222, in current_option self.coordinator.data.devices[self.deviceid] TypeError: 'NoneType' object is not subscriptable

rudgej commented 2 months ago

Finally I do have remote access to the system and I am happy to send you via PM the external link and set up a user for you if simpler.

Bepacom-Raalte commented 2 months ago

Could you download integration v0.2.1b6 through HACS? After that, if it fails again please paste the Home Assistant logs as .txt file.

rudgej commented 2 months ago

Good morning.

I have completely uncalled the old HACS Bepacom and added from scratch the B6 beta.

Sadly the same thing

There is some evidence of values initially populating on the logs before they become unavailable. Images below.

Also attached are two expanded errors in the log and the log txt file

Thank you once again if if remote access is simpler please just say

Jeremy

Screenshot 2024-04-26 at 08 15 24 Screenshot 2024-04-26 at 08 15 16 Screenshot 2024-04-26 at 08 15 06 home-assistant_2024-04-26T07-15-42.009Z.log

Screenshot 2024-04-26 at 08 13 43 Screenshot 2024-04-26 at 08 13 03

rudgej commented 2 months ago

And this is the config of the integration

Screenshot 2024-04-26 at 09 05 49

GravySeal commented 2 months ago

I've updated the add-on to v1.4.1b8. Could you check for updates in the add-on store and download the update?

After updating, I'd like you to open the web UI. Once in the web UI, please right click on the page and click "Inspect". image

When the inspect menu opens, please go to the "Console" tab and enable the "Verbose" level. image

Now you should be able to see all the data being sent over the websocket. Please copy a few of the plaintext messages and make of each one a .txt or .json file and share it with me. I'd like to see if somehow anything strange comes in. I'll also use this data to test some other things for the integration.

The console tab should also log if an error occurs with the websocket. It might be useful to keep it open for a while and see if an error message pops up.

If all else fails, we can consider using the remote access you set up.

rudgej commented 2 months ago

log.txt

Thank you once again.

The logs are attached.

The integration still reports devices unavailable.

Jeremy

GravySeal commented 2 months ago

Could you download integration v0.2.1b7 from HACS? I added a lot of debug logging in the update coordinator, so I can trace which way the code is going. Please follow these steps once downloaded:

  1. Go to the integration page in Home Assistant. image
  2. Click "Enable debug logging". image
  3. Restart Home Assistant and let it run 5 minutes or so. This will collect enough logging data with debugging on.
  4. After a couple of minutes, click "Disable debug logging. A file should automatically download. Please link that file to me.
BradleyFord commented 2 months ago

As per my other issue, it feels like we both have the same issue. Hence I am joining in here, attached are my logs

00:16 - restarting Add-on 00:17 to 00:18 - rebuilding Add-on 00:19 - reload integration 00:20 - Delete integration 00:21 - Add integration

Below are the HA and BACNET addon logs:

bacnet_addon_logs (1).txt home-assistant_2024-04-28T17-23-06.977Z.log

home-assistant_bacnet_interface_2024-04-28T17-26-00.072Z.log

rudgej commented 2 months ago

home-assistant_bacnet_interface_2024-04-28T17-49-43.679Z.log

Many thanks.

Log attached.

Jeremy

BradleyFord commented 2 months ago

home-assistant_bacnet_interface_2024-04-28T17-49-50.817Z.log

Just realised my first set of bacnet integration logs was before the new update was fully installed (needed to reboot). Attached is with the latest version. I also deleted and readded the integration at 00:49

GravySeal commented 2 months ago

Thank you for the logs, both of you.

Could you try to edit one file of the integration for me? In /config/custom_components/bacnet_interface/manifest.json please adjust the following line: "requirements": [ "aioecopanel==0.0.10" ], to be: "requirements": [ "aioecopanel==0.0.12" ], After this please restart Home Assistant and let me know if anything changed. If not, please share some debug logs.

rudgej commented 2 months ago

This improves matters but has not yet solved it. Well done.

So I now have units and switches showing on the integration. They are still unavailable but this is progress!

Logs from HACS, Add on and HA attached

Jeremy

Screenshot 2024-04-28 at 21 35 12 bacnet_addon_logs-17.txt home-assistant_bacnet_interface_2024-04-28T20-36-41.573Z.log home-assistant_2024-04-28T20-37-14.691Z.log

rudgej commented 2 months ago

EDIT - Actually looking back at screen shots the units were there before as were the swiches - so sadly no change :-(

GravySeal commented 2 months ago

@rudgej Is it possible for you to edit your multistate objects? MultiStateValue 2 for example as a presentValue of 3, but other properties like numberOfStates and stateText are empty. NumberOfStates and stateText are required to be present for MultiState objects. I also think this is mainly the reason it doesn't work for you.

To test this theory, could you edit another file for me? In /config/custom_components/bacnet_interface/init.py, line 23, could you edit the following?

PLATFORMS: list[str] = [
    "binary_sensor",
    "sensor",
    "number",
    "switch",
    "select",
]

To be:

PLATFORMS: list[str] = [
    "binary_sensor",
    "sensor",
    "number",
    "switch",
]

This should prevent MultiStateValue and MultiStateOutput entities from being generated.

rudgej commented 2 months ago

Hi it seems to work. Well done !

Screen shot attached.

I can read what happens when I try to change these values etc in the morning but at present this is major progress.

Thank you !

I will report more in the morning.

Jeremy

IMG_2232

BradleyFord commented 2 months ago

I have tried the above steps, but still with the same issue.

Upon reboot everything flashes up with the actual data and then switches to unavailable

rudgej commented 2 months ago

Good morning

So whilst we have huge progress there are issues

  1. some are still not available - see screen shot .

  2. The values don't update in HA if changed on the system , or on the system if changed in HA3.

  3. There are web socket errors in the logs

I am not 100% where the snapshot values come from. I changed some values on the system and then restarted HA but this did not lead to the values on the system showing

So whilst we have a lot of progress the link is not real time / working which I suppose is the web socket issue

The two changes you asked for are still in place - including the first one form 10 - 12 which did not change things

Jeremy

home-assistant_bacnet_interface_2024-04-29T07-35-43.512Z.log bacnet_addon_logs-18.txt home-assistant_2024-04-29T07-34-48.240Z.log Screenshot 2024-04-29 at 08 34 20 Screenshot 2024-04-29 at 08 33 24 Screenshot 2024-04-29 at 08 37 52

Bepacom-Raalte commented 2 months ago

@rudgej

  1. some are still not available - see screen shot .

It is correct multistates aren't available. This is because we disabled those by adjusting the init.py file.

2. The values don't update in HA if changed on the system , or on the system if changed in HA3.

Which values are you trying to change? I see the add-on successfully wrote to binaryValue 31. Sometimes it takes a little moment to update in Home Assistant.

3. There are web socket errors in the logs

The hightlighted websocket errors aren't related to the integration, but to the Home Assistant frontend.

If the values like temperature still update, I think it seems to do it's job.

@BradleyFord In your logs I noticed the errors were related to multistates as well. Mainly related to stateText. I'll make it so if there's no statetexts, it'll just be a number to be selected or displayed. I'll let you know once I release a new beta version that should fix this.

GravySeal commented 2 months ago

@BradleyFord Could you install integration v0.2.1b8 off of HACS? Does this solve the issue for you?

BradleyFord commented 2 months ago

@BradleyFord Could you install integration v0.2.1b8 off of HACS? Does this solve the issue for you?

Woohoo!!!!!

My dream for the last year is complete!! I brought the BACNET module on Friday and now it is working 😎😎👍👍👍 thank you very much.

Now to consolidate these entities into HA Climates

rudgej commented 2 months ago

I assume I can install this also ?

Jeremy

GravySeal commented 2 months ago

now it is working Awesome! No more errors or strange things happening?

I'm not sure if they can be turned into climate entities easily, but it's possible to turn them into thermostats

I assume I can install this also ?

Of course! I am not sure if it'll run without errors though, as some of your multi state objects are invalid. If you can reprogram your device to have the correct numberOfStates BACnet property, it should work for you as well.

rudgej commented 2 months ago

Good morning.

I left this overnight and checked values.

Wacnet shows air temp probe at 13 degrees. ( correct)

The integration showed 11.

I then looked at the web ui of the add on. 11

I then restarted the add on 13

So it was not refreshing.

The config of the beta was changed to

in a post above

I assume that it is no longer subscribed

So I treid to put it back to stock

analogInput: true analogOutput: true analogValue: true binaryInput: true binaryOutput: true binaryValue: true multiStateInput: true multiStateOutput: true multiStateValue: true

However this won't save

Failed to save add-on configuration, Invalid list for option 'devices_setup' in Bepacom BACnet/IP Interface Development Version (97683af0_bacnetinterface_dev). Got {'objectName': 'EcoPanel Dev ', 'address': '192.168.20.177/24', 'objectIdentifier': 420, 'defaultPriority': 15, 'devices_setup': {'analogInput': True, 'analogOutput': True, 'analogValue': True, 'binaryInput': True, 'binaryOutput': True, 'binaryValue': True, 'multiStateInput': True, 'multiStateOutput': True, 'multiStateValue': True}, 'entity_list': [], 'api_accessible': False, 'loglevel': 'WARNING', 'segmentation': 'segmentedBoth'}

Is the error

So the current issue is that the Add on does not refresh the values.

Re the multi state objects.

I am connecting to a commercial product so I have no ability ( that I am aware of) to reprogram the device.

The PDF spec of the device is attached.

The multistate objects are in a screen grab attached.

One of the most important value I need to manipulate is Occupied - so that when the pool is in use it can enter an occupied state.

This of course is a multi state value! I am not sure what multi state is or why it causes an issue as it is either 0,1,2 which to me seems no different to a temperature of 10/20/30 etc

Is there a way to accommodate Muti State objects ?

So I have 2 issues

a. the values don't update and

vb. multi state occupancy ( but I can get round this with acidly contacts input in need)

Many thanks

Jeremy

Screenshot 2024-04-30 at 09 51 03

Current - Variheat M172 PLC BACnet and Modbus v1.pdf

rudgej commented 2 months ago

My issue seems similar to the two other threads that have issues that the values don't update.

Jeremy

rudgej commented 2 months ago

I have also just run the web UI on object 53 ( seconds) and it stops after about 15 seconds.

Bepacom-Raalte commented 2 months ago

So I treid to put it back to stock

The configuration for the beta version is different from the stable version. Try the following:

- deviceID: all
  CoV_lifetime: 600
  CoV_list:
    - all
  quick_poll_rate: 5
  quick_poll_list: []
  slow_poll_rate: 600
  slow_poll_list:
    - all

This will subscribe to everything it can, as well as poll every 600 seconds.

For the multistates, can you try scanning your device with Yabe and look at the objects?

afbeelding

Let me know if this property exists and has a value in your objects.

rudgej commented 2 months ago

Attached is from WACNET.

I am on a Mac and Yabe seems to be a windows application ( .exe files) so I can't run it.

Form the documentation 0 1 or 2 are allowed.

I have added the config and let it run. The integration is accurate to 1 degree and the temp is reported to .1 degree so I will wait until it was up and see if it changes.

Screenshot 2024-04-30 at 11 27 06

Bepacom-Raalte commented 2 months ago

Could you perhaps press Load all properties? I'm looking for number-of-states.

rudgej commented 2 months ago

That is the load all properties - the button just allows refresh.

I am looking for another Mac version

rudgej commented 2 months ago

I have treid all sorts of apps but they don't seem to connect. For the Barnet server I am entering the Ip of the Barnet device and none connect. So I am afraid I can't answer the question

Bepacom-Raalte commented 2 months ago

I have added the config and let it run. The integration is accurate to 1 degree and the temp is reported to .1 degree so I will wait until it was up and see if it changes.

Does the integration crash if you try it without the changes we made before? If it does crash, could you share Home Assistant logs?

I have treid all sorts of apps but they don't seem to connect. For the Barnet server I am entering the Ip of the Barnet device and none connect. So I am afraid I can't answer the question

It's alright, the occupancy and damper switch multi states are valid, so those should be able to be generated.

rudgej commented 2 months ago

I have changed the 12 to 10 in Manifest and restarted the add in . Works

I have added back in "select" in init and restarted the add in . Works

I not know if the values are static or dynamic but the logs don't show unavailable and the number still show ( which is what I mean by works)

I then restated HA and it broke. Logs attached. [Uploading home-assistant_2024-04-30T12-37-58.660Z.log…]()

Bepacom-Raalte commented 2 months ago

So it seems there aren't any issues generating entities anymore, now hoping the entities will keep updating. I can't download these logs unfortunately, they link me back to the top of this page.

rudgej commented 2 months ago

so changing the 12 to 10 is fine ( as above I don't know if it is updating) but adding back select breaks it

rudgej commented 2 months ago

home-assistant_2024-04-30T12-37-58.660Z.log

Attached again

Bepacom-Raalte commented 2 months ago

Could you update to v0.2.1b9 try it without editing anything?