Skip to content

Home Assistant

Morten Mathiasen edited this page Sep 26, 2020 · 29 revisions

Home assistant

Home assistant is an open source and free home control system running on more platforms. The nice looking user interface can remote control devices using PIIR.

To activate PIIR transmission from Home assistant you need to have a user interface card that will trigger PIIR. For climate control you can configure a MQTT enabled Climate card:

climate:
  - platform: mqtt
    name: "HVAC"
    min_temp: 8
    max_temp: 30
    modes:
      - auto
      - heat
      - cool
      - fan_only
      - "off"
    swing_modes:
      - auto
      - horisontal
      - vertical
      - off
    fan_modes:
      - auto
      - powerful
      - quiet
      - very high
      - high
      - medium
      - low
      - very low
    power_command_topic: "hvac/power/set"
    mode_command_topic: "hvac/mode/set"
    temperature_command_topic: "hvac/temperature/set"
    fan_mode_command_topic: "hvac/fan/set"
    swing_mode_command_topic: "hvac/swing/set"
    precision: 1.0

Such a configuration will generate a card like this within Home assistant user interface:

When the user changes card state then PIIR will be called from Home assistant by an automation trigger:

automation:
  - alias: run_set_ac
    trigger:
      platform: state
      entity_id: climate.HVAC
    action:
      service: shell_command.send_ac_state

shell_command:
  send_ac_state: "sudo piir --remote hvac_panasonic --feature temperature={{ state_attr('climate.HVAC', 'temperature') }} --feature mode={{ 'HEAT' if is_state('climate.HVAC','heat') else 'COOL' if is_state('climate.HVAC', 'cool') else 'FAN' if is_state('climate.HVAC', 'fan_only') else 'AUTO' if is_state('climate.HVAC', 'auto') else 'OFF' }} --feature option={{ 'QUIET' if is_state_attr('climate.HVAC', 'fan_modes', 'quiet') else 'POWERFUL' if is_state_attr('climate.HVAC', 'fan_modes', 'powerful') else 'AUTO' }} --feature fan={{ 'AUTO' 'POWERFUL' if is_state_attr('climate.HVAC', 'fan_modes', 'powerful') else 'QUIET' if is_state_attr('climate.HVAC', 'fan_modes', 'quiet') else 'VERYFAST' if is_state_attr('climate.HVAC', 'fan_modes', 'very fast') else 'FAST' if is_state_attr('climate.HVAC', 'fan_modes', 'fast') else 'MEDIUM' if is_state_attr('climate.HVAC', 'fan_modes', 'medium') else 'SLOW' if is_state_attr('climate.HVAC', 'fan_modes', 'slow') else 'VERYSLOW' if is_state_attr('climate.HVAC', 'fan_modes', 'very slow') else 'AUTO' }} --feature updown={{ 'AUTO' if is_state_attr('climate.HVAC', 'swing_modes', 'auto') else 'AUTO' if is_state_attr('climate.HVAC', 'swing_modes', 'vertical') else 'HIGH' }} --feature leftright={{ 'AUTO' if is_state_attr('climate.HVAC', 'swing_modes', 'auto') else 'AUTO' if is_state_attr('climate.HVAC', 'swing_modes', 'horisontial') else 'MIDDLE' }}"

Now PIIR will be called to send an IR command each time climate component state changes within Home assistant.

Clone this wiki locally