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

IRMQTTServer: Add TX channel support for HTTP interface. #929

Merged
merged 4 commits into from
Sep 23, 2019

Conversation

crankyoldgit
Copy link
Owner

  • Allow "channel" (KEY_CHANNEL) argument to control which TX channel to send to.
  • Update "aircon" html page to be able to selection which climate channel to use.
  • Consolidate some duplicate code into genStatTopic()
  • Update comments/documentation on for full multi-channel TX support.
  • Fix some potential unreferenced pointer issues.

* Allow "channel" (KEY_CHANNEL) argument to control which TX channel to
send to.
* Update "aircon" html page to be able to selection which climate
channel to use.
* Consolidate some duplicate code into `genStatTopic()`
* Update comments/documentation on for full multi-channel TX support.
* Fix some potential unreferenced pointer issues.
@crankyoldgit
Copy link
Owner Author

FYI @sheppy99
As you use the multi channel part regularly, would you mind testing this?
You should be able to select the "channel" from the "aircon" HTML page when using more than one channel.

@sheppy99
Copy link

sheppy99 commented Sep 23, 2019

I just tried to compile it and it failed at 1131:18 which is

sendJsonState(states[i], stat_topic + KEY_JSON);

The changes I've made to IRMQTTServer.h are:

const uint8_t kNrOfIrTxGpios = 7;
#define MQTT_CLIMATE_JSON true
#define MQTT_CLIMATE_HA_MODE false
#define MQTT_DISCOVERY_ENABLE false
#define MQTT_CLEAR_ENABLE true

\o/ for @sheppy99 for finding this before it got merged.
@crankyoldgit
Copy link
Owner Author

@sheppy99 Thanks for finding that issue. Fix has been push to the branch. Please download and try it again! :)

@sheppy99
Copy link

sheppy99 commented Sep 23, 2019

It compiles now although it does show 2 minor errors, the first one is expected with debug disabled, is the second one relevant?

D:\My Documents\Arduino\IRMQTTServer\IRMQTTServer.ino:494:6: warning: unused parameter 'str' [-Wunused-parameter]

 void debug(const char *str) {

      ^

D:\My Documents\Arduino\IRMQTTServer\IRMQTTServer.ino: In function 'void handleAirConSet()':

D:\My Documents\Arduino\IRMQTTServer\IRMQTTServer.ino:1131:18: warning: comparison is always true due to limited range of data type [-Wtype-limits]

   if (channel >= 0 && channel < kNrOfIrTxGpios) chan = channel;
              ^

@crankyoldgit
Copy link
Owner Author

crankyoldgit commented Sep 23, 2019

Technically, they are compiler warnings, not errors. Just pushed another update to fix the latter warning.

Let me know how that goes. The code should function the same.

@sheppy99
Copy link

sheppy99 commented Sep 23, 2019

It compiles fine and its passed a quick ON and OFF test on ac_3, ac_4 and ac_5 from both the examples page and also from MQTT. Once I realised that I had to click the change button next to the channel before the channel change took effect.
This is a great addition for troubleshooting

@crankyoldgit
Copy link
Owner Author

Excellent. Also pushed a change to try to fix the "debug" compiler warning too. Doesn't come up on my system, even before the change, but let me know if it fixes it too.

@crankyoldgit
Copy link
Owner Author

Oh, and thanks for confirming it works as expected.

@sheppy99
Copy link

sheppy99 commented Sep 23, 2019

The compiler warning has gone, apart from something to do with an unused variable in PUBSUBClient which doesn't break anything and has been there for a long time. I just tested 2 AC's this time and they turn ON and OFF from both the webpage and via MQTT. I also confirmed the Daikin2 on Channel 0 turns ON and OFF via MQTT with the full hex string

@crankyoldgit
Copy link
Owner Author

unused variable in PUBSUBClient

Yep, that's an issue in their library. Nothing I can do about that one.

Thanks for the confirmation that it's working as expected.

@crankyoldgit crankyoldgit merged commit 46f2946 into master Sep 23, 2019
crankyoldgit added a commit that referenced this pull request Sep 23, 2019
_v2.6.6 (20190923)_

**[Bug Fixes]**
- Ensure `begin()` is called for every supported common a/c. (#905, #899)
- IRMQTTServer: Fix JSON state parsing. (#896)
- IRMQTTServer: Fix compilation error when `MQTT_CLIMATE_JSON` is `true`. (#893)

**[Features]**
- Mitsubishi136: Full A/C support. (#898, #890)
- Fujitsu: Add support for ARRY4 remote. (#895)
- Web-AC-control: Add new WebUI example sketch. (#880, #886)
- Improve Common A/C API (#913)
- IRMQTTServer: Support for multiple climates. (#903)
- IRMQTTServer: Add TX channel support for HTTP interface. (#929)
- IRMQTTServer: Add option to clear retained settings. (#917)
- auto_analyse_raw_data.py: Add decode code generation. (#909)
- auto_analyse_raw_data.py: General improvements (#906)

**[Misc]**
- IRMQTTServer: Use latest API for common A/C. (#928)
- IRMQTTServer: Add flag & documentation for Home Assistant mode. (#919)
- IRMQTTServer: Move from ArduinoJson v5 to v6. (#878)
- IRMQTTServer: Use retain for discovery message. (#881)
- Goodweather: Adjust timings & minor fixes. (#924)
- PanasonicAc: Add better SwingV support for common a/c framework. (#923)
- Daikin2: Corrections for common A/C interface. (#910)
- MitsubishiAC: Improve decoding. (#914)
- Fujitsu: Disable horiz swing for ARRY4. (#907)
- SamsungAc: Only send power on/off code if it's needed. (#884)
- Teco: Add timer support. (#883)
- More consistent A/C `::toString()` output. (#920)
@crankyoldgit crankyoldgit deleted the multi_html_support branch September 23, 2019 08:16
@crankyoldgit crankyoldgit mentioned this pull request Sep 23, 2019
crankyoldgit added a commit that referenced this pull request Sep 23, 2019
_v2.6.6 (20190923)_

**[Bug Fixes]**
- Ensure `begin()` is called for every supported common a/c. (#905, #899)
- IRMQTTServer: Fix JSON state parsing. (#896)
- IRMQTTServer: Fix compilation error when `MQTT_CLIMATE_JSON` is `true`. (#893)

**[Features]**
- Mitsubishi136: Full A/C support. (#898, #890)
- Fujitsu: Add support for ARRY4 remote. (#895)
- Web-AC-control: Add new WebUI example sketch. (#880, #886)
- Improve Common A/C API (#913)
- IRMQTTServer: Support for multiple climates. (#903)
- IRMQTTServer: Add TX channel support for HTTP interface. (#929)
- IRMQTTServer: Add option to clear retained settings. (#917)
- auto_analyse_raw_data.py: Add decode code generation. (#909)
- auto_analyse_raw_data.py: General improvements (#906)

**[Misc]**
- IRMQTTServer: Use latest API for common A/C. (#928)
- IRMQTTServer: Add flag & documentation for Home Assistant mode. (#919)
- IRMQTTServer: Move from ArduinoJson v5 to v6. (#878)
- IRMQTTServer: Use retain for discovery message. (#881)
- Goodweather: Adjust timings & minor fixes. (#924)
- PanasonicAc: Add better SwingV support for common a/c framework. (#923)
- Daikin2: Corrections for common A/C interface. (#910)
- MitsubishiAC: Improve decoding. (#914)
- Fujitsu: Disable horiz swing for ARRY4. (#907)
- SamsungAc: Only send power on/off code if it's needed. (#884)
- Teco: Add timer support. (#883)
- More consistent A/C `::toString()` output. (#920)
@crankyoldgit
Copy link
Owner Author

FYI, the changes mentioned above are included in the newly released version of the library (v2.6.6).

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

Successfully merging this pull request may close these issues.

2 participants