Fairland heat pump to HA

Hi there

I want to build a smart system for heating a pool. I’ve recently configurate HA in my house. What I try to do is giving my heat pump (fairland with wifi module that works with an app) a start signal when our solar system generate 3000W. I already added Growatt to my HA so I can see when it is equal to 3000W.

Anybody who has an idea how to communicate with a fairland heat pump?

I have a Fairland heat pump for my pool and solar pannels :slight_smile: so same situation. What i did is to put a shelly relay on the heat pump to turn it on/off when there is enough solar energy.
I would like a better integration but could not find anything.

Cheers:)

1 Like

Hi I wrote to fairland and he sent me this mail:

It is a pity that the complete API documentation could not be provided to you, as the APPs were developed in cooperation with Tuya.

For the API documentation, please find enclosed PDF for your reference.

Furthermore, there are 2 web links for your reference.

LINK 1: Features Overview · GitBook

LINK 2: https://developer.tuya.com/en/docs/iot/open-api/api-list/api/api?id=K989ru6gtvspg 

Appreciate your understanding.

Hi,

I have tried a lot of things, but for so far I can only turn it on or off.
Here’s how I did it:

  • Download the tuya app on your phone and link the heat pump
  • Create a smart home project in the tuya developer page!
  • Link the device and the app in the project
  • install tuya v2 in home assistant and enter your client ID and secret in the configuration.yaml
  • in the config folder go to costum component
  • select tuya v2
  • go to switch.py and add “rs” as supported type
  • the switch is now visable in HA

I am trying to find the other function, but in the API explorer from Tuya I only found the switch function so far.
Heat pump.PNG|690x314

Anyone had any luck with this in the meantime? I also want to connect my fairland inver-x to HA.

I just recently had one installed… did not yet dig any deeper with tuya myself, but seems on OpenHab forum someone got more success: How to add a Tuya based pool heat pump to OpenHAB - Tutorials & Examples - openHAB Community
Maybe same technique can be applied for the Home Assistant integration?

i dont have one of these pumps, but it might be worth trying to add it to localtuya and see what attributes/controls you get ?

Hi,

did anyone made progress controlling the heat pump?

Hi,

  1. install to phone tuya app https://play.google.com/store/search?q=tuya&c=apps

  2. reset wifi module on fairland heat pump

  3. connect to tuya app

  4. install tuya to Home Assistant this integration Tuya - Home Assistant

  5. setup new integration on home assistant
    bazen3

  6. login by your account

  7. after login it is everything is work, device is added like climate
    bazen2

  8. you can turn off/on device, setup the target temp and see current temp.
    bazen5

but there is some other problems, like minimum temperature is -22 and maximum is 104. I do not know where I can change it. In TUYA IOT platform I can see other information like motor speed, valve, HVAC mode and etc…

If anybody help me with this, it will be very helpful.

Nice! I tried to add the HP to the Tuya app but it would not add it. It sees the device but does not allow to add it.

I want to share my experience with a Fairland Heatpump. Even I do not use HomeAssistent I think the info can be usefull. Fairland was very helpfull and send me Modbus documents about the coils/registers etc.

Details can be found here
https://www.domoticz.com/forum/viewtopic.php?t=38835

3 Likes

My heat pump show me, its local wifi like “SmartLife-6789” I connect to this wifi and next no problem add to app.

But today I can not see correct current temperature. Correct is 27 but entity has 20. In the TUYA app is correct 27. It is strange.

1 Like

Ik kan Tuya v2 niet meer terug vinden bij de integraties, is er een andere oplossing ondertussen misschien Lander?
I can no longer find Tuya v2 in the integrations, is there another solution in the meantime maybe Lander?

@dictus.jurgen I can still find the Tuya integration here: Tuya - Home Assistant

But combined with my Fairland Heat Pump (IXR46), I cannot set target temperatures, nor see the current temperature.
I can only turn the heating on or off, just like @Lander77

1 Like

I did - by the way - manage to automate the heating of my pool more or less in the way that the topic starter wanted
Might be interesting for others who are arriving in this thread while googling (like I did)

I needed to set the wanted temperature of the heat pump in the Tuya-app (because currently I’m not able to import this into HA), but after that, my automation only needs the heat pump to be turned on or off based on the amount of watt I’m returning to the grid (by reading the P1 port of my digital meter)

I created two automations: one turning it on, one turning it off.

  • If I am returning more than 2.850 watt for more than 5 minutes consecutive, the heat pump turns on
  • If I am taking more than 300 watt for more than 3 minutes consecutive, the heat pump turns off

(I added those time delays to prevent the heat pump turning on & off all the time on a day with sun & clouds, or if someone in the house is making a coffee)

alias: Warmtepomp ON
description: ""
trigger:
  - platform: numeric_state
    entity_id: sensor.p1_meter_id_active_power
    for:
      hours: 0
      minutes: 5
      seconds: 0
    below: -2850
condition: []
action:
  - device_id: long_id_code
    domain: climate
    entity_id: climate.inverter_pool_heat_pump
    type: set_hvac_mode
    hvac_mode: heat
mode: single
alias: Warmtepomp OFF
description: ""
trigger:
  - platform: numeric_state
    entity_id: sensor.p1_meter_id_active_power
    for:
      hours: 0
      minutes: 3
      seconds: 0
    above: 300
condition: []
action:
  - device_id: long_id_code
    domain: climate
    entity_id: climate.inverter_pool_heat_pump
    type: set_hvac_mode
    hvac_mode: "off"
mode: single
1 Like

I bought a pool heat pump from Meranus at the beginning of this year. Since this has no wifi integrated, I wanted to save myself the wifi-box and integrate the heat pump directly via modbus in homeassistant. I was able to find out that the manufacturer of the device is aquark from China and emailed to ask for the mode registers. I received exactly the same list as already mentioned here in the thread by Medved. With the help of the addresses I now tried to read out the data via a Mobus to TCP adapter. I use a Protoss PE11-H. After a few tries everything worked so far. To calculate the correct temperatures the offset and scale must be set. For example, the value 120 stands for 30 degrees Celsius. The calculation is as follows: (120 / 2) - 30 = 30

Enclosed the extract from my config.yaml, maybe it helps someone here. The Climates-Device I currently use only to set the setpoint temperature, I want to pack everything in a complete template in the next time.

# configuration.yaml
modbus:
  - type: tcp
    host: 192.168.0.xx
    port: 502
    name: "Protoss"
    climates:
      - name: "Meranus"
        slave: 1
        address: 3
        input_type: input
        data_type: int16
        max_temp: 40
        min_temp: 18
        offset: -30
        precision: 1
        scale: 0.5
        target_temp_register: 3
        temp_step: 1
        temperature_unit: C
        hvac_mode_register:
          address: 1
          write_registers: false
          values:
            state_auto: 1
            state_heat: 0
        hvac_onoff_register: 0
        write_registers: false
    switches:
      - name: ME6_Power
        unique_id: ME6_Power
        slave: 1
        address: 0
        command_on: 1
        command_off: 0
        write_type: coil
        verify:
            input_type: coil
            address: 0
            delay: 1
            state_on: 1
            state_off: 0
    binary_sensors:
      - name: ME6_On_Off
        unique_id: ME6_DI_0
        slave: 1
        address: 0
        input_type: discrete_input
      - name: ME6_Defrosting
        unique_id: ME6_DI_1
        slave: 1
        address: 1
        input_type: discrete_input
      - name: ME6_Error_E0
        unique_id: ME6_DI_48
        slave: 1
        address: 48
        input_type: discrete_input
        device_class: problem
      - name: ME6_Error_E1
        unique_id: ME6_DI_49
        slave: 1
        address: 49
        input_type: discrete_input
        device_class: problem
      - name: ME6_Error_E2
        unique_id: ME6_DI_50
        slave: 1
        address: 50
        input_type: discrete_input
        device_class: problem
      - name: ME6_Error_E3
        unique_id: ME6_DI_51
        slave: 1
        address: 51
        input_type: discrete_input
        device_class: problem
      - name: ME6_Error_E4
        unique_id: ME6_DI_52
        slave: 1
        address: 52
        input_type: discrete_input
        device_class: problem
      - name: ME6_Error_E5
        unique_id: ME6_DI_53
        slave: 1
        address: 53
        input_type: discrete_input
        device_class: problem
      - name: ME6_Error_E6
        unique_id: ME6_DI_54
        slave: 1
        address: 54
        input_type: discrete_input
        device_class: problem
      - name: ME6_Error_E7
        unique_id: ME6_DI_55
        slave: 1
        address: 55
        input_type: discrete_input
        device_class: problem
      - name: ME6_Error_E8
        unique_id: ME6_DI_56
        slave: 1
        address: 56
        input_type: discrete_input
        device_class: problem
      - name: ME6_Error_E9
        unique_id: ME6_DI_57
        slave: 1
        address: 57
        input_type: discrete_input
        device_class: problem
      - name: ME6_Error_EA
        unique_id: ME6_DI_58
        slave: 1
        address: 58
        input_type: discrete_input
        device_class: problem
      - name: ME6_Error_EB
        unique_id: ME6_DI_59
        slave: 1
        address: 59
        input_type: discrete_input
        device_class: problem
      - name: ME6_Error_ED
        unique_id: ME6_DI_61
        slave: 1
        address: 61
        input_type: discrete_input
        device_class: problem
      - name: ME6_Error_P0
        unique_id: ME6_DI_64
        slave: 1
        address: 64
        input_type: discrete_input
        device_class: problem
      - name: ME6_Error_P1
        unique_id: ME6_DI_65
        slave: 1
        address: 65
        input_type: discrete_input
        device_class: problem
      - name: ME6_Error_P2
        unique_id: ME6_DI_66
        slave: 1
        address: 66
        input_type: discrete_input
        device_class: problem
      - name: ME6_Error_P3
        unique_id: ME6_DI_67
        slave: 1
        address: 67
        input_type: discrete_input
        device_class: problem
      - name: ME6_Error_P4
        unique_id: ME6_DI_68
        slave: 1
        address: 68
        input_type: discrete_input
        device_class: problem
      - name: ME6_Error_P5
        unique_id: ME6_DI_69
        slave: 1
        address: 69
        input_type: discrete_input
        device_class: problem
      - name: ME6_Error_P6
        unique_id: ME6_DI_70
        slave: 1
        address: 70
        input_type: discrete_input
        device_class: problem
      - name: ME6_Error_P7
        unique_id: ME6_DI_71
        slave: 1
        address: 71
        input_type: discrete_input
        device_class: problem
      - name: ME6_Error_P8
        unique_id: ME6_DI_72
        slave: 1
        address: 72
        input_type: discrete_input
        device_class: problem
      - name: ME6_Error_P9
        unique_id: ME6_DI_73
        slave: 1
        address: 73
        input_type: discrete_input
        device_class: problem
      - name: ME6_Error_PA
        unique_id: ME6_DI_74
        slave: 1
        address: 74
        input_type: discrete_input
        device_class: problem
      - name: ME6_Error_F0
        unique_id: ME6_DI_80
        slave: 1
        address: 80
        input_type: discrete_input
        device_class: problem
      - name: ME6_Error_F1
        unique_id: ME6_DI_81
        slave: 1
        address: 81
        input_type: discrete_input
        device_class: problem
      - name: ME6_Error_F2
        unique_id: ME6_DI_82
        slave: 1
        address: 82
        input_type: discrete_input
        device_class: problem
      - name: ME6_Error_F3
        unique_id: ME6_DI_83
        slave: 1
        address: 83
        input_type: discrete_input
        device_class: problem
      - name: ME6_Error_F4
        unique_id: ME6_DI_84
        slave: 1
        address: 84
        input_type: discrete_input
        device_class: problem
      - name: ME6_Error_F5
        unique_id: ME6_DI_85
        slave: 1
        address: 85
        input_type: discrete_input
        device_class: problem        
      - name: ME6_Error_F6
        unique_id: ME6_DI_86
        slave: 1
        address: 86
        input_type: discrete_input
        device_class: problem
      - name: ME6_Error_F7
        unique_id: ME6_DI_87
        slave: 1
        address: 87
        input_type: discrete_input
        device_class: problem
      - name: ME6_Error_F8
        unique_id: ME6_DI_88
        slave: 1
        address: 88
        input_type: discrete_input
        device_class: problem
      - name: ME6_Error_F9
        unique_id: ME6_DI_89
        slave: 1
        address: 89
        input_type: discrete_input
        device_class: problem
      - name: ME6_Error_FB
        unique_id: ME6_DI_91
        slave: 1
        address: 91
        input_type: discrete_input
        device_class: problem
    sensors:
      - name: ME6_Mode
        unique_id: ME6_HR_0
        slave: 1
        address: 0
        input_type: holding
        data_type: int16
      - name: ME6_Silence
        unique_id: ME6_HR_1
        slave: 1
        address: 1
        input_type: holding
        data_type: int16
      - name: ME6_Set_temp
        unique_id: ME6_HR_3
        slave: 1
        address: 3
        input_type: holding
        data_type: int16
        offset: -30
        scale: 0.5
        device_class: temperature
        unit_of_measurement: °C
      - name: ME6_Speed
        unique_id: ME6_IR_0
        slave: 1
        address: 0
        input_type: input
        data_type: int16
      - name: ME6_Water_inlet_temp
        unique_id: ME6_IR_3
        slave: 1
        address: 3
        input_type: input
        data_type: int16
        precision: 1
        offset: -30
        scale: 0.5
        device_class: temperature
        unit_of_measurement: °C
      - name: ME6_Water_outlet_temp
        unique_id: ME6_IR_4
        slave: 1
        address: 4
        input_type: input
        data_type: int16
        precision: 1
        offset: -30
        scale: 0.5
        device_class: temperature
        unit_of_measurement: °C
      - name: ME6_Outside_temp
        unique_id: ME6_IR_5
        slave: 1
        address: 5
        input_type: input
        data_type: int16
        precision: 1
        offset: -30
        scale: 0.5
        device_class: temperature
        unit_of_measurement: °C
      - name: ME6_min_Set_temp
        unique_id: ME6_IR_17
        slave: 1
        address: 17
        input_type: input
        data_type: int16
        precision: 0
        offset: -30
        scale: 0.5
        device_class: temperature
        unit_of_measurement: °C
      - name: ME6_max_Set_temp
        unique_id: ME6_IR_18
        slave: 1
        address: 18
        input_type: input
        data_type: int16
        precision: 0
        offset: -30
        scale: 0.5
        device_class: temperature
        unit_of_measurement: °C

#switch.yaml
  - platform: template
    switches:
      silentmode_poolheizung:
        friendly_name: "Silentmode Poolheizung"
        value_template: "{{ is_state('sensor.me6_silence', '1') }}"
        turn_on:
          service: modbus.write_register
          data:
            hub: Protoss
            slave: 1
            address: 1
            value: 1
        turn_off:
          service: modbus.write_register
          data:
            hub: Protoss
            slave: 1
            address: 1
            value: 0

2 Likes

I’m not sure if I’ll connect mine with modbus but thumbs up for this integration and modbus info.

1 Like

I have now removed the climate-part of the modbus-integration and bundled the control of the heat pump completely in one device with the HACS Template Climate. For this I had to create three scripts to control temperature, silent mode and main switch. Now I’m happy with the integration so far.

If anyone is interested here’s the code:

configuration.yaml

climate:
  - platform: climate_template
    name: Poolwärmepumpe
    unique_id: meranus_poolheizung
    modes:
      - "off"
      - "heat"
    fan_modes:
      - "low"
      - "high"
    min_temp: 18
    max_temp: 40
    # get current temp.
    current_temperature_template: "{{ states('sensor.me6_water_inlet_temp') }}"
    target_temperature_template: "{{ states('sensor.me6_settemp_heat') }}"
    fan_mode_template: "{% if is_state('sensor.me6_silence', '1') -%} low {%- else -%} high {%- endif %}"
    hvac_mode_template: "{% if is_state('switch.me6_power', 'on') -%} heat {%- else -%} off {%- endif %}"
    precision: 0.1
    temp_step: 1
    # fan_mode action (silence)
    set_fan_mode:
      # send the silentmode state to modbus-device
      - service: script.meranus_set_silent
        data:
          silent: "{{ fan_mode }}"
    set_hvac_mode:
      # send the silentmode state to modbus-device
      - service: script.meranus_set_power
        data:
          power: "{{ hvac_mode }}"
    set_temperature:
      # send the silentmode state to modbus-device
      - service: script.meranus_set_temp
        data:
          temp: "{{ temperature }}"

scripts:

alias: meranus_set_power
sequence:
  - variables:
      val_power: >-
        {% if power == 'heat' -%} {{(1 | int)}} {%- else -%} {{(0 | int)}} {%-
        endif %}
  - condition: template
    value_template: >-
      {{ False if bool(states("switch.me6_power")) == bool(val_power) else True
      }}
  - service: modbus.write_coil
    data:
      hub: Protoss
      address: 0
      slave: 1
      state: "{{ val_power }}"
mode: single
alias: meranus_set_silent
sequence:
  - variables:
      val_silence: >-
        {% if silent == 'low' -%} {{(1 | int)}} {%- else -%} {{(0 | int)}} {%-
        endif %}
  - condition: not
    conditions:
      - condition: template
        value_template: "{{ is_state(\"sensor.me6_silence\", val_silence | string) }}"
  - service: modbus.write_register
    data:
      hub: Protoss
      slave: 1
      address: 1
      value: "{{ val_silence }}"
mode: single
alias: meranus_set_temp
sequence:
  - condition: not
    conditions:
      - condition: template
        value_template: "{{ is_state(\"sensor.me6_settemp_heat\", temp | int | string) }}"
  - service: modbus.write_register
    data:
      hub: Protoss
      address: 3
      slave: 1
      value: "{{ ((temp + 30) * 2 ) | int }}"
mode: single

Hi Medved, I’m facing the same problem with actual watter temperature. I would say it show surrounding temperature. Have you found a solution allready ?

The solution found here . Using Local Tuya . OMG - Tuya local HACS integration for Tuya devices in Home Assistant - YouTube obrazek

1 Like