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

set_temperature action does not work #55

Open
febu93 opened this issue Dec 18, 2023 · 5 comments
Open

set_temperature action does not work #55

febu93 opened this issue Dec 18, 2023 · 5 comments

Comments

@febu93
Copy link

febu93 commented Dec 18, 2023

The problem

This is my config:

climate:
  - platform: climate_template
    unique_id: 76c49564-3347-4a48-8732-cf88ee6729ff
    name: Diesel Heater

    min_temp: 5
    max_temp: 30

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

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

    # get target temperature.
    target_temperature_template: "{{ states('input_number.dieselheatertemperature') }}"

    set_temperature:
      service: input_number.set_value
      data:
        entity_id: input_number.dieselheatertemperature
        value: "{{ temperature }}"

Whenever I change the target temperature in the frontend, I get the following error:

Logger: homeassistant.helpers.script.diesel_heater
Source: helpers/script.py:1783
First occurred: 21:37:59 (17 occurrences)
Last logged: 22:06:45

Diesel Heater: Error executing script. Invalid data for call_service at pos 1: must contain at least one of entity_id, device_id, area_id.

Does anybody know, why? Thanks in advance :)

What version of Template Climate has the issue?

0.6.1

What version of Home Assistant are you running?

2023.12.3

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

@sbasmanov
Copy link

sbasmanov commented Dec 19, 2023

I just wonder, why in set_temperature You're setting value of input number? This component internally gets current temperature from input_number (current_temperature_template) and when You change this number, it calls set_temperature to apply changes to device. And You're trying to set that input_number again, so it goes into loop. In set_temperature You have to call script or any other device action that sets new temperature target.

ps: I'm not sure, but I think Your error is related to this (minus sign):
set_temperature:
- service: input_number.set_value

@enselerizer
Copy link

It seems that you are using the input_number.set_value service wrong. The following config works for me:

climate:
  - platform: climate_template
    name: Home Blower Heater
    modes:
      - "off"
      - "fan_only"
      - "heat"
    min_temp: 0
    max_temp: 35
    precision: 0.1
    temp_step: 0.1
    current_temperature_template: "{{ states('sensor.qingping_air_monitor_temperature') }}"
    target_temperature_template: "{{ states('input_number.blower_temperature') }}"
    set_hvac_mode:
      service: script.blower_heater_mode
      data: {}
    set_temperature:
      service: input_number.set_value
      target:
        entity_id: input_number.blower_temperature
      data:
        value: "{{ temperature }}"

@bbluvgg
Copy link

bbluvgg commented Mar 7, 2024

It seems that you are using the input_number.set_value service wrong. The following config works for me:

climate:
  - platform: climate_template
    name: Home Blower Heater
    modes:
      - "off"
      - "fan_only"
      - "heat"
    min_temp: 0
    max_temp: 35
    precision: 0.1
    temp_step: 0.1
    current_temperature_template: "{{ states('sensor.qingping_air_monitor_temperature') }}"
    target_temperature_template: "{{ states('input_number.blower_temperature') }}"
    set_hvac_mode:
      service: script.blower_heater_mode
      data: {}
    set_temperature:
      service: input_number.set_value
      target:
        entity_id: input_number.blower_temperature
      data:
        value: "{{ temperature }}"

Does the "off" state in the code turn off your heater? No need for additional code to map a switch to off?

@appsfinder2
Copy link

where do I find this script ? script.blower_heater_mode

@rugbyopera
Copy link

where do I find this script ? script.blower_heater_mode

You write it yourself. I assume that this script reads the climate.home_blower_heater state and does something to actually change modes.

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

6 participants