budulinek / arduino-altherma-controller

Arduino-based controller for Daikin Altherma heat pumps. The controller connect to the Altherma heat pump via P1/P2 bus, has a built-in webserver for configuration (of the controller itself). Integration to Loxone home automation system via UDP protocol, allows you to monitor and control your Altherma heat pump.
GNU General Public License v2.0
51 stars 11 forks source link

Daikin and Modbus interface #4

Open jelockwood opened 3 years ago

jelockwood commented 3 years ago

@budulinek You mention in your ReadMe

There is no external Modbus adapter for newer Altherma models, the official LAN adapter is very limited in functionality and as of today Daikin has no usable public API or cloud-based solution.

However I found the following two products. Would these solve this problem?

https://www.daikin.eu/en_us/products/RTD-W.html - For use with Altherma 3 HT models I believe https://www.daikin.eu/en_us/products/RTD-LT-CA.html - For use with Altherma 3 LT models I believe

See this discussion https://community.openhab.org/t/how-to-integrate-daikin-altherma-lt-heat-pump/16488/ and in particular this post https://community.openhab.org/t/how-to-integrate-daikin-altherma-lt-heat-pump/16488/17

adicorra commented 6 months ago

Thanks for your recap. Yes, I can confirm everything is working perefectly. I didn't experience the issues with the other commercial gateways since I didn't test them, but if @StefanR71 tells me exactly what register (on the Altherma) doesn't work because of the multiple parts inside the data packet , then I can test it live and confirm.

adicorra commented 6 months ago

@budulinek, regarding the default IP, can you please confirm because I recall to have changed it and reflashed but didn't seem to take into account (I mean before going in the WebUI). This is important as the gateway will be in the unit casing and don't want to unwire just to change the IP one day. Ideally can we get another IP adress at boot without going through the WebUI ?

Did I do this correctly ? In yellow the values I changed (here they are as default of course)

defaultIP

budulinek commented 6 months ago

@adicorra Yes, this is where you change the default IP. You can also see the default static IP on the "Tools" page in web UI. And you can test your default IP by clicking "Load Default Settings". The button will erase your EEPROM (only MAC address is retained) and default settings from advanced_settings.h will be apllied (incl. your default IP) .

BTW can I use the picture of your hardware (with the KKSB case) in my my readme?

adicorra commented 6 months ago

Yes you can, with pleasure.

adicorra commented 6 months ago

Update : this morning I had just setup 2 input sensors that worked fine and supplied me with the water temp.

I tried to control the cooling today and it takes it (relay 1 goes on) and the remotcon led goes green but the PUMP does not start. I checked the min outside temperature thinking it was reset and the value is correct.

I don't know whats going on.

Also, if I change the "Room Cooling Setpoint" the value on the remotcon doesn't change. Weird. I sent commands over the gateway such as 01 06 00 07 00 15

adicorra commented 6 months ago

Found the issue ! Before I had the LAN adpater and when I removed it (because its not compatible with a Remotcon + DCOM), my room thermostat switched to "At Unit" in [A.2.1.B] - Once switched back to "In Room" as it should be (thermostat) then all came back as before and HP working now with Climate Entities from HA.

adicorra commented 6 months ago

@budulinek here is a picture of the full kit installed on a DIN rail inside the indoor unit.

IMG_8763

You can use it as you wish.

adicorra commented 5 months ago

A lot of invalid RTU responsed (in just 12h hours). What are these coming from ? My RS485 card is working fine, no errors reported by the HP.

Timeouts

budulinek commented 5 months ago

A lot of errors? Come on...

Most probable cause of these soft errors: Arduino delays in processing the response. Arduino is a single-threaded computer. I have invested a lot of effort in optimizing the code to make it non-blocking (I have even modified some of the core functions in the ethernet library). But I suspect that under certain circumstances (0,5% of cases), Arduino is not fast enough to process the Modbus RTU response. What probably happens:

As I said, Invalid RTU Response and Response Timeout are soft (fully recoverable) errors. Treat them as warnings - no need to worry about them. Watch out for Slave Responded with Error, Gateway Overloaded and Slave Failed to Respond.

adicorra commented 5 months ago

No problem, I was anticipating your answer that it is not an issue since I mentioned not to have errors. I was just curious to understand from where these "dropped communications" could come from and I think you have a given a clear analysis. Your project is so good that it even tracks such "missed paquets". I really appreciate what you have done on optimizing the code. A nice project in the end. Did you consider industrializing it in a complete package ?

adicorra commented 5 months ago

Hi @budulinek

How do we disable this if we have hardware flow control ?

define RS485_CONTROL_PIN 6

Do we just "delete" the line?

PS : im facing issues with the arduino not accessible when it starts (I havent identified why yet).

adicorra commented 5 months ago

@StefanR71 Arduino ethernet is just crap, not industrial and not stable. Going with this, industrial and works perfectly ! https://www.pusr.com/products/din-rail-rs485-serial-to-ethernet-converter-usr-dr302.html

StefanR71 commented 5 months ago

@StefanR71 Arduino ethernet is just crap, not industrial and not stable. Going with this, industrial and works perfectly ! https://www.pusr.com/products/din-rail-rs485-serial-to-ethernet-converter-usr-dr302.html

Yes it is working, when you query only single registers or registers that are directly following. But when you query multiple registers like 2, 8, 30 then it isn't working you will receive only the answer for the first register. I was in touch with the support and they told me this is an issue.

adicorra commented 5 months ago

This is not an issue to control the Altherma,

StefanR71 commented 5 months ago

This is not an issue to control the Altherma,

It is an problem when you query the following registers in one query:

Input registers: 29, 30, 34, 36, 37, 39, 40, 41, 42, 43, 44, 48, 51, 52 Holding registers: 0, 1, 2, 3, 9, 11

When i send this directly to the HomeHub via Modbus TCP i'm getting an answer. But when the HomeHub is in RTU mode and i use the USR IOT gateway i'm gettig a timeout, because the gateway don't understand multiple Modbus packets in one TCP packet.

So query single registers is a workaround to get this working but the behavior of the gateway isn't correct.

adicorra commented 5 months ago

Ok, but what devices do such multiple requests ? I don’t think HA does this nor the Fibaro app.

I will test the commercial one and let you know. The fact that Arduino is some sort of « lego » board is a big issue, not reliable, no electrostatic standards, ETH is not reliable, so many drawbacks. Sometimes you start it and nothing.

StefanR71 commented 5 months ago

I don't know i have written my onwn monitoring and i was using this to query a Modbus device: https://github.com/favalex/modbus-cli

Here i have created a register file:

reg_pumpe i@29:einaus
reg_verdichter i@30:einaus
reg_durchfluss i@48
reg_dreiwege i@36:dreiwege
reg_hk_mode_ist i@37:betrieb
reg_aussentemperatur i@43
reg_warmwasser i@51:status
reg_raumheizung i@52:status
reg_vorlauf_phe i@39
reg_vorlauf_buh i@40
reg_rucklauf i@41
reg_ist_warmwasser i@42
reg_kaeltemittel i@44
reg_soll_heizen h@0
reg_soll_kuehlen h@1
reg_hk_mode h@2:betrieb
reg_hk_status h@3:einaus
reg_soll_warmwasser h@9
reg_ww_status h@11:einaus

:einaus
  0=aus
  1=ein

:dreiwege
  0=raumheizung
  1=brauchwasser

:betrieb
  0=auto
  1=heizen
  2=kuehlen

:status
  0=untaetig
  1=betrieb

And then i query:

modbus -s 1 -r /haus/heizung/register 192.168.77.82:502 reg*

And get all the values in one batch:

reg_soll_heizen: 42 0x2a reg_soll_kuehlen: 18 0x12 reg_hk_mode: 1 0x1 heizen reg_hk_status: 1 0x1 ein reg_soll_warmwasser: 50 0x32 reg_ww_status: 1 0x1 ein reg_pumpe: 1 0x1 ein reg_verdichter: 1 0x1 ein reg_abtauen: 0 0x0 aus reg_dreiwege: 1 0x1 brauchwasser reg_hk_mode_ist: 1 0x1 heizen reg_vorlauf_phe: 4670 0x123e reg_vorlauf_buh: 4660 0x1234 reg_rucklauf: 4180 0x1054 reg_ist_warmwasser: 4480 0x1180 reg_aussentemperatur: 440 0x1b8 reg_kaeltemittel: 3800 0xed8 reg_durchfluss: 2820 0xb04 reg_warmwasser: 1 0x1 betrieb reg_raumheizung: 1 0x1 betrieb

When i'm doing the same with the USR IOT or Waveshare gateway i'm getting only:

reg_soll_heizen: 42 0x2a reg_soll_kuehlen: 18 0x12 reg_hk_mode: 1 0x1 heizen. reg_hk_status: 1 0x1 ein TimeoutError: timed out

I'm using here for my programs a ESP32 WROOM board, this is running very stable, i have no problems with that device. But how stable a device is, is also depending on the librarys you are using. Some have memory leaks, then it is worth to search for other version and test again...

And i think such devices as USR IOT or Waveshare are using Chips like a ESP32 too... So it depends only on the program and librarys you are using if a device is stable or not.

budulinek commented 5 months ago

@StefanR71 Arduino ethernet is just crap, not industrial and not stable. Going with this, industrial and works perfectly ! https://www.pusr.com/products/din-rail-rs485-serial-to-ethernet-converter-usr-dr302.html

The Wiznet W5x00 chips are good chips. The Ethernet.h library has some minor flaws, but otherwise works well. I have several Arduino + W5x00 solutions running for years without problems. In my opinion, the problem is a poor design of some Arduino ethernet shield. I am not a HW guy, but I think the issue is linked to how RST pin of the W5x00 chip is triggered:

Most W5x00 shields have the W5x00's RST pin hard wired to Arduino's RST. Usually it works well, but sometimes the W5x00 is not reset correctly during (re)start (I blame poor shield design, missing capacitor on the RST pin). As a result, the reset signal (pull down on the RST pin) may come too early, or it is too short to trigger reset of the W5x00 chip.

Best W5x00 shields have the W5x00's RST pin hard wired to a dedicated pin (rather than Arduino's RST). I have Nano W5500 shield (unfortunately no longer in production) which has RST on pin 7. This is excellent solution because then I can reset the W5x00 programatically. Once Arduino starts, I pull down pin 7 for a while to reset W5x00 and then I continue calling the Ethernet library. ETH_RESET_PIN can be configured in advanced_settings.h. Check your ethernet shield, maybe you also have RST on a dedicated pin.

If you still want to give Arduino the chance, you may try a "bypass" solution:

mkarnebeek commented 4 months ago

I have some issues connecting my Home Hub with the Altherma 3 R F unit.

According to the installers reference guide, there should be a Daikin HomeHub menu entry in the Installer Settings menu. This doesn't show up. I do have a Daikin Home Controls option in the main menu, but that seems unrelated.

The Home Hub is unresponsive to Modbus RTU and over TCP it responds with 32k values for all registers. I think the Home Hub didn't pair correctly with the indoor unit.

Indoor unit: EHVX08S23EJ6V Outdoor unit: ERGA08EAV3H

Unit interface software: V07.04.00 Unit interface micon ID: ID20010E0A Micon ID inside: ID0222

I measured 15-16 volts on the P1P2 wires at the Home Hub, also when disconnected from the Home Hub, so the wiring seems to be in order.

Anybody any experience to share, or hints for me to get it working?

StefanR71 commented 4 months ago

I thik you must call the Daikin service to install the current software.

See here in the compatibility: https://www.daikin.de/content/dam/document-library/Installer-reference-guide/heat/accessories/ekrhh/EKRHH_Installer%20reference%20guide_4PEN744838-1C_English.pdf

You need the MicronID 0223 and software v7.3.0.

mkarnebeek commented 4 months ago

Ah, I was confusing it with the "Interface Micon ID" which is ID20010E0A in my system, which seemed higher than the long version listed there ("Hydro SW version").

Searching for a bit, it looks like this isn't for me to be able to do (looks like they are directly flashing the board). I'm hoping an installer can perform it, or otherwise i'll just have to get Daikin to do it.

marcpuca commented 4 months ago

adicorra where abouts did you pick up the DCOM unit for 320€? Thanks

googie89 commented 2 months ago

I have some issues connecting my Home Hub with the Altherma 3 R F unit.

According to the installers reference guide, there should be a Daikin HomeHub menu entry in the Installer Settings menu. This doesn't show up. I do have a Daikin Home Controls option in the main menu, but that seems unrelated.

The Home Hub is unresponsive to Modbus RTU and over TCP it responds with 32k values for all registers. I think the Home Hub didn't pair correctly with the indoor unit.

Indoor unit: EHVX08S23EJ6V Outdoor unit: ERGA08EAV3H

Unit interface software: V07.04.00 Unit interface micon ID: ID20010E0A Micon ID inside: ID0222

I measured 15-16 volts on the P1P2 wires at the Home Hub, also when disconnected from the Home Hub, so the wiring seems to be in order.

Anybody any experience to share, or hints for me to get it working?

I have a Daikin Altherma 3 H HT with a Hydro SW version (Micon ID) 20017701 and created a support ticket directly by Daikin to update the firmware so i could use the home hub. A week later, a technician from daikin arrived and updated both the indoor and outdoor units. Now i can connect to the Home Hub and control my heat pump via Modbus TCP.

mkarnebeek commented 2 months ago

Thank you for the update! Did they do it for free or charge you? If they did, what do they charge?

adicorra commented 2 months ago

This was on eBay from a discounted seller (new). But I saw you can find it for 380€ on this website. https://www.maison-energy.com/pompes-a-chaleur-R20/dcom-lt/io-M161430.html

googie89 commented 2 months ago

Thank you for the update! Did they do it for free or charge you? If they did, what do they charge?

Yes, this update was free of charge. You should ask for a free firmware update to use the home hub. Here the link to the german daikin support page https://www.daikin.de/de_de/privatkunden/service/kundendienstanforderung.html

mkarnebeek commented 2 months ago

@googie89 Thank you. I've just reached out to Daikin NL today based on this information, and they tell me they can't help me, an an installer needs to do it with tooling from Daikin. Could you supply me with additional information on how to open that support ticket with them? Like, did you call, reference a form, or did you find information somewhere?

mkarnebeek commented 2 months ago

Had another contact with Daikin today, and they informed me procedures in Germany are different from Netherlands, and I'll have to go through the installer. Unfortunately my attempts the last 4 months to find an installer who responds at all, has time and understands what i'm trying to achieve have been futile. Daikin NL escalated my issue now and i'll get an installer appointed soon. Let's see that happening first before i'll believe it...

mkarnebeek commented 1 week ago

Ok, So after two escalations at Daikin and months of back-and-forth between me, an installer and Daikin, finally someone from Daikin showed up and performed the update. Right after that, it all just worked :). They didn't mention anything about a rate or charge, so i'm assuming for now they performed it for free, or i'll be having another discussion with me.