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

Mild Dry Switch keeps getting off #89

Open
michas79de opened this issue Apr 13, 2023 · 5 comments
Open

Mild Dry Switch keeps getting off #89

michas79de opened this issue Apr 13, 2023 · 5 comments
Labels
CZ-TACG1 Issues with the CZ-TACG1 wifi adapter enhancement New feature or request question Further information is requested

Comments

@michas79de
Copy link

Hello!
great job @DomiStyle so far! I really appreciate being freed from the cloud! 👍

While my remote control has a MILD DRY button, the same button in the Home Assistant cannot be switched on permanently, but is immediately switched off again every time I try.

When using the remote control, the log shows that the 14th RX byte switches 2D (off) <-> 2B (on), I think:

[22:32:31][V][panasonic_ac.cz_tacg1:248]: Polling AC
[22:32:31][V][panasonic_ac:245]: TX: 70.0A.00.00.00.00.00.00.00.00.00.00.86 (13)
[22:32:31][V][panasonic_ac:247]: RX: 70.20.34.2B.80.A0.5A.00.00.00.00.00.30.2B.00.00.20.97.80.80.FF.12.06.FF.80.80.FF.80.18.00.01.00.00.00.D7 (35)
[22:32:31][D][climate:392]: 'Panasonic AC' - Sending state:
[22:32:31][D][climate:395]: Mode: COOL
[22:32:31][D][climate:403]: Custom Fan Mode: Automatic
[22:32:31][D][climate:409]: Custom Preset: Normal
[22:32:31][D][climate:412]: Swing Mode: OFF
[22:32:31][D][climate:415]: Current Temperature: 18.00°C
[22:32:31][D][climate:421]: Target Temperature: 21.50°C
[22:32:31][V][component:204]: Component panasonic_ac.climate took a long time for an operation (0.05 s).
[22:32:31][V][component:205]: Components should block for at most 20-30ms.
[22:32:36][V][panasonic_ac.cz_tacg1:248]: Polling AC
[22:32:36][V][panasonic_ac:245]: TX: 70.0A.00.00.00.00.00.00.00.00.00.00.86 (13)
[22:32:36][V][panasonic_ac:247]: RX: 70.20.34.2B.80.A0.5A.00.00.00.00.00.30.2D.00.00.20.97.80.80.FF.12.06.FF.80.80.FF.80.18.00.01.00.00.00.D5 (35)
[22:32:36][D][climate:392]: 'Panasonic AC' - Sending state:
[22:32:36][D][climate:395]: Mode: COOL
[22:32:36][D][climate:403]: Custom Fan Mode: Automatic
[22:32:36][D][climate:409]: Custom Preset: Normal
[22:32:36][D][climate:412]: Swing Mode: OFF
[22:32:36][D][climate:415]: Current Temperature: 18.00°C
[22:32:36][D][climate:421]: Target Temperature: 21.50°C
[22:32:36][V][component:204]: Component panasonic_ac.climate took a long time for an operation (0.05 s).
[22:32:36][V][component:205]: Components should block for at most 20-30ms.
[22:32:41][V][panasonic_ac.cz_tacg1:248]: Polling AC
[22:32:41][V][panasonic_ac:245]: TX: 70.0A.00.00.00.00.00.00.00.00.00.00.86 (13)
[22:32:41][V][panasonic_ac:247]: RX: 70.20.34.2B.80.A0.5A.00.00.00.00.00.30.2B.00.00.20.97.80.80.FF.12.06.FF.80.80.FF.80.18.00.01.00.00.00.D7 (35)
[22:32:41][D][climate:392]: 'Panasonic AC' - Sending state:
[22:32:41][D][climate:395]: Mode: COOL
[22:32:41][D][climate:403]: Custom Fan Mode: Automatic
[22:32:41][D][climate:409]: Custom Preset: Normal
[22:32:41][D][climate:412]: Swing Mode: OFF
[22:32:41][D][climate:415]: Current Temperature: 18.00°C
[22:32:41][D][climate:421]: Target Temperature: 21.50°C
[22:32:41][V][component:204]: Component panasonic_ac.climate took a long time for an operation (0.05 s).
[22:32:41][V][component:205]: Components should block for at most 20-30ms.
[22:32:46][V][panasonic_ac.cz_tacg1:248]: Polling AC
[22:32:46][V][panasonic_ac:245]: TX: 70.0A.00.00.00.00.00.00.00.00.00.00.86 (13)
[22:32:46][V][panasonic_ac:247]: RX: 70.20.34.2B.80.A0.5A.00.00.00.00.00.30.2D.00.00.20.97.80.80.FF.12.06.FF.80.80.FF.80.18.00.01.00.00.00.D5 (35)
[22:32:46][D][climate:392]: 'Panasonic AC' - Sending state:
[22:32:46][D][climate:395]: Mode: COOL
[22:32:46][D][climate:403]: Custom Fan Mode: Automatic
[22:32:46][D][climate:409]: Custom Preset: Normal
[22:32:46][D][climate:412]: Swing Mode: OFF
[22:32:46][D][climate:415]: Current Temperature: 18.00°C
[22:32:46][D][climate:421]: Target Temperature: 21.50°C
[22:32:51][V][panasonic_ac.cz_tacg1:248]: Polling AC
[22:32:51][V][panasonic_ac:245]: TX: 70.0A.00.00.00.00.00.00.00.00.00.00.86 (13)
[22:32:51][V][panasonic_ac:247]: RX: 70.20.34.2B.80.A0.5A.00.00.00.00.00.30.2B.00.00.20.97.80.80.FF.12.06.FF.80.80.FF.80.18.00.01.00.00.00.D7 (35)
[22:32:51][D][climate:392]: 'Panasonic AC' - Sending state:
[22:32:51][D][climate:395]: Mode: COOL
[22:32:51][D][climate:403]: Custom Fan Mode: Automatic
[22:32:51][D][climate:409]: Custom Preset: Normal
[22:32:51][D][climate:412]: Swing Mode: OFF
[22:32:51][D][climate:415]: Current Temperature: 18.00°C
[22:32:51][D][climate:421]: Target Temperature: 21.50°C
[22:32:51][V][component:204]: Component panasonic_ac.climate took a long time for an operation (0.05 s).
[22:32:51][V][component:205]: Components should block for at most 20-30ms.
[22:32:56][V][panasonic_ac.cz_tacg1:248]: Polling AC
[22:32:56][V][panasonic_ac:245]: TX: 70.0A.00.00.00.00.00.00.00.00.00.00.86 (13)
[22:32:56][V][panasonic_ac:247]: RX: 70.20.34.2B.80.A0.5A.00.00.00.00.00.30.2D.00.00.20.97.80.80.FF.12.06.FF.80.80.FF.80.18.00.01.00.00.00.D5 (35)
[22:32:56][D][climate:392]: 'Panasonic AC' - Sending state:
[22:32:56][D][climate:395]: Mode: COOL
[22:32:56][D][climate:403]: Custom Fan Mode: Automatic
[22:32:56][D][climate:409]: Custom Preset: Normal
[22:32:56][D][climate:412]: Swing Mode: OFF
[22:32:56][D][climate:415]: Current Temperature: 18.00°C
[22:32:56][D][climate:421]: Target Temperature: 21.50°C
[22:32:56][V][component:204]: Component panasonic_ac.climate took a long time for an operation (0.05 s).
[22:32:56][V][component:205]: Components should block for at most 20-30ms.

@DomiStyle
Copy link
Owner

That's strange, byte 14 is actually used for eco mode on my unit and byte 5 is used for mild dry. Not sure how to combine those 2 different behaviors.

You can check out the current protocol documentation here: https://github.com/DomiStyle/esphome-panasonic-ac/tree/master/protocol/cztacg1

@DomiStyle DomiStyle added enhancement New feature or request question Further information is requested CZ-TACG1 Issues with the CZ-TACG1 wifi adapter labels Apr 25, 2023
@michas79de
Copy link
Author

Here it seems to be free and shows 2D, which seems to be 'Mild Dry off' for me:
grafik
I would suggest switching both bytes, but I don't know what byte 5 will trigger at my A/C and 14 at other A/Cs.
(Switching on the Mild Dry Button in Home Assistant won't do anything for me, it seems. The switch switches immediately back to off and the log always show "80".)
I don't have any further suggestion or proposal at the moment.

@michas79de
Copy link
Author

@DomiStyle I want to try this other byte for Mild Dry myself. So I made a fork (https://github.com/michas79de/esphome-panasonic-ac).
I am not a programmer. So I am not sure what I am doing. But I hope I'm doing it right.

I think I found the values in esppac_cnt.cpp and changed them.
But I can't find where to change the byte. Can you please guide me?

@DomiStyle
Copy link
Owner

You can manipulate any value in the packet being sent by accessing this->cmd[X] where X is the index you want to access excluding the header and packet length. Any data that was received is inside of this->data instead.

For example, mild dry (ID 4 in the table above) would be this->cmd[2]. If you want to change field 13 you can access it with this->cmd[11].

As for reading, the values get passed to their own determine_xyz(uint8_t value) functions that evaluates the values.

For example:

bool PanasonicACCNT::determine_alternative_mild_dry(uint8_t value) {
  if (value == 0x2B)
    return true;
  else if (value == 0x2D)
    return false;
  else {
    ESP_LOGW(TAG, "Received unknown alternative mild dry value");
    return false;
  }
}

You will then want to call that function in set_data:

bool alternativeMildDry = determine_alternative_mild_dry(this->data[11]);

@michas79de
Copy link
Author

michas79de commented Jul 19, 2023

Thank you!
I duplicated each snippet with "mild dry" to "alternative mild dry" and changed the bytes.
However, I noticed that the byte that changes between two values every time I use the remote control seems to be overlaid with additional data. This is because it alternates between 2B and 2D, 32 and 30, 30 and 2E and maybe more.
Could be some work...

Anyway: When I try to use 0x32 and 0x30, I get a warning that the value is 86 instead of 30:

[18:29:39][V][panasonic_ac.cz_tacg1:254]: Polling AC
[18:29:39][V][panasonic_ac:259]: TX: 70.0A.00.00.00.00.00.00.00.00.00.00.86 (13)
[18:29:39][V][panasonic_ac:261]: RX: 70.20.34.30.80.A0.16.00.00.00.00.00.30.30.00.00.20.97.80.80.FF.17.1E.FF.80.80.FF.80.38.00.02.00.00.00.D3 (35)
[18:29:39][W][panasonic_ac.cz_tacg1:488]: Received unknown alternative mild dry value: 86

while using this code:
bool alternativeMildDry = determine_alternative_mild_dry(this->data[11]);
and
bool PanasonicACCNT::determine_alternative_mild_dry(uint8_t value) {
if (value == 0x30)
return true;
else if (value == 0x32)
return false;
else {
ESP_LOGW(TAG, "Received unknown alternative mild dry value: %d", value);

You might want to check my changes at master...michas79de:esphome-panasonic-ac:master.
So that I use a correct code, when I continue with it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CZ-TACG1 Issues with the CZ-TACG1 wifi adapter enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants