Climate control based on temperature

Good morning everyone,
I would like to automate the Mitsubishi air conditioners, i.e. when the temperature X is reached, turn it on. As a temperature sensor I would use the one from the air conditioner which HA sees as an entity.
Can anyone tell me how to do it or where to find out more?
Many thanks

Start by looking at the HA Thermostat integrations - like the Generic Thermostat:

You need an interface to communicate with the ac’s and HA.
I personally use the Sensibo Sky and works great.
HA sees the Sensibo as an entity for temp and RH.

Look on YouTube for more details!

Good luck!

If the Ac

If you are seeing the temperature from the AC, are you using the MELCloud integration? If so most of the work is done.

Don’t use the one from the AC but go for an external sensor. The internal AC one is very inaccurate and can be off by several degrees celsius, even when the AC is off(in case of Heavy Industries).

1 Like

I’m using the MelCloud integration.
The automation is as follows:
When Cameretta Temperatura ambiente is above 26.5 and below 50
Entity: sensor.room_temperature_sensor (Mitsubishi internal sensor)
Lower limit
Fixed number
above 26,5 celsius

Upper limit
Fixed number
below 50 celsius

Then do
Climate ‘Turn on’ on bedroom climate

Why doesn’t it work?

Thanks again for your help

In order to help you, post the code of your automation. Format it properly.

I pasted the automation code below.
One to turn on and another to turn off.
Where am I wrong?

FIRST AUTOMATION:
  mode: single
- id: '1749558910438'
  alias: ON clima cameretta
  description: ''
  triggers:
  - trigger: numeric_state
    entity_id:
    - sensor.cameretta_temperatura_ambiente
    above: 26.5
    below: 50
  conditions: []
  actions:
  - action: climate.turn_on
    metadata: {}
    data: {}
    target:
      entity_id: climate.cameretta

SECOND AUTOMATION:
  mode: single
- id: '1749569037162'
  alias: OFF clima cameretta
  description: ''
  triggers:
  - trigger: numeric_state
    entity_id:
    - sensor.cameretta_temperatura_ambiente
    above: 0
    below: 26
  conditions: []
  actions:
  - action: climate.turn_off
    metadata: {}
    data: {}
    target:
      entity_id: climate.cameretta
  mode: single

I’d remove the below 50 and above 0 lines. Besides that, the automation works, as long as you realize it will only turn on/off at the exact time that the limit is crossed, not when it is already crossed beforehand.

You are right, effectively as it only works upon passing.
Instead it should always be on when it goes beyond 27 degrees and always off when it goes down 26 degrees.
Can it be fixed?
Thank you.

An option is to periodically check and set what is appropriate. But this normally wouldn’t need fixing. If you did, you would have no chance to overrule. So I would leave it as is and see.

ok let’s see how it behaves…
In the meantime, thanks for the support.

I verified that it only works when I start the automation, at that moment it reads the value and if greater than 27 it turns on the climate.
But if the climate is off the automation does not work, a cyclical check would be needed.
For example if I restart HA upon reconnection the automation works.
How can I solve it? I’m going crazy reading articles on the internet…
If for some reason I turn off the climate manually, the automation does not start again.
I would like that whenever the temperature is above 27 the climate should turn on.
Always thanks
This is the last code:

id: '1749558910438'
alias: turn on clima cameretta
triggers:
  - entity_id:
      - sensor.cameretta_temperatura_ambiente
    above: 27
    trigger: numeric_state
    for:
      hours: 0
      minutes: 0
      seconds: 1
conditions:
  - condition: state
    entity_id: climate.cameretta
    state: 'off'
actions:
  - action: climate.turn_on
    target:
      entity_id:
        - climate.cameretta
    data: {}

I have been using Home Automation for many years but this has never been a real problem to me. The chance of the situation changing in between restarts is very small, if you are worried about it, add a trigger for startup to check the initial state.

You also need to weigh the chance of the hvac being in the wrong state (which should have a thermostat anyway, why is that not working for you?) against you not being able to intervene. If for some reason you need or want the hvac on and HA keeps turning it off or vice versa, how annoying is that?

A time pattern trigger can do periodical checks (e.g. trigger every couple of minutes and test if the conditions are warranting turning it on or off. But I would only do that for things that are crucial.

By the way, are you aware there is such a thing as a generic thermostat that does most of the heavy lifting for you? It was mentioned before. It will work similar to state triggers though.

There are many roads that lead to Rome, and this is one of them:

Create a “Threshold” helper or place the following in your config.yaml
Do not forget to restart HA.

binary_sensor:
  - platform: threshold  # will switch state ON above 27 °C and switch state OFF below 26 °C
    name: "Clima Control"
    entity_id: sensor.cameretta_temperatura_ambiente
    upper: 26.5
    hysteresis: 0.5

The sensor is “on” when it is warmer than 27 degrees, and “off” when it is colder than 26 degrees.
If it is warmer than 27 degrees and you turn off the air conditioning, you will have to turn it back on manually to reactivate the automation.

Then create the automation below:

alias: Turn on/off clima careretta
description: ""
triggers:
  - entity_id: binary_sensor.clima_control
    from:
      - "off"
      - "on"
    to:
      - "on"
      - "off"
    trigger: state
conditions: []
actions:
  - action: climate.turn_{{ trigger.to_state.state }}
    data: {}
    target:
      entity_id: climate.cameretta
mode: single

Hope this will help.

Thank you all so much for your help, I’m happy to find such helpful people on the forums.
I will try to solve my problem.
All this is an opportunity to learn how to use this fantastic Home Assistant better and better.