hristo-atanasov / Tasmota-IRHVAC

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

Climate: “Turn on” service not working #86

Closed syfq91 closed 2 years ago

syfq91 commented 2 years ago

When use “climate: turn on” service, it send “off” command. Full output from tasmota console:

21:59:45.981 MQT: stat/irBlaster/RESULT = {"IRHVAC":{"Vendor":"PANASONIC_AC","Model":6,"Mode":"Off","Power":"Off","Celsius":"On","Temp":24,"FanSpeed":"Min","SwingV":"Off","SwingH":"Off","Quiet":"Off","Turbo":"Off","Econo":"Off","Light":"On","Filter":"Off","Clean":"Off","Beep":"Off","Sleep":-1}}

AC model: Panasonic Model 6 Tasmota version: 12.1.0

nao-pon commented 2 years ago

I also use Panasonic, but there is no particular problem here.

Tasmota (with nao-pon/IRremoteESP8266) is a custom build, but the part in question this time shouldn't be different from the official one.

23:28:13.874 MQT: stat/tasmota_ac/RESULT = {"IRHVAC":{"Vendor":"PANASONIC_AC","Model":4,"Mode":"Cool","Power":"On","Celsius":"On","Temp":24,"FanSpeed":"Auto","SwingV":"Auto","SwingH":"Auto","Quiet":"Off","Turbo":"Off","Econo":"Off","Light":"Off","Filter":"Off","Clean":"Off","Beep":"Off","Sleep":-1,"Clock":1408,"Weekday":3}}

If you try what I built and it works fine, then something is wrong on Tasmota or IRremoteESP8266 side.

syfq91 commented 2 years ago

I tried your custom build, but it still sending “off” command.

0:00:09.753 MQT: tele/irBlaster/INFO1 = {"Info1":{"Module":"YTF IR Bridge","Version":"12.1.1(ir-hyp)","FallbackTopic":"cmnd/DVES_3517F8_fb/","GroupTopic":"cmnd/tasmotas/"}}
00:00:09.756 MQT: tele/irBlaster/INFO2 = {"Info2":{"WebServerMode":"Admin","Hostname":"irBlaster-6136","IPAddress":"192.168.50.189"}}
00:00:09.758 MQT: tele/irBlaster/INFO3 = {"Info3":{"RestartReason":"Software/System restart","BootCount":84}}
20:21:38.807 MQT: stat/irBlaster/STATUS = {"Status":{"Module":62,"DeviceName":"irBlaster","FriendlyName":["irBlaster"],"Topic":"irBlaster","ButtonTopic":"0","Power":0,"PowerOnState":3,"LedState":1,"LedMask":"FFFF","SaveData":1,"SaveState":1,"SwitchTopic":"0","SwitchMode":[0,0,0,0,0,0,0,0],"ButtonRetain":0,"SwitchRetain":0,"SensorRetain":0,"PowerRetain":0,"InfoRetain":0,"StateRetain":0}}
20:21:39.343 MQT: stat/irBlaster/STATUS1 = {"StatusPRM":{"Baudrate":115200,"SerialConfig":"8N1","GroupTopic":"tasmotas","OtaUrl":"https://ota.tasmota.com/tasmota/release/tasmota-ir.bin.gz","RestartReason":"Software/System restart","Uptime":"0T00:00:10","StartupUTC":"2022-08-26T12:21:29","Sleep":50,"CfgHolder":4617,"BootCount":84,"BCResetTime":"2021-10-03T06:03:40","SaveCount":489,"SaveAddress":"FA000"}}
20:21:39.390 MQT: stat/irBlaster/STATUS2 = {"StatusFWR":{"Version":"12.1.1(ir-hyp)","BuildDateTime":"2022-08-25T23:55:16","Boot":31,"Core":"2_7_4_9","SDK":"2.2.2-dev(38a443e)","CpuFrequency":80,"Hardware":"ESP8266EX","CR":"371/699"}}
20:21:39.443 MQT: stat/irBlaster/STATUS11 = {"StatusSTS":{"Time":"2022-08-26T20:21:39","Uptime":"0T00:00:10","UptimeSec":10,"Vcc":3.475,"Heap":27,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"MqttCount":1,"Wifi":{"AP":1,"SSId":"xxxxxx","BSSId":"xxxxxxx ","Channel":11,"Mode":"11n","RSSI":64,"Signal":-68,"LinkCount":1,"Downtime":"0T00:00:06"}}}
20:21:41.833 MQT: tele/irBlaster/STATE = {"Time":"2022-08-26T20:21:41","Uptime":"0T00:00:12","UptimeSec":12,"Vcc":3.475,"Heap":21,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"MqttCount":1,"Wifi":{"AP":1,"SSId":"xxxxxxx","BSSId":"xxxxxxx","Channel":11,"Mode":"11n","RSSI":54,"Signal":-73,"LinkCount":1,"Downtime":"0T00:00:06"}}
20:22:16.391 MQT: stat/irBlaster/RESULT = {"IRHVAC":{"Vendor":"PANASONIC_AC","Model":6,"Mode":"Off","Power":"Off","Celsius":"On","Temp":24,"FanSpeed":"Min","SwingV":"Off","SwingH":"Off","Quiet":"Off","Turbo":"Off","Econo":"Off","Light":"On","Filter":"Off","Clean":"Off","Beep":"Off","Sleep":-1,"Clock":1222,"Weekday":4}}

My configuration file:

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 2 years ago

The turn_on service calls async_turn_on in this library.

As far as the source code is concerned, "power_mode" ("Power" in mqtt JSON) does not seem to be "Off".

Is your service call YAML similar to the following?

service: climate.turn_on
target:
  entity_id: climate.br3_aircond
syfq91 commented 2 years ago

This is the service call YAML from Home Assistant Developer Tools:

service: climate.turn_on
data: {}
target:
  entity_id:
    - climate.br3_aircond

I discovered something while troubleshooting this issue. The command issued in tasmota console is following my AC state.

For example, while the aircond is off, and I call the climate: turn on service, tasmota will send off commnad:

00:40:09.649 MQT: stat/irBlaster/RESULT = {"IRHVAC":{"Vendor":"PANASONIC_AC","Model":6,"Mode":"Off","Power":"Off","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}}

But if I turn on the aircond (using original aircond remote) and call the climate: turn on while aircond is on, tasmota will send the correct on command:

01:04:37.103 MQT: stat/irBlaster/RESULT = {"IRHVAC":{"Vendor":"PANASONIC_AC","Model":6,"Mode":"Dry","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}}

I'm using this YTF IR Controller

nao-pon commented 2 years ago

This may not be directly related to your issue, but try the following options.

keep_mode_when_off : True

Some Panasonic AC models do not work if Mode is set to Off when the power is turned off. This option fixes the Mode to the current mode and sends "Power":"Off" at Turn Off.

syfq91 commented 2 years ago

I tried adding this option: keep_mode_when_off: True, but it still sending 'off' command.

But I found the issue. My aircond need Mode: parameter to be set to something valid in order to turn on the A/C.

I tried issuing command directly in Tasmota console: This command does not work:

IRHVAC {"Vendor":"PANASONIC_AC","Model":6,"Mode":"Off","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}

But these 2 command works:

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}

or

IRHVAC {"Vendor":"PANASONIC_AC","Model":6,"Mode":"On","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 found the solution for my issue, I need to add initial_operation_mode: in the configuration and change the default value from off to some other mode: auto/cool/dry.

This is my full configuration, for reference:

climate:
  - platform: tasmota_irhvac
    name: "BR3 Aircond"
    command_topic: "cmnd/br3ir/irhvac"
    state_topic: "stat/br3ir/RESULT"
    temperature_sensor: sensor.br3gateway_htu21_temperature
    humidity_sensor: sensor.br3gateway_htu21_humidity
    power_sensor: binary_sensor.br3sonoffcontact_contact
    vendor: "PANASONIC_AC"
    initial_operation_mode: "auto" ## default value was 'off', I changed to 'auto'
    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"

Thank you very much nao-pon for your help.

nao-pon commented 2 years ago

@syfq91 I may have found a bug. I will scrutinize and create a PR. Thanks! 👍