hristo-atanasov / Tasmota-IRHVAC

Home Assistant platform for controlling IR Air Conditioners via Tasmota IRHVAC command and compatible hardware
187 stars 64 forks source link

Panasonic AC - SwingV "off" not working #85

Closed syfq91 closed 1 year ago

syfq91 commented 1 year ago

My Panasonic AC (model 6) SwingV support 6 different swing modes: auto/highest/high/middle/low/lowest but not off. When selecting "off" in home-assistant I can see it issue this command in Tasmota console:

13:27:08.720 MQT: stat/irBlaster/RESULT = {"IRHVAC":{"Vendor":"PANASONIC_AC","Model":6,"Mode":"Dry","Power":"On","Celsius":"On","Temp":20,"FanSpeed":"Auto","SwingV":"Off","SwingH":"Off","Quiet":"Off","Turbo":"Off","Econo":"Off","Light":"Off","Filter":"Off","Clean":"Off","Beep":"Off","Sleep":-1}}

This command does not make the swing stop. Is it possible to overwrite the "off" with some other available swing mode? Or make it use 'default_swingv when selecting "off"?

Below are my configuration:

climate: 
  - platform: tasmota_irhvac
    name: "BR3 Aircond"
    command_topic: "cmnd/irBlaster/irhvac"
    state_topic: "stat/irBlaster/RESULT"
    temperature_sensor: sensor.br3gateway_htu21_temperature
    humidity_sensor: sensor.br3gateway_htu21_humidity
    power_sensor: binary_sensor.br3sonoffcontact_contact
    vendor: "PANASONIC_AC"
    min_temp: 16
    max_temp: 30
    target_temp: 26
    precision: 1
    supported_modes:
      - "cool"
      - "dry"
      - "auto"
      - "off"
    supported_fan_speeds:
      - "medium"
      - "min"
      - "max"
      - "auto"
    supported_swing_list:
      - "off"
      - "vertical"
    hvac_model: "6" #optional - default "1" string value
    celsius_mode: "On" #optional - default "On" string value
    default_swingv: "middle"
nao-pon commented 1 year ago

Panasonic AC is in auto mode when swing off. Auto mode is AC automatically controlled, so you need to specify a position to stop the vane completely.

Starting with v2022.08.28, this integration adds a service to control Vane. We can use Input select to control Vane.

Example

Input Select Helper

Automation

alias: Set AC SwingV
description: ""
trigger:
  - platform: state
    entity_id:
      - climate.living_ac
    attribute: swingv
    id: get
  - platform: state
    entity_id:
      - input_select.living_ac_swingv
    id: set
condition: []
action:
  - if:
      - condition: trigger
        id: set
    then:
      - service: tasmota_irhvac.set_swingv
        data:
          entity_id: climate.living_ac
          swingv: "{{states(trigger.entity_id)}}"
    else:
      - service: input_select.select_option
        data:
          option: "{{state_attr(trigger.entity_id, 'swingv')}}"
        target:
          entity_id: input_select.living_ac_swingv
mode: parallel
max: 2
nao-pon commented 1 year ago

Note: Currently you need his Github version of Tasmota-IRHVAC.

nao-pon commented 1 year ago

My understanding was slightly wrong. Many Panasonic ACs don't seem to have "off". It would also be nice to have an option to set the value to send instead of "off".

As another option, I tried the previous automation as a Blueprint.

nao-pon commented 1 year ago

When swingv and swingh are set to a value other than auto, I am considering saving it and sending it as the value when swing off.

syfq91 commented 1 year ago

It would also be nice to have an option to set the value to send instead of "off".

Yes, having this option will solve my problem. Maybe something like swingv_off_position So I can customize different “off” position for AC in different room.

As another option, I tried the previous automation as a Blueprint.

Thanks for the blueprint, I need to try this later.

nao-pon commented 1 year ago

@syfq91 I created PR #89. Could you try the swing_off branch?

syfq91 commented 1 year ago

I tried your branch, but it still not working.

I think the issue is that when I turn on the AC, Tasmota send a command with swingv: off (off is not a valid mode for my AC).

20:30:42.696 MQT: stat/br3ir/RESULT = {"IRHVAC":{"Vendor":"PANASONIC_AC","Model":6,"Mode":"Auto","Power":"On","Celsius":"On","Temp":26,"FanSpeed":"Medium","SwingV":"Off","SwingH":"Off","Quiet":"Off","Turbo":"Off","Econo":"Off","Light":"Off","Filter":"Off","Clean":"Off","Beep":"Off","Sleep":-1}}

My AC just ignore the swingv: off and set the flap in swingv: auto mode (tasmota/home assistant does not aware that the AC is running flap set to auto).

So later when I choose swing off in home assistant, Tasmota will still send a command with swingv: off

20:35:04.104 MQT: stat/br3ir/RESULT = {"IRHVAC":{"Vendor":"PANASONIC_AC","Model":6,"Mode":"Auto","Power":"On","Celsius":"On","Temp":26,"FanSpeed":"Medium","SwingV":"Off","SwingH":"Off","Quiet":"Off","Turbo":"Off","Econo":"Off","Light":"Off","Filter":"Off","Clean":"Off","Beep":"Off","Sleep":-1}}

And I have a question: I have this in the configuration file: default_swingv: "middle" When will the value default_swingv be use? I thought it will be use when turning on the AC, but as you can see in the tasmota output above, it not using the swingv: middle when turning on the AC.

nao-pon commented 1 year ago

First of all, a PR has been accepted, please use the master branch here.

default_swingv is used when the climate entity is created, not during HA startup. After that, the previous value is referenced, so I think the saved value is "off".

You can check it in the "STATUS" of the "Developer Tools". It is a fix_swingv.

FireShot Capture 011 - Developer Tools – Home Assistant - hypha duckdns org

To update the stored value send a position other than Auto with the device remote or set your desired position with the service set_swingv.

FireShot Capture 012 - Developer Tools – Home Assistant - hypha duckdns org