Reliable control of Heat Pump with Husdata - Finished

Hello
I am struggling of getting reliable control of Heat Pump which is equipped with Husdata.
Husdata itself in autoconfigure mode does generate climate enities.
By reliable I mean to make userproof lovelance card but I thought cause of my problems are more configuration. So that if antything is happening with HA/Hustada/Heat pump Modes and temperatures will be same in all places. Perfect thing is how climate temp does this: If You set temperature it goes red until HA gets feedback from Heatpump state (Husdata) that this is equal to what You have set.
Problem is that I have diffrent modes (OFF, AUTO, HEAT PUMP; HEATER; WARM WATER) than mqtt climate allows to.
Presets are just semi solution because with thermostat card You cant set them up and with entity card You do not get confirmation about what mode has been setted up currently.
Ofcourse there will be probably whole dashboard (grapht, picture elements etc) dedicated to climate/heating with many cards but I want to keep control of simple as it can be.
Another solution that I have investigated is nervetattoo / simple-thermostat but it is realying on already existing entities and I just can`t get my head around how to make it my way.

Edit: After one day thinking about it I can just put 2 new entities that will check if HA entities are equal to what Husdata module is reporting and if they are not color values in card in red. Additionally I could just set up automation to update them on mismatch. But in that case i will not be able to change these two values directly on heat pump. Any ideas?

Now since after card-mod improvements it is complete:
Picture elements card:
THP sensors are optional (easy to cut out of picture)

type: picture-elements
elements:
  - entity: sensor.radiator_return
    style:
      left: 69%
      top: 59%
    type: state-label
  - entity: sensor.radiator_forward
    style:
      left: 69%
      top: 73%
    type: state-label
  - entity: sensor.brine_in_evaporator
    style:
      left: 20%
      top: 76%
    type: state-label
  - entity: sensor.brine_out_condenser
    style:
      left: 20%
      top: 57%
    type: state-label
  - entity: sensor.warm_water_1_top
    style:
      left: 47%
      top: 38%
    type: state-label
  - entity: sensor.thp_lazienka_gora_temperature
    style:
      left: 80%
      top: 32%
    type: state-label
  - entity: sensor.thp_salon_temperature
    style:
      left: 80%
      top: 50%
    type: state-label
  - entity: sensor.thp_ext_temperature
    style:
      left: 11%
      top: 28%
    type: state-label
  - entity: sensor.outdoor
    style:
      left: 11%
      top: 45%
    type: state-label
  - entity: sensor.pressure_tube
    style:
      left: 47%
      top: 77%
    type: state-label
  - entity: binary_sensor.add_heat_step_1
    style:
      left: 42%
      top: 50%
    type: state-icon
  - entity: binary_sensor.add_heat_step_2
    style:
      left: 51%
      top: 50%
    type: state-icon
  - entity: sensor.danfosspraca
    name: null
    show_state: false
    show_name: false
    state:
      - color: red
        value: ERR
      - color: grey
        value: 'OFF'
      - color: orange
        value: CWU
      - color: yellow
        value: CO
    style:
      left: 46.5%
      top: 66%
      icon:
        - width: 50%
    styles:
      card:
        - '--ha-card-background': rgba(0, 0, 0, 0.0)
        - '--ha-card-box-shadow': none
    type: custom:button-card
image: /local/pc.png?v=4

Picture:

Adjustment Card requiring card-mod:

type: entities
entities:
  - entity: input_number.pctemp
    secondary_info: none
    name: NASTAWA
    card_mod:
      style: |
        :host {
        {% if is_state('sensor.danfosstempcheck', '0') %}
          color: orange;
        {% elif is_state('sensor.danfosstempcheck', '1') %}
          color: white
        {% else %}
          color: red;
        {% endif %}
        }
  - entity: input_select.pctryb
    name: Tryb
    card_mod:
      style:
        ha-select $: |
          span.mdc-select__selected-text {

          {% if is_state('sensor.danfossmodecheck', '0') %}
            color: orange !important;
          {% elif is_state('sensor.danfossmodecheck', '1') %}
            color: white !important;
          {% else %}
            color: red !important;
              {% endif %}
          }
  - entity: sensor.alarm_code
title: DANFOSS

Custom entities to compare what is in HA inputs and what Husdata is reporting:

#Check Mode HP input
- platform: template
  sensors:
    danfossmodecheck:
      friendly_name: "Danfoss Mode Check"
      value_template: >
        {% set mapper =
          {'0' : 'OFF',
          '1' : 'AUTO',
          '2' : 'POMPA CIEPŁA',
          '3' : 'PODGRZEWACZ',
          '4' : 'CWU'} %}
        {% set state = state_attr('climate.operating_mode_1', 'temperature') | int | string %}
        {% set value = mapper[state] if state in mapper else 'ERR'  %}
        {% if states('input_select.pctryb') == value %}
          {{ 1 }}
        {% else %}
          {{ 0 }}
        {% endif %}

#Check Temp HP input
- platform: template
  sensors:
    danfosstempcheck:
      friendly_name: "Danfoss Temp Check"
      value_template: >
        {% if states('input_number.pctemp') | float(default=0) == state_attr('climate.room_temp_setpoint', 'temperature') | float(default=0) %}
          {{ 1 }}
        {% else %}
          {{ 0 }}
        {% endif %}

# Interpreter of what HP is really doing based on Compressor mode and Valve positions with dedicated mdi to reflect it on image.
- platform: template
  sensors:
    danfosspraca:
      friendly_name: "Tryb Pracy"
      value_template: >
        {% if is_state('binary_sensor.compressor', 'on') and is_state('binary_sensor.switch_valve_1', 'on') %}
          {{ 'CWU' }}
        {% elif is_state('binary_sensor.compressor', 'on') and is_state('binary_sensor.switch_valve_1', 'off') %}
          {{ 'CO' }}
        {% elif is_state('binary_sensor.compressor', 'off') and is_state('binary_sensor.switch_valve_1', 'on') %}
          {{ 'Zmiana Cyklu'}}
        {% elif is_state('binary_sensor.compressor', 'off') and is_state('binary_sensor.switch_valve_1', 'off') %}
          {{ 'OFF'}}
        {% else %} 
          {{ 'ERR' }}
        {% endif %}
      icon_template: >-
        {% if is_state('binary_sensor.compressor', 'on') and is_state('binary_sensor.switch_valve_1', 'on') %}
          mdi:arrow-up-box
        {% elif is_state('binary_sensor.compressor', 'on') and is_state('binary_sensor.switch_valve_1', 'off') %}
          mdi:arrow-right-box
        {% elif is_state('binary_sensor.compressor', 'off') and is_state('binary_sensor.switch_valve_1', 'on') %}
          mdi:call-split
        {% elif is_state('binary_sensor.compressor', 'off') and is_state('binary_sensor.switch_valve_1', 'off') %}
          mdi:file-excel-box
        {% else %} 
          mdi:image-broken-variant
        {% endif %}

Automations providing two way exchange of states for temp and mode :

- id: '1649968095561'
  alias: PC Zmienia Nastawy Temperaturę Pokój PC > HA
  description: ''
  trigger:
  - platform: state
    entity_id: climate.room_temp_setpoint
    attribute: temperature
  condition: []
  action:
  - service: input_number.set_value
    data:
      value: '{{state_attr(''climate.room_temp_setpoint'', ''temperature'') }}'
    target:
      entity_id: input_number.pctemp
  mode: single
- id: '1649003507206'
  alias: PC Zmiana Nastawy Temperatury Pokój HA > PC
  description: ''
  trigger:
  - platform: state
    entity_id: input_number.pctemp
  condition: []
  action:
  - service: mqtt.publish
    data:
      topic: 4c752510bdbc/HP/SET/0203
      payload: '{{ states(''input_number.pctemp'') }}'
  mode: single
- id: '1649003236460'
  alias: PC Zmiana Trybu HA > PC
  description: ''
  trigger:
  - platform: state
    entity_id: input_select.pctryb
  condition: []
  action:
  - choose:
    - conditions:
      - condition: state
        entity_id: input_select.pctryb
        state: 'OFF'
      sequence:
      - service: mqtt.publish
        data:
          topic: 4c752510bdbc/HP/SET/2201
          payload: '0'
    - conditions:
      - condition: state
        entity_id: input_select.pctryb
        state: AUTO
      sequence:
      - service: mqtt.publish
        data:
          topic: 4c752510bdbc/HP/SET/2201
          payload: '1'
    - conditions:
      - condition: state
        entity_id: input_select.pctryb
        state: POMPA CIEPŁA
      sequence:
      - service: mqtt.publish
        data:
          topic: 4c752510bdbc/HP/SET/2201
          payload: '2'
    - conditions:
      - condition: state
        entity_id: input_select.pctryb
        state: PODGRZEWACZ
      sequence:
      - service: mqtt.publish
        data:
          topic: 4c752510bdbc/HP/SET/2201
          payload: '3'
    - conditions:
      - condition: state
        entity_id: input_select.pctryb
        state: CWU
      sequence:
      - service: mqtt.publish
        data:
          topic: 4c752510bdbc/HP/SET/2201
          payload: '4'
    default: []
  mode: single
- id: '1649968683793'
  alias: PC Zmienia Tryb PC > HA
  description: ''
  trigger:
  - platform: state
    entity_id: climate.operating_mode_1
    attribute: temperature
  condition: []
  action:
  - service: input_select.select_option
    data:
      options: "{% set mapper = {'0' : 'OFF',\n  '1' : 'AUTO',\n  '2' : 'POMPA CIEPŁA',\n
        \ '3' : 'PODGRZEWACZ',\n  '4' : 'CWU'} %}\n{% set state = state_attr('climate.operating_mode_1',
        'temperature') | int | string %}  {% set value = mapper[state] if state in
        mapper else 'ERR'  %} \n  {{ value }}\n"
    target:
      entity_id: input_select.pctryb
  mode: single

Counter of how many times Compressor has been switched on:

alias: Zliczanie włączeń sprężarki PC
description: ""
trigger:
  - platform: state
    entity_id:
      - binary_sensor.compressor
    from: "off"
    to: "on"
condition: []
action:
  - service: counter.increment
    data: {}
    target:
      entity_id: counter.pcwlaczenie
mode: single