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

Error setting operation to fan_only in irhvac integration #69

Closed crackn closed 2 years ago

crackn commented 2 years ago

Hello, I am using Tasmota IRHVAC for HA v2022.03.0+ with tasmota dev ver 10.0.0.4 (IRremote8266 v2.8.2 lib) on my LG Air and everything is working fine except that in the integration card, the fan_only option is returning an error.

the error only occurs inside the 3 dots secondary screen, at the main card screen, the fan_only button works ok.

IMG_0852

IMG_0839

IMG_0838

here is my integration configuration:

platform: tasmota_irhvac
   name: "Ar da Sala"
   command_topic: "cmnd/salaMultisensor/irhvac"
   state_topic: "stat/salaMultisensor/RESULT"
   temperature_sensor: sensor.temperatura_da_sala
   vendor: "LG"
   min_temp: 18 #optional - default 16 int value
   max_temp: 30 #optional - default 32 int value
   target_temp: 25 #optional - default 26 int value
   initial_operation_mode: "off" # optional - default "off" string value (one of the "supported_modes")
   away_temp: 26 #optional - default 24 int value
   precision: 1.0 #optional - default 1 int or float value. Can be set to 1, 0.5 or 0.1
   supported_modes:
     #- "heat"
     - "cool"
     - "dry"
     - "fan_only"
     - "auto"
     - "off" #Turns the AC off - Should be quoted
     # Some devices have "auto" and "fan_only" chaned
     # If following two lines are uncommented, "auto" and "fan" shoud be commented
     #- auto_fan_only #if remote shows fan but tasmota says auto
     #- fan_only_auto #if remote shows auto but tasmota says fan
   supported_fan_speeds:
     # Some devices say max,but it is high, and auto which is max
     # If you uncomment the following two, you have to comment high and max
     # - auto_max #woud become max
     # - max_high #would become high
     #- on
     #- off
     #- "low"
     #- "medium"
     #- "high"
     #- middle
     #- focus
     #- diffuse
     - "max"
     - "medium"
     - "min"
     - "auto"
   supported_swing_list:
     - "off"
     - "vertical" #up to down
    # - "horizontal" # Left to right
    # - "both"
   default_quiet_mode: "Off" #optional - default "Off" string value
   default_turbo_mode: "Off" #optional - default "Off" string value
   default_econo_mode: "Off" #optional - default "Off" string value
   hvac_model: "5" #optional - default "1" string value
   celsius_mode: "On" #optional - default "On" string value
   default_light_mode: "Off" #optional - default "Off" string value
   default_filter_mode: "Off" #optional - default "Off" string value
   default_clean_mode: "Off" #optional - default "Off" string value
   default_beep_mode: "Off" #optional - default "Off" string value
   default_sleep_mode: "-1" #optional - default "-1" string value

btw. another minor issue is that the swing mode for LG is a toggle function. if possible, would be great to have the toggle option in place of (Vertical / Off) drop down menu.

thanks in advance.

hristo-atanasov commented 2 years ago

Hi @crackn! Do you still have the issue with the set_hvac_mode to Fan only? I made some tests and I can't reproduce it on older and on the latest HA versions. I made a copy of your climate config on my HA instances and it works ok.

image

As for the swing toggle - currently there is no way to implement such toggle, because of a limitation of the Thermostat card.

hristo-atanasov commented 2 years ago

Update to the latest Tasmota IRHVAC v2022.03.05 (the latest release), if you still use older versiom.

crackn commented 2 years ago

Hello, I am using the latest release of tasmota IRHVAC v2022.03.05, I tested with .zip and .tar.gz just in case, latest version of homeassistant too. the error persists. only the fan_only mode is giving the dictionary error. all other functions are working OK.

btw, even with error, the fan_only command sends the IR code and the AC receive it. so the problem seems to be only at climate card details "3 dots" interface. I noted that the expected value would be "fan_only" and the entity state is "fan" so when it returns the word "fan" is not on the dictionary.

on the tasmota side, the IRHVAC mode is "Fan" stat/salaMultisensor/RESULT = {"IRHVAC":{"Vendor":"LG","Model":5,"Mode":"Fan","Power":"On","Celsius":"On","Temp":25,"FanSpeed":"Min","SwingV":"Auto","SwingH":"Off","Quiet":"Off","Turbo":"Off","Econo":"Off","Light":"Off","Filter":"Off","Clean":"Off","Beep":"Off","Sleep":-1}}

hristo-atanasov commented 2 years ago

Hi! The word "Fan" in HA is used only for showing the current_action not for setting the actual set_hvac_mode. In other words only like text on the card itself. Internally (for the Home Assistant part) fan_only is used only. When sending the command to Tasmota it is transformed to Fan. And when receiving from Tasmota the Fan mode is transformed back to fan_only in order for the integration to work. As for the displaying purposes, Home Assistant requires it to be Fan, else it throws invalid current action error .. So the problem is not from the Fan word. It is interesting why and how do you get this error. I have 2 separate instances of HA and I don't get this error. Also tried on one of my friends setup - again no error. I would suggest something. Can you comment out all of your Tasmota IRHVAC devices in the yaml file, then restart HA, then delete/remove the Tasmota IRHVAC integration completely, then restart HA, then place a fresh copy of the custom component in HA, then restart again, then uncomment back all commented Tasmota IRHVAC devices and make final restart again. This will ensure the code is tottally replaced. I'm asking you because I just installed the newest HA (the one from this april) and it works fine. I'm out of ideas why it is not working as intended.

crackn commented 2 years ago

Ok, I will do that and let you know the results.

edit: I did all the suggested steps and the error continue.

  1. remove climate integrations from configuration.yaml
  2. restart
  3. remove the tasmota IRHVAC from custom components.
  4. restart
  5. add climate integrations back to configuration.yaml
  6. restart
  7. add the tasmota IRHVAC back to custom components.
  8. restart the error still there.

any other suggestions or tests to try?

thanks error

hristo-atanasov commented 2 years ago

@crackn Update to v2022.04.08 and update me with the results. :)

crackn commented 2 years ago

Yes, now is working.

thanks !!!

irhvac-ok

hristo-atanasov commented 2 years ago

That was a little tricky to find .. Actually you've found it first and the fix was in you answer .. But it took me a while, while reading and thinking. :D I'm glad you helped me a lot to fix this. I'm only wondering: Why no one was in your shoes till now? But anyway - fixed now. :) Use it as you wish and have a fun! Cheers! :)

crackn commented 2 years ago

Maybe because there's no much people using LG AC. I think it could be fixed in irremoteesp8266 lib so all the brands use the same standard.

thanks for the fix. now its working 100%

hristo-atanasov commented 2 years ago

I might raise an issue about that, but for now I'll leave it working with the workarround. :)