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 4 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

Apologies for my slow reply.

The almost works!

There is a drop down but the drop downs are all unpopulated.

Screen shots attached.

As an aside the values are updating.

Thank you so much for all of your efforts.

Jeremy

Screenshot 2024-04-30 at 17 49 09 Screenshot 2024-04-30 at 17 49 04 Screenshot 2024-04-30 at 17 49 26 t

GravySeal commented 2 months ago

Could you copy this file and paste it in the integration's select.py file? I think when you've done this and restarted Home Assistant, the dropdown menu's should be populated.

rudgej commented 2 months ago

Still blank I am afraid.

Thank you

Jeremy

GravySeal commented 2 months ago

Even after a restart? Could you maybe share some debug logs with me again?

rudgej commented 2 months ago

Yes the systems was restarted

Logs attached home-assistant_bacnet_interface_2024-04-30T19-38-13.440Z.log bacnet_addon_logs-19.txt home-assistant_2024-04-30T19-37-31.747Z.log

GravySeal commented 2 months ago

Could you download v0.2.1b10 from HACS and see if that works?

rudgej commented 2 months ago

Hi. It is not showing as a. Update yet and I am on my phone. So I will remove and reinstall in first thing in the morning. Thank you.

rudgej commented 2 months ago

Updated. Sadly still blank values.

Jeremy

GravySeal commented 2 months ago

@BradleyFord How do your multistates look? Do you get numbers in the dropdown menu where there are no stateTexts to represent them with the latest version?

GravySeal commented 2 months ago

@rudgej One last thing we can try is remove all the checks for stateText.

Please edit /config/custom_components/bacnet_interface/select.py and replace the entire class MultiStateValueEntity with the following code:

class MultiStateValueEntity(
    CoordinatorEntity[EcoPanelDataUpdateCoordinator], SelectEntity
):
    _attr_has_entity_name = True

    def __init__(
        self,
        coordinator: EcoPanelDataUpdateCoordinator,
        deviceid: str,
        objectid: str,
    ):
        """Initialize a BACnet MultiStateValue object as entity."""
        super().__init__(coordinator=coordinator)
        self.deviceid = deviceid
        self.objectid = objectid

    @property
    def unique_id(self) -> str:
        return f"{self.deviceid}_{self.objectid}"

    @property
    def entity_registry_enabled_default(self) -> bool:
        """Return if the entity should be enabled when first added to the entity registry."""
        return self.coordinator.config_entry.data.get(CONF_ENABLED, False)

    @property
    def name(self) -> str:
        name = self.coordinator.config_entry.data.get(CONF_NAME, "object_name")
        if name == "description":
            return f"{self.coordinator.data.devices[self.deviceid].objects[self.objectid].description}"
        elif name == "object_identifier":
            identifier = (
                self.coordinator.data.devices[self.deviceid]
                .objects[self.objectid]
                .objectIdentifier
            )
            return f"{identifier[0]}:{identifier[1]}"
        else:
            return f"{self.coordinator.data.devices[self.deviceid].objects[self.objectid].objectName}"

    @property
    def icon(self):
        return "mdi:menu"

    @property
    def options(self) -> list:
        if (
            number_of_states := self.coordinator.data.devices[self.deviceid]
            .objects[self.objectid]
            .numberOfStates
        ):
            return [str(i) for i in range(1, number_of_states + 1)]

        else:
            LOGGER.error(
                f"{self.deviceid} {self.objectid} is missing REQUIRED numberOfStates property!"
            )
            return []

    @property
    def current_option(self) -> str:
        pres_val = (
            self.coordinator.data.devices[self.deviceid]
            .objects[self.objectid]
            .presentValue
        )

        if (
            number_of_states := self.coordinator.data.devices[self.deviceid]
            .objects[self.objectid]
            .numberOfStates
        ):
            options = [str(i) for i in range(1, number_of_states + 1)]
            return options[pres_val - STATETEXT_OFFSET]
        else:
            return str(pres_val)

    @property
    def device_info(self) -> DeviceInfo:
        return DeviceInfo(
            identifiers={(DOMAIN, self.deviceid)},
            name=f"{self.coordinator.data.devices[self.deviceid].objects[self.deviceid].objectName}",
            manufacturer=self.coordinator.data.devices[self.deviceid]
            .objects[self.deviceid]
            .vendorName,
            model=self.coordinator.data.devices[self.deviceid]
            .objects[self.deviceid]
            .modelName,
        )

    @property
    def extra_state_attributes(self) -> dict[str, Any]:
        return {
            "inAlarm": bool(
                self.coordinator.data.devices[self.deviceid]
                .objects[self.objectid]
                .statusFlags[0]
            ),
            "fault": bool(
                self.coordinator.data.devices[self.deviceid]
                .objects[self.objectid]
                .statusFlags[1]
            ),
            "overridden": bool(
                self.coordinator.data.devices[self.deviceid]
                .objects[self.objectid]
                .statusFlags[2]
            ),
            "outOfService": bool(
                self.coordinator.data.devices[self.deviceid]
                .objects[self.objectid]
                .statusFlags[3]
            ),
        }

    async def async_select_option(self, option: str) -> None:
        """Change the selected option."""

        pres_val = int(option)

        await self.coordinator.interface.write_property(
            deviceid=self.deviceid,
            objectid=self.objectid,
            presentValue=pres_val,
        )

It should result in this:

image

Just make sure to restart Home Assistant again after each change.

BradleyFord commented 2 months ago

@BradleyFord How do your multistates look? Do you get numbers in the dropdown menu where there are no stateTexts to represent them with the latest version?

The numbers are coming through ok and change when I use the remote to adjust something, but I am not able to use it to push changes down. You can see the error as the bottom of the screen on the image below .

Screenshot_2024-05-01-10-03-23-04_c3a231c25ed346e59462e84656a70e50

Screenshot_2024-05-01-10-03-47-68_c3a231c25ed346e59462e84656a70e50

Bepacom-Raalte commented 2 months ago

I released version v0.2.1, let me know if these issues persist.

rudgej commented 2 months ago

Good morning.

I updated to 2.1 and tried it. Still no dropdown.

I change the code above and on restart the integration failed to start.

I then reverted the code and it started with no dropdown,

Logs attached.

Thanks as always

Jeremy

home-assistant_bacnet_interface_2024-05-01T08-12-16.900Z.log b.com/Bepacom-Raalte/Bepacom-BACnet-IP-Integration/files/15175127/home-assistant_bacnet_interface_2024-05-01T08-12-16.900Z.log)

BradleyFord commented 2 months ago

That change has been positive for me, as it seems I can now get data writing down to BACNET ok.

I still have some work to do getting my Climate template adapted to use it, that can wait for later today when my family go to bed.

Bepacom-Raalte commented 2 months ago

Still no dropdown.

So does it show options when you open the dropdown menu? An error that shows briefly on the screen?

It's supposed to look like this now: afbeelding

rudgej commented 2 months ago

Hi

No. I have no errors just a blank dropdown.

Jeremy Sent from my iPhone

On 1 May 2024, at 11:32, Bepacom B.V. Raalte @.***> wrote:



Still no dropdown.

So does it show options when you open the dropdown menu? An error that shows briefly on the screen?

It's supposed to look like this now: afbeelding.png (view on web)https://github.com/Bepacom-Raalte/Bepacom-BACnet-IP-Integration/assets/126168314/cb14b4ee-1836-4a7e-b6ab-dfdd6ed372f5

— Reply to this email directly, view it on GitHubhttps://github.com/Bepacom-Raalte/Bepacom-BACnet-IP-Integration/issues/19#issuecomment-2088266891, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ARR5RRGRPFDJQZHE5ESYESDZADABZAVCNFSM6AAAAABFDE6W56VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOBYGI3DMOBZGE. You are receiving this because you were mentioned.Message ID: @.***>

GravySeal commented 2 months ago

@rudgej Could you perhaps try one more time to redownload the integration from HACS?

image

image

Don't need to edit any files after downloading.

I've tried all imaginable ways to recreate the empty dropdowns for myself, but they all populate either with statetexts, or numbers if there's no statetexts in v0.2.1.

rudgej commented 2 months ago

I have re downloaded, restarted.

Blank.

I tried to set the value using a script and got an error. Screen shot attached.

On restart I noticed that 1.4 was running not the beta ( which interestingly worked ) and so I change the settings so the beta starts only on reboot ( they were both set to start ) but no change

Screenshot 2024-05-02 at 10 58 39

Bepacom-Raalte commented 2 months ago

Where are you trying to change the option? This looks like a template, so I don't think the options will change along with the actual entity options. Could you take a look at the options though Settings > Devices & Services > Bepacom Bacnet/IP Interface > Variheat and take a screenshot of your multistates there?

rudgej commented 2 months ago

That was a script - as when I set it programatically that is how it will be done I assume. I used it to test setting temperature which worked.

The screen shot is attached showing still blanks - hence I tried in a script in case I got a different result but no.

I thought the error message would give a clue.

It currently has a value of 1 when I look in the add on. Screen shot below. So the add on has the value but the HACS integration does not

Screenshot 2024-05-02 at 15 00 01

Screenshot 2024-05-02 at 14 55 31

GravySeal commented 2 months ago

Alright, so I see the problem. The stateText is in fact a list of empty strings. That's why you are seeing blank values appearing in Home Assistant. A little strange, but it makes sense now. Perhaps they're editable through some program other than WACnet as they don't appear in there?

GravySeal commented 2 months ago

I think if you update to v0.2.2b1, the blank states should be fixed.

rudgej commented 2 months ago

I have values !

Thank you.

I will test it in the morning.

Jeremy Sent from my iPhone

On 2 May 2024, at 17:06, GravySeal @.***> wrote:



I think if you update to v0.2.2b1, the blank states should be fixed.

— Reply to this email directly, view it on GitHubhttps://github.com/Bepacom-Raalte/Bepacom-BACnet-IP-Integration/issues/19#issuecomment-2090898380, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ARR5RRD3DXDWJW7JM6XNJJLZAJP73AVCNFSM6AAAAABFDE6W56VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOJQHA4TQMZYGA. You are receiving this because you were mentioned.Message ID: @.***>

GravySeal commented 2 months ago

Did you encounter any issues after testing?

rudgej commented 2 months ago

Good morning. I am sorry for my slow reply.

The pool area is currently being worked on and I don't have physical access to the unit.

All signs are that it works fine but it will be a few days until I can actually test it properly.

If I change values they then show in wacnet and that gets data from the unit so I think it is all fine

Your support has been amazing and appreciated.

Jeremy

GravySeal commented 2 months ago

Awesome, glad it's working then! I'll mark this issue as finished. If you do encounter something else, feel free to turn it into a new issue.