Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Target Temperature is never displayed and can't be set, also fan modes are not displayed #50

Open
escamoteur opened this issue Nov 12, 2023 · 13 comments

Comments

@escamoteur
Copy link

The problem

Hi,

I was really be thrilled to find your virtual climate package unfortunately it does not work as expects.
this is my config

- platform: climate_template
    name: Klima Wohnzimmer
    unique_id: 8f58e31a-2df2-4399-91f4-8430849fe8c2
    modes:
      - "auto"
      - "heat"
      - "dry"
      - "off"
      - "cool"
      - "fan_only"
    fan_modes:
      - "auto"
      - "low"
      - "medium"
      - "high"
    min_temp: 16
    max_temp: 30

    # get current temp.
    current_temperature_template: "{{ states('sensor.temp_wohnzimmer_temperature') }}"


    # get current humidity.
    current_humidity_template: "{{ states('sensor.temp_wohnzimmer_humidity') }}"

But on my dashboard I only see:

image
image

and if I try to change the temperature I get an error.
In the attributes I only see:
image

I would like to use the component inside another automation that only queries the states of this attributes, but unfortunately it doesn't work.

What version of Template Climate has the issue?

No response

What version of Home Assistant are you running?

No response

What type of installation are you running?

Home Assistant OS

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

@holymountain92
Copy link

same issue here, would like to use this to configure my HRU

@nicolaus-hee
Copy link

nicolaus-hee commented Nov 17, 2023

@escamoteur:

Missing target temperature: Have you tried populating target_temperature_template, as well? Is missing in your YAML.

Setting target temperature: Check this example from the readme.

@nicolaus-hee
Copy link

I am facing related troubles fitting well to this issue's title.

My YAML looks like this:

climate:
  - platform: climate_template
    name: Heizung Badezimmer Clone
    unique_id: heizung_badezimmer_clone
    modes:
      - "auto"
      - "off"
      - "heat"
    min_temp: 7
    max_temp: 25
    target_temperature_template: "{{ state_attr('climate.heizung_badezimmer', 'temperature') }}"
    current_temperature_template: "{{ state_attr('climate.heizung_badezimmer', 'current_temperature') }}"

The state of climate.heizung_badezimmer from which the above is to somewhat clone is:

hvac_modes:
  - heat
  - "off"
min_temp: 8
max_temp: 28
preset_modes:
  - eco
  - comfort
current_temperature: 21
temperature: 16
preset_mode: eco
battery_low: false
battery_level: 100
holiday_mode: false
summer_mode: false
window_open: false
friendly_name: Heizung Badezimmer
supported_features: 17

However, target_temperature_template in heizung_badezimmer_clone is not shown:

hvac_modes:
  - auto
  - "off"
  - heat
min_temp: 7
max_temp: 25
target_temp_step: 1
current_temperature: 21
friendly_name: Heizung Badezimmer Clone
supported_features: 0

Consequently, I also have no target temperature in the GUI.

aa

What am I doing wrong?

@escamoteur
Copy link
Author

escamoteur commented Nov 17, 2023 via email

@nicolaus-hee
Copy link

It's true that it is not included in the readme example but it's listed as an option in the readme and your YAML doesnt included it, at least the part you pasted above. So I'd give that a go. I've tried and still don't see it, though.

@escamoteur
Copy link
Author

escamoteur commented Nov 18, 2023 via email

@nicolaus-hee
Copy link

nicolaus-hee commented Nov 18, 2023

OK, let's say:

  1. climate.thermostat_entity = your original climate entity, e.g. thermostat on radiator

  2. klima_wohnzimmer = unique_id of your virtual climate device (which you named "Klima Wohnzimmer") which climate_template will turn into a climate entity named climate.klima_wohnzimmer.

On to your two questions:

To see the current target temperature set on climate.thermostat_entity also on climate.klima_wohnzimmer, try adding:

target_temperature_template: "{{ state_attr('climate.thermostat_entity', 'temperature') }}"

To make the target temperature of climate.thermostat_entity change when you change / set it on your virtual "Klima Wohnzimmer" entity, you need to add an action to your configuration, like so (untested):

  unique_id: klima_wohnzimmer
  set_temperature:
    - service: climate.set_temperature
      data:
        entity_id: climate.thermostat_entity
        temperature: "{{ state_attr('climate.klima_wohnzimmer', 'temperature') }}"

@holymountain92
Copy link

Even with the config to the basics it doesn't work. current_ is displayed correctly, target_ isn't.
Screenshot 2023-11-18 at 17 27 41

    target_temperature_template: "30.0"
    
      # get current temp.
    current_temperature_template: "20.0"

    # get current humidity.
    current_humidity_template: "66.0"

@escamoteur
Copy link
Author

escamoteur commented Nov 18, 2023 via email

@nicolaus-hee
Copy link

nicolaus-hee commented Nov 18, 2023

Dies it work for you with your settings?

As mentioned before: No. But I was hoping I did something wrong and it'd work for you guys.

Do I have to set my real climate entity there? I thought this template would create a pure virtual one that I can use to control my custom automation with?

Ah, see what you mean. Thought you wanted to control a 'real' climate device.

@scuba75
Copy link
Contributor

scuba75 commented Nov 21, 2023

You have to have a set_temperature action.
Can set it to control a number helper

For any of the switches/modes to show you have to have an action for them to peform along with a template so it knows where it is.
It can be all virtual with helpers or templates.

@escamoteur
Copy link
Author

I got it working:

  - platform: climate_template
    name: Test Thermostat
    unique_id: 76c49564-3347-4a48-8732-cf88ee6729ff
    modes:
      - "auto"
      #     - "dry"
      - "off"
    #      - "cool"
    #      - "heat"
    #     - "fan_only"
    fan_modes:
      - "auto"
      - "low"
      - "medium"
      - "high"
    min_temp: 16
    max_temp: 30

    # get current temp.
    current_temperature_template: "{{ states('sensor.temp_wohnzimmer_temperature') }}"

    # get current humidity.
    current_humidity_template: "{{ states('sensor.temp_wohnzimmer_humidity') }}"

    set_temperature:
      - service: input_number.set_value
        data:
          entity_id: input_number.ziel_temp_wohnzimmer
          value: "{{ state_attr('climate.test_thermostat', 'temperature') }}"
    set_fan_mode:
      - service: input_text.set_value
        data:
          entity_id: input_text.hvac_mode_wohnzimmer
          value: "{{ state_attr('climate.test_thermostat', 'fan_mode') }}"

@holymountain92
Copy link

The above works for me too indeed. Seems like the set_temperature is a mandatory field to get the rest working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants