Climate esphome

Fixed.

I changed the category … but you did not respond well to my request.

i have experience on arduino c ++ files and souliss smathome.

the esphome guide is unclear on how to make projects, or how to manage programming. it is a confusing guide that must surely be revisited. whoever is preparing for a new reality cannot take knowledge for granted

Please have a read of this: How to help us help you - or How to ask a good question

The good news is you can help fix it.

1 Like

then I have an HA on active raspberry with integrated esphome
I created a simple on off switch
now I wanted to create a thermostat and I edited the esphome file to load this example:

but i get error as shown in the image above.

Fix the spelling in your last line. See if that fixes it.

PS you were told this in the second post.

1 Like

I configured a climate bang bang on esphome with nextion display, and I can turn on and off via the touch button.
then in lambda I have a variable that increases and decreases through 2 other touch keys on nextion to set the setpoint from local without use of home assistant, however I can’t import the values of the variable to home assistant.
can someone help me?

this is what I did to turn the climate on and off:

- platform: nextion
    page_id: 0
    component_id: 3
    name: "Nextion beep button"
    id: nextion_beep_button
    on_press:
      then:
       lambda: |-
       if (id(nextion_beep_button).state) {
         if (id(bang_bang_climate).mode){
          auto call = id(bang_bang_climate).make_call();
          call.set_mode("OFF");
          call.perform();
          } else {
          auto call = id(bang_bang_climate).make_call();
          call.set_mode("AUTO");
          call.perform();
          }
         }
1 Like

Please post your code properly.

#TERMOSTATO BANG BANG CON DISPLAY NEXTION

uart:
  rx_pin: GPIO13 #D7
  tx_pin: GPIO2  #D4
  baud_rate: 9600



display:
  - platform: nextion
    update_interval: 3s
    id: clima_nextion
    lambda: |-
     // Do not wait for ACK - it slows down the process, and has no use
     it.set_wait_for_ack(false);
     if (id(Heating_D3).state){
      it.set_component_text("t0", "acceso");
     }else{
      it.set_component_text("t0", "spento");
     }
     
  
dallas:
  - pin: GPIO5
  #0x0E041623899DFF28

binary_sensor:
  - platform: status
    name: "ESP Smartthermostat Status"
  
  - platform: nextion
    page_id: 0
    component_id: 3
    name: "Nextion beep button"
    id: nextion_beep_button
    on_press:
      then:
       lambda: |-
       if (id(nextion_beep_button).state) {
         if (id(bang_bang_climate).mode){
          auto call = id(bang_bang_climate).make_call();
          call.set_mode("OFF");
          call.perform();
          } else {
          auto call = id(bang_bang_climate).make_call();
          call.set_mode("AUTO");
          call.perform();
          }
         }
         
  - platform: nextion
    page_id: 0
    component_id: 4
    name: "Nextion beep button UP"
    id: nextion_beep_button_UP    
         # In an automation
    on_press:
      then:
       - lambda: |-
          if (id(nextion_beep_button_UP).state) {
            id(bang_bang_climate).target_temperature_high += 0.5;
          } // not function
          
sensor:
  - platform: dallas
    address: 0x0E041623899DFF28
    name: "temp_dallas_1"
    id: temp_dallas_1 
     
switch:
  - platform: gpio
    name: "Heating"
    id: "Heating_D3"
    pin: GPIO15

climate:
  - platform: bang_bang
    sensor: temp_dallas_1 
    name: esp climate
    id: bang_bang_climate
    visual:
      min_temperature: 12 °C
      max_temperature: 25 °C
      temperature_step: 0.1 °C
   
    default_target_temperature_low: 12 °C
    default_target_temperature_high: 22 °C

    heat_action:
      - switch.turn_on: Heating_D3 
      
    idle_action:
      - switch.turn_off: Heating_D3

Please post your code properly.

Maybe you are new here. Edit your post and place 3 backticks before and after your code, the backticks go in a line of their own. See point 11 here How to help us help you - or How to ask a good question

EDIT please don’t ignore that link like you did when @tom_l posted it earlier in the thread!

correct…
Sorry but I’m new

Why don’t you use the climate control action? https://esphome.io/components/climate/index.html#climate-control-action

I tried but that control I don’t know how to place it … it always gives me error … I don’t know …

show me an example if you can …
thanks

We can’t tell you what you’ve done wrong if you don’t show us your code and whatever error your code throws up. Anyway actions are documented https://esphome.io/guides/automations.html#config-action

An example please @nickrout

What error are yiu seeing.

I’m not getting any errors, I haven’t even tried. I don’t understand if the control.climate should be inserted under an action of the type on … @nickrout

Make up your mind!

HI!
I see what I want. But I am only At the very beginning of the journey. Tell me, did you succeed? Can you share the code?

is working

binary_sensor:
  - platform: gpio
    pin: D5
    name: "Kombi Up Button"
    id: kombi_up_button
    internal: true
    on_press:
      - logger.log: "######### up button"
      - while:
          condition:
            and:
              - binary_sensor.is_on: kombi_up_button
              - lambda: 'return id(kombi_termostat).target_temperature < 30.0;'
          then:
          - climate.control:
              id: kombi_termostat
              mode: HEAT
              target_temperature: !lambda |-
                return id(kombi_termostat).target_temperature + 0.5;
          - logger.log:
              format: "######### set target temp %.1f"
              args: ["id(kombi_termostat).target_temperature"]
          - delay: 700ms
    on_multi_click:
    # mode off by pressing two keys
    - timing:
      - ON for at least 0.7s
      then:
      - if:
          condition:
          - binary_sensor.is_on: kombi_down_button
          - lambda: 'return id(kombi_termostat).mode;'
          then:
            climate.control:
              id: kombi_termostat
              mode: "OFF"

  - platform: gpio
    pin: D6
    name: "Kombi Down Button"
    id: kombi_down_button
    internal: true
    on_press:
      - logger.log: "######### down button"
      - while:
          condition:
            and:
              - binary_sensor.is_on: kombi_down_button
              - lambda: 'return id(kombi_termostat).target_temperature < 30.0;'
          then:
          - climate.control:
              id: kombi_termostat
              mode: HEAT
              target_temperature: !lambda |-
                return id(kombi_termostat).target_temperature + 0.5;
          - logger.log:
              format: "######### set target temp %.1f"
              args: ["id(kombi_termostat).target_temperature"]
          - delay: 700ms
 

climate:
  - platform: thermostat
    sensor: temp # sensor edit!
    name: "Kombi Termostat"
    id: kombi_termostat
    default_target_temperature_low: 23 °C
    visual:
      min_temperature: 18 °C
      max_temperature: 30 °C
      temperature_step: 0.5 °C
    heat_action:
      - switch.turn_on: kombi_relay
    idle_action:
      - switch.turn_off: kombi_relay

sensor:
  - platform: sht3xd
    temperature:
      name: "Kombi Termostat - Temperature"
      id: temp_local
    humidity:
      name: "Kombi Termostat - Humidity"
      id: humidity_local
    address: 0x44
    
  - platform: homeassistant
    id: temp_ha
    entity_id: sensor.sicaklik
    internal: true
    on_value:
      then:
        - logger.log: "######### temp_ha to temp"
        - lambda: 'id(temp).publish_state(id(temp_ha).state);'
            
  - platform: homeassistant
    id: humidity_ha
    entity_id: sensor.nem
    internal: true
    
  - platform: template
    name: "Temperature Sensor"
    id: temp
    internal: true
    lambda: |-
      return id(temp_ha).has_state() ? id(temp_ha).state: id(temp_local).state;
3 Likes
1 Like