select:
  - platform: modbus_controller
    modbus_controller_id: ${modbus_controller_id}
    device_id: ${device_id}
    name: "Betriebsart"
    id: ${lower_name}_HK4_Betriebsart
    address: 8049
    value_type: U_WORD
    optionsmap:
      "Aus": 0
      "Automatik": 1
      "Extraheizen": 2
      "Absenken": 3
      "Dauerabsenken": 4
      "Partybetrieb": 5

sensor:
  - platform: modbus_controller
    modbus_controller_id: ${modbus_controller_id}
    device_id: ${device_id}
    name: "Vorlauf-Isttemperatur"
    id: ${lower_name}_HK4_Vorlauf_Isttemperatur
    register_type: read
    address: 1120 #Wrong ?
    unit_of_measurement: "°C"
    device_class: temperature
    state_class: measurement
    value_type: S_WORD
    filters:
      - multiply: 0.5

  - platform: modbus_controller
    modbus_controller_id: ${modbus_controller_id}
    device_id: ${device_id}
    name: "Vorlauf-Solltemperatur"
    id: ${lower_name}_HK4_Vorlauf_Solltemperatur
    register_type: read
    address: 1121 #Wrong ?
    unit_of_measurement: "°C"
    value_type: S_WORD
    filters:
      - multiply: 0.5

  - platform: modbus_controller
    modbus_controller_id: ${modbus_controller_id}
    device_id: ${device_id}
    name: "Raumtemperatur"
    id: ${lower_name}_HK4_Raumtemperatur
    register_type: read
    address: 1122 #Wrong ?
    unit_of_measurement: "°C"
    value_type: S_WORD
    filters:
      - multiply: 0.5

binary_sensor:
  - platform: modbus_controller
    modbus_controller_id: ${modbus_controller_id}
    device_id: ${device_id}
    name: "Pumpe AN AUS"
    id: ${lower_name}_HK4_Pumpe_AN_AUS
    register_type: coil
    address: 1120

number:
  # not correct yet ?
  - platform: modbus_controller
    modbus_controller_id: ${modbus_controller_id}
    device_id: ${device_id}
    name: "Gewünschte Vorlauf-temperatur bei +10°C Außentemperatur"
    id: ${lower_name}_HK4_Vorlauf_Temperatur_10C_Aussentemperatur
    address: 1121
    entity_category: config
    unit_of_measurement: "°C"
    value_type: S_WORD
    multiply: 2
    min_value: 10
    max_value: 110

  # not correct yet ?
  - platform: modbus_controller
    modbus_controller_id: ${modbus_controller_id}
    device_id: ${device_id}
    name: "Gewünschte Vorlauf-temperatur bei -10°C Außentemperatur"
    id: ${lower_name}_HK4_Vorlauf_Temperatur_minus_10C_Aussentemperatur
    address: 1122
    entity_category: config
    unit_of_measurement: "°C"
    value_type: S_WORD
    multiply: 2
    min_value: 10
    max_value: 110

  - platform: modbus_controller
    modbus_controller_id: ${modbus_controller_id}
    device_id: ${device_id}
    name: "Absenkung der Vorlauftemperatur im Absenkbetrieb"
    id: ${lower_name}_HK4_Absenkung_der_Vorlauftemperatur_im_Absenkbetrieb
    address: 1123
    entity_category: config
    unit_of_measurement: "°C"
    value_type: S_WORD
    multiply: 2
    min_value: 0
    max_value: 70

  - platform: modbus_controller
    modbus_controller_id: ${modbus_controller_id}
    device_id: ${device_id}
    name: "Heizkreispumpe ausschalten wenn Vorlauf Soll kleiner ist als"
    id: ${lower_name}_HK4_Heizkreispumpe_ausschalten_wenn_Vorlauf_Soll_kleiner_ist_als
    address: 1129
    entity_category: config
    unit_of_measurement: "°C"
    value_type: S_WORD
    multiply: 2
    min_value: 10
    max_value: 30

  - platform: modbus_controller
    modbus_controller_id: ${modbus_controller_id}
    device_id: ${device_id}
    name: "Gewünschte Raumtemperatur während des Heizbetriebs"
    id: ${lower_name}_HK4_Gewuenschte_Raumtemperatur_waehrend_des_Heizbetriebs
    address: 1125
    entity_category: config
    unit_of_measurement: "°C"
    value_type: S_WORD
    multiply: 2
    min_value: 10
    max_value: 30

  - platform: modbus_controller
    modbus_controller_id: ${modbus_controller_id}
    device_id: ${device_id}
    name: "Gewünschte Raumtemperatur während des Absenkbetriebes"
    id: ${lower_name}_HK4_Gewuenschte_Raumtemperatur_waehrend_des_Absenkbetriebes
    address: 1130
    entity_category: config
    unit_of_measurement: "°C"
    value_type: S_WORD
    multiply: 2
    min_value: 10
    max_value: 30

  - platform: modbus_controller
    modbus_controller_id: ${modbus_controller_id}
    device_id: ${device_id}
    name: "Außentemperatur, unter der die Heizkreispumpe im Heizbetrieb einschaltet"
    id: ${lower_name}_HK4_Aussentemperatur_unter_der_die_Heizkreispumpe_im_Heizbetrieb_einschaltet
    address: 1126
    entity_category: config
    unit_of_measurement: "°C"
    value_type: S_WORD
    multiply: 2
    min_value: -20
    max_value: 50

  - platform: modbus_controller
    modbus_controller_id: ${modbus_controller_id}
    device_id: ${device_id}
    name: "Außentemperatur, unter der die Heizkreispumpe im Absenkbetrieb einschaltet"
    id: ${lower_name}_HK4_Aussentemperatur_unter_der_die_Heizkreispumpe_im_Absenkbetrieb_einschaltet
    address: 1127
    entity_category: config
    unit_of_measurement: "°C"
    value_type: S_WORD
    multiply: 2
    min_value: -20
    max_value: 50

  - platform: modbus_controller
    modbus_controller_id: ${modbus_controller_id}
    device_id: ${device_id}
    name: "Frostschutztemperatur"
    id: ${lower_name}_HK4_Frostschutztemperatur
    address: 1128
    entity_category: config
    unit_of_measurement: "°C"
    value_type: S_WORD
    multiply: 2
    min_value: -10
    max_value: 20

  - platform: modbus_controller
    modbus_controller_id: ${modbus_controller_id}
    device_id: ${device_id}
    name: "Temp. am Puffer oben ab der der Überhitzungsschutz aktiv wird"
    id: ${lower_name}_HK4_Temp_am_Puffer_oben_ab_der_der_Ueberhitzungsschutz_aktiv_wird
    address: 1135
    entity_category: config
    unit_of_measurement: "°C"
    value_type: S_WORD
    min_value: 60
    max_value: 120
