Reproduktor / esphome-OpenthermGW

GNU General Public License v3.0
12 stars 2 forks source link

[Request] Support overrides for numerical values #2

Open Reproduktor opened 10 months ago

Reproduktor commented 9 months ago

First working prototype is available in the branch.

Example override for DHW temperature:

  acme_opentherm_override_numeric_switches:
    - name: "Override DHW setpoint"
      message_id: 56
      value_on_request: false
      value_type: 2
      id: override_dhw_switch
      acme_opentherm_override_numeric_value:
        name: "Override DHW setpoint temperature"
        device_class: "Temperature"
        mode: "Slider"
        min_value: 30
        max_value: 60
        initial_value: 30
        step: 1
        id: override_dhw_temperature

You have to use the correct branch of the external component:

external_components:
  - source: github://Reproduktor/esphome-openthermgw@2-request-support-overrides-for-numerical-values
    components: [ openthermgw ]

An example for DHW climate control (works with IDs as defined with override entities above, plus you need to add id: dhw_temperature to your DHW temperature entity). 'Off' mode of the climate turns override off and the original thermostat is in control. 'Heat' mode overrides with selected value.

climate:
- platform: thermostat
  name: "DHW climate"
  id: dhw_climate
  sensor: dhw_temperature
  default_preset: 'off'
  min_idle_time: 1s
  min_heating_off_time: 1s
  min_heating_run_time: 1s
  heat_deadband: 100
  heat_overrun: 100

  visual:
    min_temperature: 5
    max_temperature: 60
    temperature_step: 1
  heat_action:
    - delay: 1ms
  idle_action:
    - delay: 1ms
  on_state:
    - lambda: |-
        if(x.mode == CLIMATE_MODE_OFF)
        {
          id(override_dhw_switch).publish_state(false);
        }
        else
        {
          id(override_dhw_switch).publish_state(true);
          id(override_dhw_temperature).publish_state(x.target_temperature);
        }

  preset:
    - name: 'off'
      default_target_temperature_low: 10 °C 
      mode: 'off'
    - name: away
      default_target_temperature_low: 10 °C 
      mode: heat
    - name: sleep
      default_target_temperature_low: 46 °C 
      mode: heat
    - name: comfort
      default_target_temperature_low: 56 °C 
      mode: heat