@@ -529,6 +529,72 @@ void IRac::argoWrem3_ACCommand(IRArgoAC_WREM3 *ac, const bool on,
529529 // No Beep setting available - always beeps in this mode :)
530530 ac->send ();
531531}
532+
533+ // / Send an Argo A/C WREM-3 iFeel (room temp) silent (no beep) report.
534+ // / @param[in, out] ac A Ptr to an IRArgoAC_WREM3 object to use.
535+ // / @param[in] sensorTemp The room (iFeel) temperature setting
536+ // / in degrees Celsius.
537+ void IRac::argoWrem3_iFeelReport (IRArgoAC_WREM3 *ac, const float sensorTemp) {
538+ ac->begin ();
539+ ac->setMessageType (argoIrMessageType_t::IFEEL_TEMP_REPORT);
540+ ac->setSensorTemp (sensorTemp);
541+ ac->send ();
542+ }
543+
544+ // / Send an Argo A/C WREM-3 Config command.
545+ // / @param[in, out] ac A Ptr to an IRArgoAC_WREM3 object to use.
546+ // / @param[in] param The parameter ID.
547+ // / @param[in] value The parameter value.
548+ // / @param[in] safe If true, will only allow setting the below parameters
549+ // / in order to avoid accidentally setting a restricted
550+ // / vendor-specific param and breaking the A/C device
551+ // / @note Known parameters (P<xx>, where xx is the @c param)
552+ // / P05 - Temperature Scale (0-Celsius, 1-Fahrenheit)
553+ // / P06 - Transmission channel (0..3)
554+ // / P12 - ECO mode power input limit (30..99, default: 75)
555+ void IRac::argoWrem3_ConfigSet (IRArgoAC_WREM3 *ac, const uint8_t param,
556+ const uint8_t value, bool safe /* = true*/ ) {
557+ if (safe) {
558+ switch (param) {
559+ case 5 : // temp. scale (note this is likely excess as not transmitted)
560+ if (value > 1 ) { return ; /* invalid */ }
561+ break ;
562+ case 6 : // channel (note this is likely excess as not transmitted)
563+ if (value > 3 ) { return ; /* invalid */ }
564+ break ;
565+ case 12 : // eco power limit
566+ if (value < 30 || value > 99 ) { return ; /* invalid */ }
567+ break ;
568+ default :
569+ return ; /* invalid */
570+ }
571+ }
572+ ac->begin ();
573+ ac->setMessageType (argoIrMessageType_t::CONFIG_PARAM_SET);
574+ ac->setConfigEntry (param, value);
575+ ac->send ();
576+ }
577+
578+ // / Send an Argo A/C WREM-3 Delay timer command.
579+ // / @param[in, out] ac A Ptr to an IRArgoAC_WREM3 object to use.
580+ // / @param[in] on Whether the unit is currently on. The timer, upon elapse
581+ // / will toggle this state
582+ // / @param[in] currentTime currentTime in minutes, starting from 00:00
583+ // / @note For timer mode, this value is not really used much so can be zero.
584+ // / @param[in] delayMinutes Number of minutes after which the @c on state should
585+ // / be toggled
586+ // / @note Schedule timers are not exposed via this interface
587+ void IRac::argoWrem3_SetTimer (IRArgoAC_WREM3 *ac, bool on,
588+ const uint16_t currentTime, const uint16_t delayMinutes) {
589+ ac->begin ();
590+ ac->setMessageType (argoIrMessageType_t::TIMER_COMMAND);
591+ ac->setPower (on);
592+ ac->setTimerType (argoTimerType_t::DELAY_TIMER);
593+ ac->setCurrentTimeMinutes (currentTime);
594+ // Note: Day of week is not set (no need)
595+ ac->setDelayTimerMinutes (delayMinutes);
596+ ac->send ();
597+ }
532598#endif // SEND_ARGO
533599
534600#if SEND_BOSCH144
@@ -2917,9 +2983,28 @@ bool IRac::sendAc(const stdAc::state_t desired, const stdAc::state_t *prev) {
29172983 {
29182984 if (send.model == argo_ac_remote_model_t ::SAC_WREM3) {
29192985 IRArgoAC_WREM3 ac (_pin, _inverted, _modulation);
2920- argoWrem3_ACCommand (&ac, send.power , send.mode , send.degrees ,
2921- send.fanspeed , send.swingv , send.quiet , send.econo , send.turbo ,
2922- send.filter , send.light );
2986+ switch (send.command ) {
2987+ case stdAc::ac_command_t ::kSensorTempReport :
2988+ argoWrem3_iFeelReport (&ac, send.degrees ); // Uses "degrees"
2989+ // as roomTemp
2990+ break ;
2991+ case stdAc::ac_command_t ::kConfigCommand :
2992+ // / @warning: this is ABUSING current **common** parameters:
2993+ // / @c clock and @c sleep as config key and value
2994+ // / Hence, value pre-validation is performed (safe-mode)
2995+ // / to avoid accidental device misconfiguration
2996+ argoWrem3_ConfigSet (&ac, send.clock , send.sleep , true );
2997+ break ;
2998+ case stdAc::ac_command_t ::kTimerCommand :
2999+ argoWrem3_SetTimer (&ac, send.power , send.clock , send.sleep );
3000+ break ;
3001+ case stdAc::ac_command_t ::kControlCommand :
3002+ default :
3003+ argoWrem3_ACCommand (&ac, send.power , send.mode , send.degrees ,
3004+ send.fanspeed , send.swingv , send.quiet , send.econo , send.turbo ,
3005+ send.filter , send.light );
3006+ break ;
3007+ }
29233008 OUTPUT_DECODE_RESULTS_FOR_UT (ac);
29243009 } else {
29253010 IRArgoAC ac (_pin, _inverted, _modulation);
@@ -3495,14 +3580,35 @@ bool IRac::cmpStates(const stdAc::state_t a, const stdAc::state_t b) {
34953580 a.fanspeed != b.fanspeed || a.swingv != b.swingv ||
34963581 a.swingh != b.swingh || a.quiet != b.quiet || a.turbo != b.turbo ||
34973582 a.econo != b.econo || a.light != b.light || a.filter != b.filter ||
3498- a.clean != b.clean || a.beep != b.beep || a.sleep != b.sleep ;
3583+ a.clean != b.clean || a.beep != b.beep || a.sleep != b.sleep ||
3584+ a.command != b.command ;
34993585}
35003586
35013587// / Check if the internal state has changed from what was previously sent.
35023588// / @note The comparison excludes the clock.
35033589// / @return True if it has changed, False if not.
35043590bool IRac::hasStateChanged (void ) { return cmpStates (next, _prev); }
35053591
3592+ // / Convert the supplied str into the appropriate enum.
3593+ // / @param[in] str A Ptr to a C-style string to be converted.
3594+ // / @param[in] def The enum to return if no conversion was possible.
3595+ // / @return The equivalent enum.
3596+ stdAc::ac_command_t IRac::strToCommandType (const char *str,
3597+ const stdAc::ac_command_t def) {
3598+ if (!STRCASECMP (str, kControlCommandStr ))
3599+ return stdAc::ac_command_t ::kControlCommand ;
3600+ else if (!STRCASECMP (str, kIFeelReportStr ) ||
3601+ !STRCASECMP (str, kIFeelStr ))
3602+ return stdAc::ac_command_t ::kSensorTempReport ;
3603+ else if (!STRCASECMP (str, kSetTimerCommandStr ) ||
3604+ !STRCASECMP (str, kTimerStr ))
3605+ return stdAc::ac_command_t ::kTimerCommand ;
3606+ else if (!STRCASECMP (str, kConfigCommandStr ))
3607+ return stdAc::ac_command_t ::kConfigCommand ;
3608+ else
3609+ return def;
3610+ }
3611+
35063612// / Convert the supplied str into the appropriate enum.
35073613// / @param[in] str A Ptr to a C-style string to be converted.
35083614// / @param[in] def The enum to return if no conversion was possible.
@@ -3780,6 +3886,19 @@ String IRac::boolToString(const bool value) {
37803886 return value ? kOnStr : kOffStr ;
37813887}
37823888
3889+ // / Convert the supplied operation mode into the appropriate String.
3890+ // / @param[in] cmdType The enum to be converted.
3891+ // / @return The equivalent String for the locale.
3892+ String IRac::commandTypeToString (const stdAc::ac_command_t cmdType) {
3893+ switch (cmdType) {
3894+ case stdAc::ac_command_t ::kControlCommand : return kControlCommandStr ;
3895+ case stdAc::ac_command_t ::kSensorTempReport : return kIFeelReportStr ;
3896+ case stdAc::ac_command_t ::kTimerCommand : return kSetTimerCommandStr ;
3897+ case stdAc::ac_command_t ::kConfigCommand : return kConfigCommandStr ;
3898+ default : return kUnknownStr ;
3899+ }
3900+ }
3901+
37833902// / Convert the supplied operation mode into the appropriate String.
37843903// / @param[in] mode The enum to be converted.
37853904// / @param[in] ha A flag to indicate we want GoogleHome/HomeAssistant output.
0 commit comments