veista / nilan

Nilan integration for Home Assistant
Apache License 2.0
46 stars 11 forks source link

Unable to add integration #1

Closed AdamGrumlik closed 1 year ago

AdamGrumlik commented 1 year ago

image Unable to add integration. Is it necessary to edit configuration.yaml manually, I just don't know how?

veista commented 1 year ago

Hi, the issue is now resolved with the latest release.

AdamGrumlik commented 1 year ago

Yes already ok, unsupported device for me unfortunately :(

veista commented 1 year ago

Which device do you have? If it is cts602 based adding support is rather easy.

AdamGrumlik commented 1 year ago

I have a Combi 302 polar top. Can you please advise how to edit/proceed?

AdamGrumlik commented 1 year ago

Hello, could you please advise me how to add support for the Nilan Combi 302 polar? I'll be happy to pay you for your work, I don't want anything for free. Thank you very much for your help. Adam

st 23. 11. 2022 v 8:26 odesílatel Taneli Veistinen @.***> napsal:

Which device do you have? If it is cts602 based adding support is rather easy.

— Reply to this email directly, view it on GitHub https://github.com/veista/nilan/issues/1#issuecomment-1324648222, or unsubscribe https://github.com/notifications/unsubscribe-auth/AWYMET76XYKS6MVBPK6EZE3WJXBJTANCNFSM6AAAAAASIIJEHU . You are receiving this because you authored the thread.Message ID: @.***>

veista commented 1 year ago

Ok so first you need to install the newest version 1.0.3. Then take a picture of the type plate of your device and add it here. Then turn on debug logging of the integration in your configuration.yaml file like: logger: default: info logs: custom_components.nilan: debug

Try installing the integration.

Go to logs and report the debug string here.

Also if you have the device with the HMI350T - touch panel HMI then take a picture of the info page where the device type is shown.

If you want to support me, you can donate here https://www.buymeacoffee.com/veista

AdamGrumlik commented 1 year ago

Hello, I have attached a recording from the log. 2022-11-24 12:32:52.008 DEBUG (MainThread) [custom_components.nilan.config_flow] Device Type 35 not found in supported devices list

IMG_3351

veista commented 1 year ago

Thanks, do you have the HMI?

AdamGrumlik commented 1 year ago

Yes I do, do you mind if it's not in english? IMG_2442

veista commented 1 year ago

Thanks, no this is great. I will add this ASAP.

veista commented 1 year ago

Hi,

The release is now available for you to test. It is in beta releases, so make sure you enable beta releases if you are using HACS.

Please let me know if something is missing or something doesn't work.

AdamGrumlik commented 1 year ago

Hi, it worked :-) Great job. Showing 55 entities. nilan1

veista commented 1 year ago

That's great! I added a bit better support for your device on version 1.0.5B. Please let me know how it works!

veista commented 1 year ago

Also do you have an after-heating element installed on your device?

AdamGrumlik commented 1 year ago

The new version 1.0.5b works. I have the polar version with preheating of the supply air so that the exchanger in the unit does not freeze.

veista commented 1 year ago

image

I mean an accessory, you can see it in the HMI menu.

AdamGrumlik commented 1 year ago

This item is in the menu. I don't know if it is actually installed. ![Uploading 5973DB5D-1D37-4F0D-A029-7A74B435F79C.jpeg…]()

AdamGrumlik commented 1 year ago

92C95E3D-F1BE-4C04-9B4C-43FB90075C46

veista commented 1 year ago

Great! Then I will code the support for after heating and you can test it.

AdamGrumlik commented 1 year ago

OK. I will try.

veista commented 1 year ago

So i released the 1.0.6B last night. If you could go through the hmi settings and cross-check that every value changes where it is supposed to and also that there is no unnecessary entities.

AdamGrumlik commented 1 year ago

Hi, I ran into a problem. HA and nilan integration stops working after about a minute. It's like it stopped communicating via modbus. I tried communicating via node-red and it works. I use USR-TCP232-410S for communication, I don't know where the error could be?

veista commented 1 year ago

Is there anything in the logs?

AdamGrumlik commented 1 year ago

Yes, for example,: Updating nilan binary_sensor took longer than the scheduled update interval 0:00:10

AdamGrumlik commented 1 year ago

2022-11-25 19:58:52.381 WARNING (MainThread) [homeassistant.components.number] Updating nilan number took longer than the scheduled update interval 0:00:10 2022-11-25 19:58:52.467 WARNING (MainThread) [homeassistant.components.select] Updating nilan select took longer than the scheduled update interval 0:00:10 2022-11-25 19:58:52.647 WARNING (MainThread) [homeassistant.components.climate] Updating nilan climate took longer than the scheduled update interval 0:00:10

AdamGrumlik commented 1 year ago

Only restarting the home assistant will help.

veista commented 1 year ago

Did you try if reloading the integration helps? Did this problem arise with the latest release?

AdamGrumlik commented 1 year ago

Yes, reload integration will help. But in few minutes it is unavailable again. In previous versions it did too, but I was constantly doing something in HA and restarting HA so I didn't pay much attention to it.

AdamGrumlik commented 1 year ago

ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.nilan_time fails Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 527, in async_update_ha_state await self.async_device_update() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 722, in async_device_update raise exc File "/config/custom_components/nilan/sensor.py", line 397, in async_update self._attr_native_value = await getattr(self._device, self._attribute)() File "/config/custom_components/nilan/device.py", line 1807, in get_time result.registers[i].to_bytes(2, "little", signed=False), IndexError: list index out of range

veista commented 1 year ago

It might be an issue with the bridge then. I'm afraid I can only guess from here, but the error comes from that it does not get a response from the device.

AdamGrumlik commented 1 year ago

Yes, there could be a fault with the bridge. I don't really understand that. I just find it strange that even if HA stops communicating, node-red and modbus communicate. So the bridge is communicating, it's just not communicating with HA.

veista commented 1 year ago

Please note that with these bridges usually, you can only communicate with one TCP client at a time, especially if you run two programs on the same computer, you will run into issues since the server(bridge) does not know which client to respond to and then they get confused.

AdamGrumlik commented 1 year ago

I'm sorry, I didn't know that.

veista commented 1 year ago

Yes, try to disconnect all other clients from the bridge so that you only have the HA on that bridge. You need another bridge if you want more devices on the RTU network or connect with a different machine if your bridge supports that. Although I'm not sure even if another bridge would work in this case, but if you need it you can try.

AdamGrumlik commented 1 year ago

I have only the nilan combi 302 connected to the modbus bridge and only HA turned on. But still the same problem.

veista commented 1 year ago

Ok. Then I guess you can try modifying the scan interval or try disabling entities. If you have vs code addon you can modify them there or via text editor if you have samba share.

veista commented 1 year ago

You can also turn the debug log on for homeassistant.components.modbus if this brings any new info.

AdamGrumlik commented 1 year ago

I will try to adjust the polling interval. This is my bridge setup. Nilan still mentions the use of a 120ohm resistor in the manual, so I'll try to find that too. It is possible that my bridge is not compatible with nilan. B09AB348-9094-445B-9BFD-E685B64C840E

veista commented 1 year ago

I'm not sure what the issue is, but i don't think it's the resistor. Did you turn the modbus debugging on in HA? The most likely error is that the bridge you are using is not compatible with my integration.

veista commented 1 year ago

Can you disable that sync baudrate option and try that?

AdamGrumlik commented 1 year ago

Yes.

2022-11-25 23:17:31.075 INFO (MainThread) [homeassistant.setup] Setup of domain input_text took 0.5 seconds 2022-11-25 23:17:31.076 INFO (MainThread) [homeassistant.setup] Setup of domain input_datetime took 0.5 seconds 2022-11-25 23:17:31.076 INFO (MainThread) [homeassistant.setup] Setup of domain zone took 0.5 seconds 2022-11-25 23:17:31.091 INFO (SyncWorker_4) [homeassistant.components.modbus.modbus] modbus Nilan communication open 2022-11-25 23:17:31.097 INFO (MainThread) [homeassistant.setup] Setting up hardware 2022-11-25 23:17:31.126 INFO (MainThread) [homeassistant.setup] Setup of domain input_select took 0.6 seconds 2022-11-25 23:17:31.133 INFO (MainThread) [homeassistant.setup] Setup of domain input_number took 0.6 seconds 2022-11-25 23:17:31.138 INFO (MainThread) [homeassistant.setup] Setup of domain schedule took 0.6 seconds 2022-11-25 23:17:31.148 INFO (MainThread) [homeassistant.setup] Setup of domain hardware took 0.1 seconds 2022-11-25 23:17:31.153 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.apex 2022-11-25 23:17:31.225 INFO (MainThread) [homeassistant.setup] Setting up hacs 2022-11-25 23:17:31.225 INFO (MainThread) [homeassistant.setup] Setup of domain hacs took 0.0 seconds 2022-11-25 23:17:31.235 INFO (MainThread) [homeassistant.setup] Setting up met 2022-11-25 23:17:31.235 INFO (MainThread) [homeassistant.setup] Setup of domain met took 0.0 seconds 2022-11-25 23:17:31.249 INFO (SyncWorker_2) [homeassistant.loader] Loaded switch from homeassistant.components.switch 2022-11-25 23:17:31.255 INFO (MainThread) [homeassistant.setup] Setup of domain input_button took 0.7 seconds 2022-11-25 23:17:31.256 INFO (MainThread) [custom_components.hacs]

AdamGrumlik commented 1 year ago

Is your modbus integration different from other modbus integrations? Sorry for the questions, but I'm not an expert on this.

veista commented 1 year ago

No. I use the HA built-in modbus library with pretty much default modbus TCP values. It might be that the bridge you are using is not using modbus TCP but only forwards modbus RTU messages. This would mean that it would need a framer, which the HA modbus library has but it would mean some more coding. I wish I could test that is this the case personally, I can make some modifications for you to test when I have the time.

AdamGrumlik commented 1 year ago

Ah, I confess that I do not understand it at all. I would be happy if it worked, I was glad that you modified your program for the Combi 302 and I did not expect that there would be a problem with the bridge. Will I have to buy a new bridge?

AdamGrumlik commented 1 year ago

I turned off sync baudrate but same problem :(

veista commented 1 year ago

So yes a quick test. In device.py file whre it says "tcp" replace with "rtuovertcp"

AdamGrumlik commented 1 year ago

2022-11-26 00:19:10.911 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: nilan image after reboot, initialization is in progress

AdamGrumlik commented 1 year ago

Do you want access to HA and bridge?

veista commented 1 year ago

No, I don't think that would be of any value. It's what I thought, but had to try. I guess you can try increasing the timeout and other settings at the same section, where the modbus config is and see if something works.

AdamGrumlik commented 1 year ago

Ok, I'll try. Thank you very much for your time. I really appreciate it.