Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compact N support #157

Open
ThomasBLarsen opened this issue Nov 8, 2024 · 9 comments
Open

Compact N support #157

ThomasBLarsen opened this issue Nov 8, 2024 · 9 comments

Comments

@ThomasBLarsen
Copy link

I have adapted the code to suit a Nilan Compact_N (Nordic compact P model) and I see that the code tries to read the LED state for all modells. I have the CTS602 with HMI Touch panel which does not have any led, and apparently it seems like the modbus addresses are removed for my firmware. Does every other version of the panel have the LED states? I see that the get_display_led_1_state is has "supported_devices": ("all",). If this is the case, can we maybe make a boolean in the config flow that ask the user if they have the HMI interface or not?

Logger: custom_components.nilan.device
source: custom_components/nilan/device.py:334
integration: Nilan (dokumentasjon, problemer)
first seen 11:30:26 (161 hendelser)
Last logged: 12:50:27

Could not read get_display_text_2

FIY. I will send a PR with the Compact_N profile as soon as get it stable on my HA.

@veista
Copy link
Owner

veista commented Nov 8, 2024

Hi,

Sounds great. You are mistaken. The functionality is primarly determined by the modbus version (protocol version). Which is different depending on display etc. I think your model is another edge case, where you need to adhere to the compact +air/geo definitions. This is defined in device map, but also you need to add this device number to the device handling logic.

@ThomasBLarsen
Copy link
Author

ThomasBLarsen commented Nov 8, 2024

#device_map.py excerption 

    "get_display_led_1_state": {
        "entity_type": "binary_sensor",
        "min_bus_version": 1,
        "max_bus_version": 19,
        "supported_devices": ("all",),
    },
    "get_display_led_2_state": {
        "entity_type": "binary_sensor",
        "min_bus_version": 1,
        "max_bus_version": 19,
        "supported_devices": ("all",),
    },
    "get_display_text_1": {
        "entity_type": "sensor",
        "min_bus_version": 1,
        "max_bus_version": 19,
        "supported_devices": ("all",),
    },
    "get_display_text_2": {
        "entity_type": "sensor",
        "min_bus_version": 1,
        "max_bus_version": 19,
        "supported_devices": ("all",),

The entities above are the ones failing for my device, but the code says "supporte_devices" : ("all",),. Would the right way to handle this be to replace "all" with all of the device ID's execept for the model I am running (30 in the case for COMPACT_N)?

@veista
Copy link
Owner

veista commented Nov 8, 2024

No. It is not that simple.

@veista
Copy link
Owner

veista commented Nov 8, 2024

If you do that you can fix it for you, but you will not be able to receive updates in the future. I will not accept such thing in this integration, since it would break everything. You need to understand the code to be able to solve this on your own.

@ThomasBLarsen
Copy link
Author

ThomasBLarsen commented Nov 8, 2024

Sorry, I did not intending to offend, I just wanted to make sure I understood you correctly.

I written my own HA-integration before I discovered your integration which is more generic and mature. I thought I would help out as I also have access to the Nilan firmware files and have work quite a lot with the Modbus.

What is the best way to resolve this? Should I start looking into the modbus to find out what distinguishes the HMI interface from the classic one?

@veista
Copy link
Owner

veista commented Nov 8, 2024

Can you share your modbus version, device id, and the pictures asked in the readme? As I said the logic is already implemented, but the device ID has to be added to it. Without this information I cannot help at all.

@ThomasBLarsen
Copy link
Author

Device ID is 30, I will post the Modbus version when I find it.

IMG_1752

@veista
Copy link
Owner

veista commented Nov 9, 2024

Hi,

Ok.

Are you sure it is 30. Did you get this from the debug log or where?

@ThomasBLarsen
Copy link
Author

ThomasBLarsen commented Nov 9, 2024

I got it from debugging the Nilan component and it also corresponds to the ID I have extracted before.

@veista veista changed the title Could not read get_display_text_1 + 2 Compact N support Nov 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants