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

[MitsubishiAC] support weekly timer #1403

Closed
nao-pon opened this issue Feb 4, 2021 · 7 comments · Fixed by #1404
Closed

[MitsubishiAC] support weekly timer #1403

nao-pon opened this issue Feb 4, 2021 · 7 comments · Fixed by #1404
Assignees

Comments

@nao-pon
Copy link

nao-pon commented Feb 4, 2021

Version/revision of the library used

Current master
ab466e4

Describe the bug

This is not a bug.

Brand: Mitsubishi Electric, Model: MLZ-RX5017AS A/C (MITSUBISHI_AC)
Brand: Mitsubishi Electric, Model: SG153/M21EDF426 remote (MITSUBISHI_AC)

The above device is equipped with a weekly timer, and it seems that the on / off of the timer stored in the main unit is transmitted by a remote code.

It is included in all commands, so any control in this library will always turn off the weekly timer.

Example code used

IRrecvDumpV3

Expected behaviour

I would like to control the weekly timer with this library if possible. Or I want to be able to set irregular commands as the default.

Output of raw data from [IRrecvDumpV3.ino]

  • Weekly timer ON
Timestamp : 000047.298
Library   : v2.7.14

Protocol  : MITSUBISHI_AC
Code      : 0x23CB26010020080400C05E0000080300006A (144 Bits)
Mesg Desc.: Power: On, Mode: 1 (Heat), Temp: 20C, Fan: 0 (Auto), Swing(V): 0 (Auto), Swing(H): 0 (UNKNOWN), Clock: 15:40, On Timer: 00:00, Off Timer: 00:00, Timer: -
uint16_t rawData[583] = {3372, 1658,  434, 1238,  438, 1240,  434, 426,  410, 426,  412, 406,  432, 1238,  436, 426,  412, 424,  412, 1264,  412, 1240,  436, 426,  412, 1238,  438, 426,  412, 406,  432, 1240,  436, 1240,  436, 426,  412, 1240,  436, 1240,  436, 424,  412, 406,  432, 1240,  436, 426,  412, 406,  432, 1240,  436, 404,  432, 404,  432, 426,  412, 426,  412, 406,  432, 406,  430, 426,  412, 426,  412, 406,  432, 406,  458, 372,  438, 426,  412, 406,  432, 426,  412, 426,  412, 424,  412, 426,  412, 404,  432, 426,  412, 426,  412, 1238,  436, 404,  434, 426,  412, 426,  412, 404,  434, 424,  412, 1264,  412, 426,  412, 426,  412, 426,  412, 426,  412, 406,  432, 406,  432, 1240,  436, 404,  432, 406,  432, 406,  432, 406,  432, 404,  432, 406,  432, 426,  412, 424,  412, 406,  432, 404,  432, 404,  432, 404,  432, 426,  412, 404,  432, 426,  412, 426,  410, 406,  432, 404,  432, 406,  432, 1238,  438, 1240,  436, 404,  432, 1240,  436, 1240,  436, 1240,  436, 1238,  436, 426,  412, 1238,  436, 426,  412, 404,  432, 426,  412, 404,  434, 426,  412, 426,  412, 426,  412, 426,  412, 404,  432, 404,  432, 404,  432, 426,  412, 406,  432, 404,  432, 426,  412, 426,  412, 426,  412, 406,  432, 404,  432, 406,  432, 1242,  434, 404,  432, 404,  432, 426,  412, 404,  432, 1240,  436, 1240,  436, 426,  412, 426,  412, 406,  432, 426,  412, 426,  412, 404,  432, 426,  412, 404,  434, 426,  412, 404,  432, 426,  412, 426,  412, 404,  432, 426,  412, 404,  432, 426,  412, 406,  432, 426,  412, 406,  432, 406,  432, 426,  412, 404,  432, 404,  432, 1240,  434, 426,  410, 1240,  436, 404,  434, 1238,  462, 1214,  436, 404,  432, 11304,  3370, 1658,  436, 1240,  436, 1240,  436, 404,  432, 426,  412, 426,  412, 1238,  436, 404,  434, 404,  432, 1240,  436, 1240,  436, 406,  432, 1240,  436, 404,  432, 426,  410, 1240,  436, 1240,  436, 406,  432, 1240,  436, 1240,  434, 404,  432, 426,  412, 1240,  434, 406,  432, 404,  432, 1238,  438, 424,  412, 404,  432, 426,  412, 426,  412, 404,  432, 404,  432, 426,  410, 404,  434, 404,  432, 426,  412, 406,  432, 426,  412, 404,  432, 406,  432, 404,  432, 426,  412, 426,  412, 404,  432, 404,  432, 404,  434, 1240,  436, 404,  432, 404,  432, 404,  434, 404,  432, 404,  432, 1240,  436, 426,  412, 406,  432, 404,  432, 404,  432, 426,  412, 426,  412, 1240,  436, 404,  432, 404,  432, 404,  434, 424,  412, 404,  432, 426,  412, 426,  412, 404,  432, 404,  432, 404,  434, 404,  432, 404,  434, 404,  432, 404,  432, 404,  432, 404,  434, 404,  432, 426,  412, 404,  432, 1240,  436, 1240,  436, 426,  412, 1242,  434, 1240,  436, 1240,  436, 1240,  434, 426,  412, 1240,  436, 404,  432, 404,  434, 404,  432, 426,  412, 404,  434, 426,  410, 426,  412, 426,  412, 404,  432, 426,  412, 426,  412, 404,  434, 404,  432, 404,  434, 424,  412, 426,  412, 404,  434, 404,  432, 404,  434, 404,  432, 1240,  436, 404,  432, 426,  412, 406,  432, 404,  434, 1240,  434, 1240,  436, 406,  432, 426,  410, 426,  410, 426,  412, 426,  412, 406,  432, 426,  412, 404,  432, 404,  432, 404,  434, 426,  412, 404,  432, 404,  432, 404,  432, 404,  432, 426,  410, 426,  410, 404,  434, 404,  432, 426,  412, 426,  410, 406,  432, 404,  434, 1238,  436, 426,  412, 1242,  434, 426,  412, 1240,  436, 1240,  436, 404,  434};  // MITSUBISHI_AC
uint8_t state[18] = {0x23, 0xCB, 0x26, 0x01, 0x00, 0x20, 0x08, 0x04, 0x00, 0xC0, 0x5E, 0x00, 0x00, 0x08, 0x03, 0x00, 0x00, 0x6A};
  • Weekly timer OFF
Timestamp : 000053.082
Library   : v2.7.14

Protocol  : MITSUBISHI_AC
Code      : 0x23CB26010020080400C05E00000003000062 (144 Bits)
Mesg Desc.: Power: On, Mode: 1 (Heat), Temp: 20C, Fan: 0 (Auto), Swing(V): 0 (Auto), Swing(H): 0 (UNKNOWN), Clock: 15:40, On Timer: 00:00, Off Timer: 00:00, Timer: -
uint16_t rawData[583] = {3370, 1656,  436, 1242,  434, 1240,  436, 404,  434, 426,  412, 404,  432, 1240,  436, 424,  412, 426,  412, 1240,  434, 1238,  436, 426,  412, 1240,  436, 426,  412, 426,  410, 1240,  436, 1240,  436, 404,  434, 1238,  436, 1240,  436, 424,  412, 426,  412, 1238,  436, 426,  410, 404,  432, 1240,  436, 426,  412, 404,  432, 426,  412, 404,  432, 404,  432, 426,  412, 426,  412, 426,  412, 426,  412, 426,  412, 404,  432, 406,  432, 404,  432, 404,  432, 426,  412, 404,  432, 404,  432, 404,  432, 426,  412, 404,  434, 1238,  436, 404,  432, 426,  412, 426,  412, 426,  412, 424,  412, 1240,  434, 426,  412, 404,  432, 426,  410, 406,  432, 404,  432, 426,  412, 1240,  434, 426,  410, 426,  412, 426,  412, 404,  432, 426,  410, 426,  412, 406,  432, 426,  412, 404,  432, 426,  412, 426,  412, 426,  412, 426,  410, 426,  412, 426,  412, 426,  412, 426,  410, 426,  410, 426,  412, 1240,  436, 1240,  434, 426,  412, 1240,  434, 1240,  436, 1242,  434, 1238,  464, 372,  464, 1212,  436, 426,  412, 426,  412, 426,  412, 426,  414, 424,  410, 426,  412, 426,  412, 406,  432, 426,  412, 426,  412, 404,  432, 426,  412, 426,  412, 426,  412, 426,  412, 426,  412, 424,  412, 404,  434, 404,  432, 404,  432, 426,  412, 426,  412, 426,  412, 426,  412, 404,  434, 1240,  434, 1238,  438, 404,  432, 426,  412, 404,  432, 404,  432, 426,  412, 404,  432, 426,  410, 406,  432, 426,  412, 404,  432, 426,  410, 404,  434, 404,  434, 426,  412, 426,  412, 426,  412, 404,  432, 406,  432, 404,  434, 404,  432, 404,  432, 404,  432, 426,  412, 1240,  436, 404,  432, 426,  412, 426,  412, 1240,  436, 1240,  436, 426,  412, 11310,  3372, 1656,  436, 1238,  436, 1240,  436, 426,  412, 426,  412, 404,  434, 1264,  412, 426,  412, 404,  432, 1240,  434, 1238,  436, 404,  432, 1264,  412, 404,  432, 406,  432, 1240,  436, 1238,  438, 404,  432, 1240,  436, 1238,  436, 404,  432, 404,  432, 1240,  436, 404,  432, 426,  412, 1240,  460, 374,  436, 426,  412, 424,  412, 404,  432, 426,  412, 404,  432, 404,  432, 404,  434, 404,  432, 404,  434, 404,  434, 404,  432, 404,  432, 406,  432, 404,  434, 404,  432, 404,  432, 404,  434, 404,  432, 426,  412, 1240,  436, 404,  432, 404,  434, 424,  412, 426,  412, 406,  432, 1238,  436, 426,  410, 426,  412, 404,  434, 404,  432, 404,  434, 404,  432, 1240,  436, 426,  412, 404,  432, 406,  432, 426,  412, 404,  432, 406,  432, 426,  410, 406,  432, 426,  412, 404,  432, 404,  434, 404,  432, 404,  434, 404,  432, 404,  432, 406,  432, 406,  432, 424,  412, 404,  434, 1238,  438, 1264,  410, 406,  432, 1240,  436, 1240,  436, 1240,  436, 1240,  434, 404,  432, 1240,  436, 426,  410, 426,  412, 404,  432, 404,  432, 426,  412, 404,  434, 404,  432, 426,  412, 404,  432, 404,  432, 404,  432, 404,  432, 404,  432, 406,  432, 404,  432, 404,  432, 406,  432, 406,  432, 406,  432, 404,  432, 426,  412, 404,  432, 426,  412, 426,  412, 404,  432, 1240,  436, 1240,  436, 404,  432, 404,  432, 426,  412, 424,  412, 404,  432, 426,  410, 404,  434, 404,  434, 404,  432, 404,  434, 404,  434, 404,  434, 404,  434, 404,  432, 404,  432, 406,  432, 426,  412, 404,  434, 404,  434, 426,  412, 404,  432, 404,  460, 374,  438, 1238,  438, 404,  434, 404,  432, 404,  432, 1240,  436, 1240,  434, 404,  434};  // MITSUBISHI_AC
uint8_t state[18] = {0x23, 0xCB, 0x26, 0x01, 0x00, 0x20, 0x08, 0x04, 0x00, 0xC0, 0x5E, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x62};

What brand/model IR demodulator are you using?

HX1838: However, there seems to be no problem with the decoded data.

I have followed the steps in the Troubleshooting Guide & read the FAQ

Yes

Has this library/code previously worked as expected for you?

No

@crankyoldgit
Copy link
Owner

0x23CB26010020080400C05E0000080300006A (on)
0x23CB26010020080400C05E00000003000062 (off)

Looks like it's a single bit that needs to be flipped. So, this should be an easy addition to the IRMitsubishiAC class.
Note however, it could/will be controllable via IRMitsubishiAC but it can't be controlled by the user via the IRac class interface.

Which interface are you planning to use?

@nao-pon
Copy link
Author

nao-pon commented Feb 4, 2021

@crankyoldgit I'm currently controlling with Tasmota <-> https://github.com/hristo-atanasov/Tasmota-IRHVAC <->HomeAssistant.

@crankyoldgit
Copy link
Owner

I can add the support, but it won't be available via Tasmota, as I'm fairly confident it uses the IRac.
I can show you how to do a custom modification to the library to have that bit always set, but that will not be part of the standard library. i.e. You'll need to always roll/build/make your own tasmota binary.

BUT FYI, you are probably MUCH better off doing timer control via MQTT/tasmota/Home Assistant/etc than via the Mitsubishi A/C internal system. The former has far more functionality, scope, and ability, verses the latter which is quite limited.

@nao-pon
Copy link
Author

nao-pon commented Feb 4, 2021

Yes, there is no problem with custom building and using Tasmota. I would like to keep the internal timer alive in case the Home Assistant stops.

I am very grateful for your kindness.

crankyoldgit added a commit that referenced this issue Feb 4, 2021
* Add `[s|g]etWeeklyTimerEnabled()`.
* Unit test coverage based on real data.
* Add comment on how to Weekly Timer enabling by default via `IRac` class.

Fixes #1403
@crankyoldgit
Copy link
Owner

Please download/test PR #1404 / Branch: https://github.com/crankyoldgit/IRremoteESP8266/tree/Issue1403

It should add support for what you want.

For enabling it (by default) via IRac & thus Tasmota, I suggest you look here:

IRremoteESP8266/src/IRac.cpp

Lines 1337 to 1338 in 05f48dc

// Uncomment next line if you *really* need the weekly timer enabled via IRac.
// ac->setWeeklyTimerEnabled(true); // Weekly Timer is disabled by default.

@nao-pon
Copy link
Author

nao-pon commented Feb 4, 2021

@crankyoldgit Very quick Work! Thank you so much!

Yes, I now have control with the weekly timer enabled as I wish. 👍

crankyoldgit added a commit that referenced this issue Feb 4, 2021
* Add `[s|g]etWeeklyTimerEnabled()`.
* Unit test coverage based on real data.
* Add comment on how to Weekly Timer enabling by default via `IRac` class.

Fixes #1403
@crankyoldgit crankyoldgit changed the title [Mitsubishi] support weekly timer [MitsubishiAC] support weekly timer Feb 4, 2021
crankyoldgit added a commit that referenced this issue Feb 4, 2021
* Add `[s|g]etWeeklyTimerEnabled()`.
* Unit test coverage based on real data.
* Add comment on how to add Weekly Timer enabling by default via `IRac` class.

Fixes #1403
crankyoldgit added a commit that referenced this issue Feb 12, 2021
_v2.7.15 (20210213)_

**[BREAKING CHANGES]**
- Some Daikin2 constants have been changed. (#1393)

**[Features]**
- Experimental basic support for EcoClim 56 & 15 bit protocols. (#1397 #1410)
- MITSUBISHI_AC: Add support for enabling Weekly Timer. (#1403 #1404)
- Mitsubishi ACs: Improve handling swing/vane settings. (#1399 #1401)
- MITSUBISHI_AC: Add support for half degrees. (#1398 #1400)
- Add `irutils::addSwing[V|H]ToString()` and adjust some constants (#1365 #1393)
- SharpAc: Add support for model A903, and improve `IRac` fan & power control. (#1387 #1390)
- Experimental support for Milestag2 (#1360 #1380)

**[Misc]**
- Improve `IRac::sendAc()` documentation. (#1408 #1409)
- refactor ir_Transcold (#1407)
- refactor ir_Toshiba (#1395)
- Fix Travis-CI build issues. (#1396)
- refactor ir_Teco (#1392)
- Fujitsu A/C: Add warning/suggestions for AR-RAH1U devices (#1376 #1386)
- refactor ir_Technibel (#1385)
- Add the new logo and banner 🎉 (#1371 #1372)
- Update references to sbprojects website. (#1381 #1383)
- refactor ir_Tcl (#1379)
crankyoldgit added a commit that referenced this issue Feb 13, 2021
_v2.7.15 (20210213)_

**[BREAKING CHANGES]**
- Some Daikin2 constants have been changed. (#1393)

**[Features]**
- Experimental basic support for EcoClim 56 & 15 bit protocols. (#1397 #1410)
- MITSUBISHI_AC: Add support for enabling Weekly Timer. (#1403 #1404)
- Mitsubishi ACs: Improve handling swing/vane settings. (#1399 #1401)
- MITSUBISHI_AC: Add support for half degrees. (#1398 #1400)
- Add `irutils::addSwing[V|H]ToString()` and adjust some constants (#1365 #1393)
- SharpAc: Add support for model A903, and improve `IRac` fan & power control. (#1387 #1390)
- Experimental support for Milestag2 (#1360 #1380)

**[Misc]**
- Improve `IRac::sendAc()` documentation. (#1408 #1409)
- refactor ir_Transcold (#1407)
- refactor ir_Toshiba (#1395)
- Fix Travis-CI build issues. (#1396)
- refactor ir_Teco (#1392)
- Fujitsu A/C: Add warning/suggestions for AR-RAH1U devices (#1376 #1386)
- refactor ir_Technibel (#1385)
- Add the new logo and banner 🎉 (#1371 #1372)
- Update references to sbprojects website. (#1381 #1383)
- refactor ir_Tcl (#1379)
crankyoldgit added a commit that referenced this issue Feb 13, 2021
##_v2.7.15 (20210213)_

**[BREAKING CHANGES]**
- Some Daikin2 constants have been changed. (#1393)

**[Features]**
- Experimental basic support for EcoClim 56 & 15 bit protocols. (#1397 #1410)
- MITSUBISHI_AC: Add support for enabling Weekly Timer. (#1403 #1404)
- Mitsubishi ACs: Improve handling swing/vane settings. (#1399 #1401)
- MITSUBISHI_AC: Add support for half degrees. (#1398 #1400)
- Add `irutils::addSwing[V|H]ToString()` and adjust some constants (#1365 #1393)
- SharpAc: Add support for model A903, and improve `IRac` fan & power control. (#1387 #1390)
- Experimental support for Milestag2 (#1360 #1380)

**[Misc]**
- Improve `IRac::sendAc()` documentation. (#1408 #1409)
- refactor ir_Transcold (#1407)
- refactor ir_Toshiba (#1395)
- Fix Travis-CI build issues. (#1396)
- refactor ir_Teco (#1392)
- Fujitsu A/C: Add warning/suggestions for AR-RAH1U devices (#1376 #1386)
- refactor ir_Technibel (#1385)
- Add the new logo and banner 🎉 (#1371 #1372)
- Update references to sbprojects website. (#1381 #1383)
- refactor ir_Tcl (#1379)
@crankyoldgit
Copy link
Owner

FYI, the changes mentioned above have now been included in the new v2.7.15 release of the library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants