Giter VIP home page Giter VIP logo

Comments (4)

jcwillox avatar jcwillox commented on May 31, 2024 1

Is this more what your aiming for, to turn a switch on/off based on the aircon state.

The section below set_hvac_mode is just a standard automation action, so I generated this quickly with the UI and then copied the YAML version.

# ...
    set_hvac_mode:
      if:
        - condition: state
          entity_id: climate.bedroom_aircon
          state: "off"
      then:
        - service: switch.turn_off
          data: {}
          target:
            entity_id: switch.aircon
      else:
        - service: switch.turn_on
          data: {}
          target:
            entity_id: switch.aircon

from hass-template-climate.

jcwillox avatar jcwillox commented on May 31, 2024

It can however the way I did it was with a service call to an ESPHome device and a custom bit of C code on that device to make use of the IRremoteESP8266 library, to construct and send the IR message. I don't have any experience with the Broadlink integration for Home Assistant, and I'm not sure how well it will work for this as aircons don't have discrete on/off or cool/fan IR codes, instead, they send the entire "state" of the aircon in one message.

In case it helps here's the configuration I use for my aircon.

climate:
  - platform: climate_template
    name: Bedroom Aircon
    modes:
      - "auto"
      - "dry"
      - "off"
      - "cool"
      - "fan_only"
    min_temp: 16
    max_temp: 30

    current_temperature_template: '{{ states("sensor.bedroom_temperature") }}'
    current_humidity_template: '{{ states("sensor.bedroom_humidity") }}'
    swing_mode_template: '{{ states("input_boolean.bedroom_swing_mode") }}'
    availability_template: '{{ is_state("binary_sensor.bedroom_node_status", "on") }}'

    set_hvac_mode:
      service: script.update_aircon_state

    set_fan_mode:
      service: script.update_aircon_state

    set_temperature:
      service: script.update_aircon_state

    set_swing_mode:
      service: script.update_aircon_state
script:
  update_aircon_state:
    alias: "Update Aircon State"
    sequence:
      - condition: state
        entity_id: input_boolean.enable_aircon_controller
        state: "on"
      - service: esphome.bedroom_node_aircon_state
        data:
          temperature: '{{ state_attr("climate.bedroom_aircon", "temperature") | int }}'
          operation_mode: '{{ states("climate.bedroom_aircon") }}'
          fan_mode: '{{ state_attr("climate.bedroom_aircon", "fan_mode") }}'
          swing_mode: '{{ is_state_attr("climate.bedroom_aircon", "swing_mode", "on") }}'
          light: >
            {% if light is defined %}
              {{ light }}
            {% else %}
              {{ is_state("light.bedroom_aircon_light", "on") }}
            {% endif %}

from hass-template-climate.

Jens-Wymeersch avatar Jens-Wymeersch commented on May 31, 2024

@jcwillox josh, thank you for your quick reply. The question is more how you map the values to update the 'new' entity.
You are for example working with scripts whereas I am working switches.

I am looking to map power on/off, temperature up and down, and state.

Is this possible?

from hass-template-climate.

Jens-Wymeersch avatar Jens-Wymeersch commented on May 31, 2024

@jcwillox Thank you for taking the time. The aim is to create a climate entity so I can use the same Lovelace cards as my other smart a/c's.

So I hoped with your project I would be able to make a mapping to create a climate entity (cfr. Universal media player ( https://www.home-assistant.io/integrations/universal/ ) which I used to build a media_player based on BroadLink generated switches)

from hass-template-climate.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.