Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IRHVAC command should always return true mode state #9060

Closed
yoav1000 opened this issue Aug 9, 2020 · 6 comments
Closed

IRHVAC command should always return true mode state #9060

yoav1000 opened this issue Aug 9, 2020 · 6 comments
Labels
duplicated Result - Duplicated Issue

Comments

@yoav1000
Copy link

yoav1000 commented Aug 9, 2020

Have you looked for this feature in other issues and in the docs? yes

Is your feature request related to a problem? Please describe.
Some of The AC vendors supported by IRremoteESP8266 library and tasmota do not support ON/OFF commands,
Instead they support toggle operations.
For example the WHIRLPOOL and AIRWELL protocols indicate power state and swing state change, not absolute state.

Tasmota always return mode=Off if Power=Off, preventing automation tracking mode state.

if (state.mode == stdAc::opmode_t::kOff || !state.power) {

Describe the solution you'd like
Delete this if state or add configuration for this behavior.

Describe alternatives you've considered
See #9004

Additional context
Some examples:
ON capture
{"IrReceived":{"Protocol":"WHIRLPOOL_AC","Bits":168,"Data":"0x0x830605A200008C0200000000002900010000080009","Repeat":0,"IRHVAC":{"Vendor":"WHIRLPOOL_AC","Model":2,"Power":"On","Mode":"Cool","Celsius":"On","Temp":26,"FanSpeed":"Max","SwingV":"Off","SwingH":"Off","Quiet":"Off","Turbo":"Off","Econo":"Off","Light":"On","Filter":"Off","Clean":"Off","Beep":"Off","Sleep":-1}}}
OFF capture
{"IrReceived":{"Protocol":"WHIRLPOOL_AC","Bits":168,"Data":"0x0x830605A200008C0100000000002A00010000080009","Repeat":0,"IRHVAC":{"Vendor":"WHIRLPOOL_AC","Model":2,"Power":"On","Mode":"Cool","Celsius":"On","Temp":26,"FanSpeed":"Max","SwingV":"Off","SwingH":"Off","Quiet":"Off","Turbo":"Off","Econo":"Off","Light":"On","Filter":"Off","Clean":"Off","Beep":"Off","Sleep":-1}}}
Temp change (you can see the mode is off mistakenly)
{"IrReceived":{"Protocol":"WHIRLPOOL_AC","Bits":168,"Data":"0x0x830601B200008C0400000000003B0002000008000A","Repeat":0,"IRHVAC":{"Vendor":"WHIRLPOOL_AC","Model":2,"Power":"Off","Mode":"Off","Celsius":"On","Temp":27,"FanSpeed":"Max","SwingV":"Off","SwingH":"Off","Quiet":"Off","Turbo":"Off","Econo":"Off","Light":"On","Filter":"Off","Clean":"Off","Beep":"Off","Sleep":-1}}} {"IrReceived":{"Protocol":"WHIRLPOOL_AC","Bits":168,"Data":"0x0x830601A200008C0400000000002B0002000008000A","Repeat":0,"IRHVAC":{"Vendor":"WHIRLPOOL_AC","Model":2,"Power":"Off","Mode":"Off","Celsius":"On","Temp":26,"FanSpeed":"Max","SwingV":"Off","SwingH":"Off","Quiet":"Off","Turbo":"Off","Econo":"Off","Light":"On","Filter":"Off","Clean":"Off","Beep":"Off","Sleep":-1}}}

(Please, remember to close the issue when the problem has been addressed)

@ascillato2 ascillato2 added the duplicated Result - Duplicated Issue label Aug 9, 2020
@s-hadinger
Copy link
Collaborator

The mode is Off because Power is Off which makes sense if you consider the Power value.

I understand that capturing a Temperature change should trigger Power to On, not to Off. Is it possible to change the temperature without turning on the device?

In such case you need to push the request to IRRemoteESP8266 lib.

@yoav1000
Copy link
Author

yoav1000 commented Aug 9, 2020

The main problem is that some of the AC vendors do not use absolute Power states and use the Power value as a toggle.
You can see from my example above that the OFF an ON capture are equal (the remote send the same code), When the user change temperature the remote doesn't know if the AC is On or OFF, in the case the AC is Off, its still receive the value but doesn't do anything.

Because of the current code behavior, you cant know if the AC changed Mode from Cool to Heat until the user switch Off the AC

I also think that Off and On should be replaced by Toggle and None, but that not really important.

See this Answer from the ir lib: crankyoldgit/IRremoteESP8266#1228 (comment)

@yoav1000
Copy link
Author

yoav1000 commented Aug 9, 2020

I think Tasmota need to go in one of two ways regarding AC:

  1. Reflect the true state of the AC - for some of the ac vendors require keeping internal state. Also See https://github.com/crankyoldgit/IRremoteESP8266/blob/857a9eed7e38333734f9f4bd8f070a4703886609/src/IRac.cpp#L1945
  2. Pass the true state of the remote - today we change the mode from the result preventing any automation from keeping track of changes

@ascillato2
Copy link
Collaborator

Closing this issue as it is duplicated. Sorry.

Remember to read the Contributing Guideline and Policy. Thanks.


Support Information

See Docs for more information.
See Chat for more user experience.
See Community for forum.
See Code of Conduct

@the-mentor
Copy link

@ascillato2 do you mind mentioning the issue that this is a duplicate of ?

thank you very much !
-DM

@ayavilevich
Copy link
Contributor

Hi @yoav1000

I had the same issue with an Airwell AC.
I believe the better way is for tasmota to implement IRremote properly and handle state. Currently they just pass "null" for "prev".
IRremote has an implementation for managing state for toggle properties. It has some issues but it is good enough. Whatever is missing will be fixed (crankyoldgit/IRremoteESP8266#1275).

You are welcome to try my fork. If it works maybe they will accept the change in the main repository.
https://github.com/ayavilevich/Tasmota

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicated Result - Duplicated Issue
Projects
None yet
Development

No branches or pull requests

5 participants