Using Generic Thermostat without having an actual thermostat

hello - i have the following setup:

  • a shelly switch that turns on and off the boiler
  • a sonoff switch that turns on and off the heat pump
  • a sonoff temperature sensor on which the automation is based.

i have the automation set that:

  • if the temperature is < than the value set by me → boiler and heat pump starts
  • if the temperature is > than the value set by me → boiler and heat pump stops

i would like to use the generic thermostat, in order to be able to set the temperature value for the automation by using the gauge of the generic thermostat.

any ideas of how i can do this?

Low temperature automation:

alias: Dormitor Oaspeti 1 - Temperatura Scazuta
  description: ''
  trigger:
  - type: temperature
    platform: device
    device_id: 0b1b7445e287ffdc999f01b2a0d49ea5
    entity_id: sensor.senzor_dormitor_oaspeti_temperature
    domain: sensor
    below: 20
  condition:
  - condition: device
    type: is_off
    device_id: 93f4d68c2d7abeaa52825eeff120b63c
    entity_id: switch.sonoff_10015aa41a_3
    domain: switch
  action:
  - type: turn_on
    device_id: 93f4d68c2d7abeaa52825eeff120b63c
    entity_id: switch.sonoff_10015aa41a_3
    domain: switch
  - type: turn_on
    device_id: 93f4d68c2d7abeaa52825eeff120b63c
    entity_id: switch.sonoff_10015aa41a_1
    domain: switch
  - service: counter.increment
    data: {}
    target:
      entity_id:
      - counter.actuatoare
      - counter.actuator_et_1
  mode: single

High temperature automation:

 alias: Dormitor Oaspeti - Temperatura Ridicata
  description: ''
  trigger:
  - type: temperature
    platform: device
    device_id: 0b1b7445e287ffdc999f01b2a0d49ea5
    entity_id: sensor.dormitor_oaspeti_1_temperature
    domain: sensor
    above: 22
  condition: []
  action:
  - type: turn_off
    device_id: 93f4d68c2d7abeaa52825eeff120b63c
    entity_id: switch.sonoff_10015aa41a_3
    domain: switch
  - service: counter.decrement
    data: {}
    target:
      entity_id:
      - counter.actuatoare
      - counter.actuator_et_1
  mode: single

Boiler automation ON:

 alias: Centrala ON
  description: ''
  trigger:
  - platform: device
    type: turned_on
    device_id: 8dc53c24420f4a9930efd43c9cca0989
    entity_id: switch.sonoff_10015aa924_1
    domain: switch
  - platform: device
    type: turned_on
    device_id: 93f4d68c2d7abeaa52825eeff120b63c
    entity_id: switch.sonoff_10015aa41a_1
    domain: switch
  - platform: device
    type: turned_on
    device_id: 9c6c082364d754bcf6c169e5cacae81e
    entity_id: switch.sonoff_10015aabf3_1
    domain: switch
  condition: []
  action:
  - type: turn_on
    device_id: 3467dc9194950e1bee9701106aaf4b59
    entity_id: switch.shellyplus1_441793a8fd9c_switch_0
    domain: switch
  mode: single

Boiler automation OFF:

 alias: Centrala OFF1
  description: ''
  trigger:
  - platform: device
    type: turned_off
    device_id: 8dc53c24420f4a9930efd43c9cca0989
    entity_id: switch.sonoff_10015aa924_1
    domain: switch
  condition:
  - condition: and
    conditions:
    - condition: device
      type: is_off
      device_id: 9c6c082364d754bcf6c169e5cacae81e
      entity_id: switch.sonoff_10015aabf3_1
      domain: switch
    - condition: device
      type: is_off
      device_id: 93f4d68c2d7abeaa52825eeff120b63c
      entity_id: switch.sonoff_10015aa41a_1
      domain: switch
  action:
  - type: turn_off
    device_id: 3467dc9194950e1bee9701106aaf4b59
    entity_id: switch.shellyplus1_441793a8fd9c_switch_0
    domain: switch
  mode: single

Generic Thermostat config:

platform: generic_thermostat    
    name: Oaspeti
    heater: switch.shellyplus1_441793a8fd9c_switch_0
    target_sensor: sensor.ewelink_th01_temperature
    min_temp: 16
    max_temp: 26
    ac_mode: false
    target_temp: 17
    cold_tolerance: 0.3
    hot_tolerance: 0

You have two target_sensor entries in your Generic thermostat.

If you need your two switches to activate in a certain order you could combine them using a Template switch,

Sorry - was a mistake on my side, there - i am using only one sensor.

What i did now, and kind of works, is:

  • installed Better Thermostat
  • created a generic thermostat set for heating, with the switch being a script to start the heating
  • created a generic theromstat set for ac, with the switch being a script to stop the heating
  • combined those 2 thermostats in Better Thermostat and now i can start and stop the heating by setting the temperature of the thermostat > sensor temperature or stop it if it is lower.

The problem that i have right now is that i also want to keep my automations, but in this situation, if i the room temperature is 21, i start the heater through the thermostat to heat until 23 and my automation is set to stop the heater at 22.5, it will create some issues.

So, now my question is if i can have a script/automation that will set basically the value of the automation (when the heater should be stopped) dinamycally to the one set by the thermostat.