Controlling a Fairland Pool Heatpump eliminating Tuya

It seems i didnt had to open up my Fairland IPHCR33. There is a modbus connection on the outside! It is connected to the modbus connection on the motherboard.
See connector right next to the yellow warning label.
It is a 4 pin connector. does somebody know what the type of connector is?
Looks like a four pin M9 connector?

link to image:

link to pump:

just ordered the items you mentioned.
On the m5stack website the item is stated as EOL?

for my pool controller, sugarvalley oxylife, i use the M5Stack Atom Lite + M5Stack ATOM Tail485. also working fine. love the little M5stack things

Likely. But where is the fun in that :slight_smile:

I have a Evolution Baseline heatpump with Tuya WiFi module.
The board is different from the one in the 1st post.
Here is a photo of a board similar to mine: https://community.simon42.com/uploads/default/optimized/3X/7/a/7ad93141db95ad965c02022a012c8b3be11a91a1_2_195x500.jpeg

The RS485 connector #2 is used by the WiFi module, the connector #1 is free - so I decided to give the esphome solution from @rstcologne a try. Great work and thanks for sharing!

I use an ESP8266 (NodeMCU Amica v2) and a RS485-2-TTL converter.
After compiling the esphome firmware, esphome came up and the TX LED on the RS485-2-TTL board starts blinking - but the log window is flooded by messages that indicate problems with the MODBUS:

(...)
22:14:37	[D]	[sensor:093]	
'PWP Compressor Power': Sending state nan W with 1 decimals of accuracy
22:14:37	[D]	[modbus_controller:037]	
Modbus command to device=1 register=0x00 countdown=0 no response received - removed from send queue
22:14:38	[D]	[sensor:093]	
'PWP Compressor Power': Sending state nan W with 1 decimals of accuracy
22:14:38	[W]	[modbus_controller:178]	
Duplicate modbus command found: type=0x1 address=0 count=1
22:14:38	[W]	[modbus_controller:178]	
Duplicate modbus command found: type=0x2 address=48 count=15
22:14:38	[W]	[modbus_controller:178]	
Duplicate modbus command found: type=0x2 address=64 count=32
22:14:38	[W]	[modbus_controller:178]	
Duplicate modbus command found: type=0x4 address=0 count=1
22:14:38	[W]	[modbus_controller:178]	
Duplicate modbus command found: type=0x4 address=2 count=3
22:14:38	[W]	[modbus_controller:178]	
Duplicate modbus command found: type=0x4 address=10 count=2
(...)

I tried several things, but none of them solves the problem.

  1. tried the original config from Richard (GitHub - rstcologne/ESP-Home-Fairland-Heatpump: Control Fairland Heatpumps without Tuya) using the hardware UART from ESP8266 (pins RX and TX)
  2. tried to use other pins - like GPIO4 and GPIO5
  3. tried to throttle the MODBUS controller with command_throttle: 2ms
  4. tried to disable the serial logger
  5. tried to swap UART0
  6. tried another ESP and another RS485-2-TTL converter

Also if I disconnect the RS485-2-TTL converter, there is no change in the warning messages. Same content, same frequency.

I even tried to connect the ESP and the RS485-2-TTL converter to the heatpump - just to check if these are just warning messages that could be ignored - but none of the sensors changed, so I assume the ESP/RS485 is just not working properly.

Any ideas what’s wrong or what else I can test?

When modbus communication is enabled do I have to disable tuya connection or can I use both?

The socket right next to the yellow label is for connecting the wifi-modul (optional)

for me it was not possible to use both connetions in parallel. Forget about the tuya connection :slight_smile: unnessessary!

In my case it seemed to work. However I never tested this. Once the HA integration worked, I eliminated Tuya.

So I should disable onboard wifi before conmecting esp or it doesnt matter?

Hello Elwell,

please update your code on github (t-can…yaml) at line 47
this is new since ESPhome update 2024.06.04 (otherwise…it won’t work any longer)
best regards Thomas

ota:
platform: esphome
password: “xxxx”

I have problem with communication:
ESP8266 mod

substitutions:
  name: pompa_ciepla_basen
  friendly_name: Pompa Ciepła Basen
  device_ip: 192.168.1.242

esphome:
  name: ${name}
  friendly_name: ${friendly_name}
  min_version: 2024.6.0
  name_add_mac_suffix: false
  project:
    name: esphome.web
    version: '1.0'

esp8266:
  board: esp01_1m

# Enable logging
logger:
#  baud_rate: 0
#  hardware_uart: UART0
#  level: INFO

#  hardware_uart: UART0_SWAP

# Enable Home Assistant API
api:

# Allow Over-The-Air updates
ota:
- platform: esphome

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  fast_connect: true
  manual_ip:
    static_ip: ${device_ip}
    gateway: 192.168.1.1
    subnet: 255.255.255.0
  ap:
    ssid: "Pompa Ciepla"
    password: "xxxxxxxx"

web_server:
  port: 80


uart:
  id: mod_bus
  rx_pin: GPIO3
  tx_pin: GPIO1
  baud_rate: 9600
  data_bits: 8
  stop_bits: 1
  parity: NONE
  
modbus:
#  flow_control_pin: GPIO4
  id: modbus1

modbus_controller:
  - id: fairland
    ## the Modbus device addr
    address: 0x0001
    modbus_id: modbus1
    update_interval: 2s

sensor:

  - platform: modbus_controller
    modbus_controller_id: fairland
    name: "PWP Speed Percentage"
    id: pwp_speed_percentage
    register_type: read
    address: 0x0
    value_type: U_WORD
    unit_of_measurement: "%"

And I keep getting this:

[modbus_controller:037]	
Modbus command to device=1 register=0x00 countdown=0 no response received - removed from send queue

Edit. Just added the main switch and it is working. Still need to test other options.
Edit 2. I can write (switch on/off, change heating, cooling) but I cannot read any sensor for example:

  - platform: modbus_controller
    modbus_controller_id: fairland
    name: "PWP Inlet water Temperature"
    id: pwp_inlet_water_temperature
    register_type: read
    address: 0x3
    value_type: U_WORD
    unit_of_measurement: "°C"

returns:

possible that tx or rx is disconnected?

Edit - all working now! BTW Both Tuya and Modbus.

Done. Update ota format for esphome 2024.6+ · Elwell/pool-heatpump@8a5b8ab · GitHub

Quite likely - Ours had similar (4 pin circular with +12, Gnd, A, B). Sadly the cable I purchased off ebay was slightly too fat to fit compared to the original, so I chopped the (supplied) tuya wifi module one off and re-used that for my own ESPhome board

Here is the code for Climate Entity - please use GitHub - jcwillox/hass-template-climate: ❄️Templatable Climate Device for Home Assistant, Supports Running Actions On Service Calls.
You will also need to change sensor names but it should be quite easy.

  climate:
    - platform: climate_template
      name: Basen
      unique_id: basen

      modes:
        - "auto"
        - "off"
        - "cool"
        - "heat"
      min_temp: 12
      max_temp: 40
      
      current_temperature_template: "{{ states('sensor.pompa_ciepla_basen_pwp_inlet_water_temperature') }}"

      target_temperature_template: >
        {% if is_state('select.pompa_ciepla_basen_pwp_operating_mode', 'Heating') %}
          {{ states('number.pompa_ciepla_basen_pwp_target_temperature_heating') }}
        {% elif is_state('select.pompa_ciepla_basen_pwp_operating_mode', 'Cooling') %}
          {{ states('number.pompa_ciepla_basen_pwp_target_temperature_cooling') }}
        {% elif is_state('select.pompa_ciepla_basen_pwp_operating_mode', 'Auto') %}
          {{ states('number.pompa_ciepla_basen_pwp_target_temperature_auto') }}
        {% else %}
        {% endif %}

      target_temperature_low_template: >
        {% if is_state('select.pompa_ciepla_basen_pwp_operating_mode', 'Heating') %}
          18
        {% elif is_state('select.pompa_ciepla_basen_pwp_operating_mode', 'Cooling') %}
          12
        {% elif is_state('select.pompa_ciepla_basen_pwp_operating_mode', 'Auto') %}
          12
        {% else %}
        {% endif %}
            
      target_temperature_high_template: >
        {% if is_state('select.pompa_ciepla_basen_pwp_operating_mode', 'Heating') %}
          40
        {% elif is_state('select.pompa_ciepla_basen_pwp_operating_mode', 'Cooling') %}
          30
        {% elif is_state('select.pompa_ciepla_basen_pwp_operating_mode', 'Auto') %}
          40
        {% else %}
        {% endif %}

      hvac_mode_template: >
        {% if is_state('switch.pompa_ciepla_basen_pwp_power_switch', 'off') %}
          off
        {% elif states('select.pompa_ciepla_basen_pwp_operating_mode') == 'Heating' %}
          heat
        {% elif states('select.pompa_ciepla_basen_pwp_operating_mode') == 'Cooling' %}
          cool
        {% elif states('select.pompa_ciepla_basen_pwp_operating_mode') == 'Auto' %}
          auto
        {% else %}
        {% endif %}
        
      hvac_action_template: >
        {% if is_state('switch.pompa_ciepla_basen_pwp_power_switch', 'off') %}
          off
        {% elif states('select.pompa_ciepla_basen_pwp_operating_mode') == 'Heating' %}
          {% if (states('sensor.pompa_ciepla_basen_pwp_inlet_water_temperature') | float) <= (states('number.pompa_ciepla_basen_pwp_target_temperature_heating') | float) %}
            heating
          {% elif (states('sensor.pompa_ciepla_basen_pwp_inlet_water_temperature') | float) > (states('number.pompa_ciepla_basen_pwp_target_temperature_heating') | float) %}
            idle
          {% endif %}
        {% elif states('select.pompa_ciepla_basen_pwp_operating_mode') == 'Cooling' %}
          {% if (states('sensor.pompa_ciepla_basen_pwp_inlet_water_temperature') | float) <= (states('number.pompa_ciepla_basen_pwp_target_temperature_cooling') | float) %}
            heating
          {% elif (states('sensor.pompa_ciepla_basen_pwp_inlet_water_temperature') | float) > (states('number.pompa_ciepla_basen_pwp_target_temperature_cooling') | float) %}
            cooling
          {% else %}
            idle
          {% endif %}
        {% elif states('select.pompa_ciepla_basen_pwp_operating_mode') == 'Auto' %}
          {% if (states('sensor.pompa_ciepla_basen_pwp_inlet_water_temperature') | float) <= (states('number.pompa_ciepla_basen_pwp_target_temperature_auto') | float) %}
            heating
          {% elif (states('sensor.pompa_ciepla_basen_pwp_inlet_water_temperature') | float) > (states('number.pompa_ciepla_basen_pwp_target_temperature_cooling') | float) %}
            cooling
          {% else %}
            idle
          {% endif %}
        {% else %}
          idle
        {% endif %}

      set_hvac_mode:
        - service: >
            {% if hvac_mode == 'off' %}
              switch.turn_off
            {% else %}
              switch.turn_on
            {% endif %}
          target:
            entity_id: switch.pompa_ciepla_basen_pwp_power_switch
      
        - service: select.select_option
          target:
            entity_id: select.pompa_ciepla_basen_pwp_operating_mode
          data:
            option: >
              {% if hvac_mode == 'heat' %}
                Heating
              {% elif hvac_mode == 'cool' %}
                Cooling
              {% elif hvac_mode == 'auto' %}
                Auto
              {% else %}
                {{ hvac_mode }}
              {% endif %}


      set_temperature:
        - service: number.set_value
          data:
            value: "{{ temperature }}"
          target:
            entity_id: >
              {% if states('select.pompa_ciepla_basen_pwp_operating_mode') == 'Heating' %}
                number.pompa_ciepla_basen_pwp_target_temperature_heating
              {% elif states('select.pompa_ciepla_basen_pwp_operating_mode') == 'Cooling' %}
                number.pompa_ciepla_basen_pwp_target_temperature_cooling
              {% elif states('select.pompa_ciepla_basen_pwp_operating_mode') == 'Auto' %}
                number.pompa_ciepla_basen_pwp_target_temperature_auto
              {% endif %}
            

do you have more details on the plug and wire mapping?

Hi Wojtas, how did you finally get it to work. I have the same issue. Using an ESP8266, I can turn on and off the heatpump but cannot receive any sensor data.
Thanks,
Bernd

Hi all,

I also have a Fairland HeatPump (IPHR55)
After inspection, I have the blue connector for the RS485 but my initial tests were unsuccesfull in getting data to my Waveshare adapter.
Does somebody know if the DIP switches need to be set to a specifc value ? mine is now as follow ( 1 ON - 2 OFF - 3 ON - 4 OFF)

Also, how are you guys making a connection to this connector ?

Thanks in advance

Hi, I have an iphcr40 pump can you tell me what you disassembled to reach the electronic board? Good work.

If I remember correctly (I’m not close to the device right now), I removed the side panels which exposes screws to hold down the top. Top is held in place with screws in the back as well. Then I removed the top which exposes a box which contains the control board. This can be opened by unscrewing the obvious screws holding the cover in place.

At least with my device, it was reasonably obvious how to disassemble the thing.

thanks for the explanation