bosch-thermostat / home-assistant-bosch-custom-component

HA custom component for Bosch thermostats
Apache License 2.0
218 stars 45 forks source link

Button to heat up water for a certain amount of time #95

Closed Rasenkantenstein closed 3 years ago

Rasenkantenstein commented 3 years ago

With the insights from the Energy Management Dashboard I was able to analyse my gas consumption. I realised quite a lot of it is used to heat up water. However, why would I need so much hot water all the time? Of course, every now and again I would enjoy a good hot bath. The Buderus panel gives the option to boost the temperature for a certain amount of time to a given temperature:

IMG_1688

I would like to integrate this feature into home assistant.

Rasenkantenstein commented 3 years ago

I found this page for inspiration: https://community.home-assistant.io/t/tado-hot-water-boost-supported/195435/3

However, I am still struggling with this setup. I have two problems:

The script hot_water_auto sets the temperature to 0°. All I want to do is switching back to EcoMode. The script to turn the hot water on (hot_water_on) throws an error:

Logger: bosch_thermostat_client.circuits.ivt.base
Source: /usr/local/lib/python3.9/site-packages/bosch_thermostat_client/circuits/ivt/base.py:156 
First occurred: 14:47:27 (1 occurrences) 
Last logged: 14:47:27

Setting temperature not allowed in this mode. Temperature is probably out of range MIN-MAX!

Logger: bosch_thermostat_client.helper
Source: /usr/local/lib/python3.9/site-packages/bosch_thermostat_client/helper.py:266 
First occurred: 14:47:32 (4 occurrences) 
Last logged: 14:47:35

Can't update data for Hotwater temp. Trying uri: /system/sensors/temperatures/hotWater_t2. Error message: URI /system/sensors/temperatures/hotWater_t2 doesn not exist: 404, message='Not Found', url=URL('http://192.168.1.185/system/sensors/temperatures/hotWater_t2')
Can't update data for Switch temp. Trying uri: /system/sensors/temperatures/switch. Error message: URI /system/sensors/temperatures/switch doesn not exist: 404, message='Not Found', url=URL('http://192.168.1.185/system/sensors/temperatures/switch')
Can't update data for Chimney temp. Trying uri: /system/sensors/temperatures/chimney. Error message: URI /system/sensors/temperatures/chimney doesn not exist: 404, message='Not Found', url=URL('http://192.168.1.185/system/sensors/temperatures/chimney')
Can't update data for Summer Winter Threshold. Trying uri: /heatingCircuits/hc1/suWiThreshold. Error message: URI /heatingCircuits/hc1/suWiThreshold doesn not exist: 404, message='Not Found', url=URL('http://192.168.1.185/heatingCircuits/hc1/suWiThreshold')

Inputs:

input_boolean:
  boost:
    name: Boost
    initial: off

input_number:
  heating_temperature:
    name: Set Max Temp
    min: 35
    max: 70
    step: 5
    unit_of_measurement: '°C'    
    icon: mdi:thermometer
    initial: 55
  heater_boost:
    name: Minutes
    initial: 45
    min: 5
    max: 120
    step: 15
    unit_of_measurement: 'min'
    icon: mdi:clock-start
  heater_time:
    name: Auto Off After
    initial: 2
    min: 2
    max: 5
    step: 1
    unit_of_measurement: 'hours'

Scripts:

# Hot Water Boost
hot_water_off:
  alias: Turn Off Hot Water
  sequence:
  - data:
      operation_mode: performance
    entity_id: water_heater.dhw1
    service: water_heater.set_operation_mode

hot_water_on:
  alias: Turn On Hot Water
  sequence:
  - data_template: 
      operation_mode: high_demand
      temperature: "{{ states('input_number.heating_temperature') | float }}"
    entity_id: water_heater.dhw1
    service: water_heater.set_temperature

hot_water_auto:
  alias: Auto Hot Water
  sequence:
  - data:
      operation_mode: performance
    entity_id: water_heater.dhw1
    service: water_heater.set_operation_mode

Automations:

# Temperatur Boost für Warmwasser
- id: '1572900431040'
  alias: Boost Start
  description: ''
  trigger:
  - entity_id: input_boolean.boost
    from: 'off'
    platform: state
    to: 'on'
  condition: []
  action:
  - service: timer.start
    data_template:
      entity_id: timer.boost
      duration: 00:{{ states.input_number.heater_boost.state | int }}
  - service: script.turn_on
    entity_id: script.hot_water_on

- id: '1572901200125'
  alias: Boost Cancel
  description: ''
  trigger:
  - entity_id: input_boolean.boost
    from: 'on'
    platform: state
    to: 'off'
  condition: []
  action:
  - service: timer.cancel
    data:
      entity_id: timer.boost
  - service: script.turn_on
    entity_id: script.hot_water_auto
  - service: input_boolean.turn_off
    entity_id: input_boolean.boost

- id: '1572935060390'
  alias: Boost End
  description: ''
  trigger:
  - event_data:
      entity_id: timer.boost
    event_type: timer.finished
    platform: event
  condition: []
  action:
  - service: notify.home_assistant
    data:
      message: "Die Wassertemperatur von {{ states('water_heater.dhw1.current_temperature') | float }} °C wurde erreicht."
  - service: input_boolean.turn_off
    entity_id: input_boolean.boost
  - service: script.turn_on
    entity_id: script.hot_water_auto

- id: '1572939461079'
  alias: Max hot water Set
  description: ''
  trigger:
  - platform: template
    value_template: "{{ states('water_heater.dhw1.current_temperature') | float >states('input_number.heating_temperature') | float}}"
  condition: []
  action:
  -  service: script.turn_on
     entity_id: script.hot_water_auto
#  -  service: notify.home_assistant
#     data:
#       message: Hot water temp reached  Max Temp set! The current hot water temp is
#         {{states('water_heater.dhw1.current_temperature') | float}} °C. Turned
#         to auto...

- id: '1572939091079'
  alias: Min hot water Set
  description: ''
  trigger:
  - platform: template
    value_template: "{{ states('water_heater.dhw1.current_temperature') | float <states('input_number.heating_temperature') | float}}"
  condition: []
  action:
  - service: script.turn_on
    entity_id: script.hot_water_on
#  - service: notify.home_assistant
#    data:
#      message: Hot water temp below Max Temp set! The current hot water temp is
#        {{states('water_heater.dhw1.current_temperature') | float}} °C. Turned
#        to on...

And Lovelace:

type: entities
title: Warmwasser-Boost
entities:
  - entity: input_boolean.boost
  - entity: timer.boost
    name: Booster Countdown
  - entity: input_number.heater_boost
    name: Minuten
  - entity: input_number.heating_temperature
    name: Zieltemperatur
  - entity: water_heater.dhw1
    name: Wassertemperatur
pszafer commented 3 years ago

Please, always attach bosch scan, so i can see what state is of your device. Anyway, switch for charging hot water is there from almost two months and temperature setpoint + time setpoint is in integration from yesterday. So just go to integration setup -> water heater dhw1 -> show disabled devices and enable Charge setpoint and Charge duration In the end you can have entities as: image

type: entities
entities:
  - entity: switch.charge
    name: Extra hot water
  - entity: number.charge_duration
  - entity: number.charge_setpoint

If you want to do multiple automation I'd put some delays between them. Changing operation mode is pretty big operation for this device and it takes from auto to manual around 3 seconds to put new data into all API endpoints. From manual to auto in KM200 it takes even 15 seconds ;).