Replies: 6 comments 3 replies
-
I am confused. Why are you asking this question here? Seems more a homebridge question. I'm guessing that you're using IRremoteESP8266/examples/IRMQTTServer/IRMQTTServer.h Lines 135 to 136 in 0f94857 Which should allow you send multiple settings in a single MQTT (JSON) message. or change this: IRremoteESP8266/examples/IRMQTTServer/IRMQTTServer.h Lines 138 to 152 in 0f94857 So that Power & Mode are not linked. i.e. you can leave Mode as Auto and just change Power between on & off .
|
Beta Was this translation helpful? Give feedback.
-
Hi David, Thanks for the guidance. I do use IRMQTTServer, but didn't pay attention to these settings. I will have a look and see if they help. I thought that since I use IRMQTTServer, my question belongs here. Do you plan to support Homekit natively at some point? Thanks, Laurent |
Beta Was this translation helpful? Give feedback.
-
Hi David,
Thanks a lot for your assistance. The second setting solved my problem, but with a twist. Indeed decoupling the power and mode allows me to turn on the AC because it remembers the last mode. The problem though is that I have first to use the webui to set the protocol and the mode, otherwise it doesn’t work.
I will try the first option, as it should allow me to always specify the protocol and the mode. I’ll let you know if it works.
Thanks,
Laurent
From: David Conran
Sent: Friday, 3 June 2022 17:13
To: crankyoldgit/IRremoteESP8266
Cc: Laurent Dellus; Author
Subject: Re: [crankyoldgit/IRremoteESP8266] How to configure MQTTthingHomebridge Plugin (Discussion #1816)
I am confused. Why are you asking this question here? Seems more a homebridge question.
I'm guessing that you're using IRMQTTServer, have you looked at:
https://github.com/crankyoldgit/IRremoteESP8266/blob/0f9485700f1847bdc536fe032000388fc7f2c950/examples/IRMQTTServer/IRMQTTServer.h#L135-L136
Which should allow you send multiple settings in a single MQTT (JSON) message.
or change this:
https://github.com/crankyoldgit/IRremoteESP8266/blob/0f9485700f1847bdc536fe032000388fc7f2c950/examples/IRMQTTServer/IRMQTTServer.h#L138-L152
So that Power & Mode are not linked. i.e. you can leave Mode as Auto and just change Power between on & off.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
You should only need to set the protocol once, as IRMQTTServer will store the settings (via RETAIN) on your MQTT Server. |
Beta Was this translation helpful? Give feedback.
-
David, how can I hard code the protocol and model in IRMQTTServer.h?
…On Sun, Jul 10, 2022 at 11:16 AM David Conran ***@***.***> wrote:
You should only need to set the protocol once, as IRMQTTServer will store
the settings (via RETAIN) on your MQTT Server.
Mode should similarly be saved as well.
—
Reply to this email directly, view it on GitHub
<#1816 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAL7DFUO5AHQCRQ5MNYM75LVTKBE3ANCNFSM5XLNF4FQ>
.
You are receiving this because you authored the thread.Message ID:
<crankyoldgit/IRremoteESP8266/repo-discussions/1816/comments/3114800@
github.com>
|
Beta Was this translation helpful? Give feedback.
-
Thanks David. I need to investigate further why after a power outage it
loses its settings. The easy fix is to hard code the protocol and model but
I totally agree that I shouldn't have to do that.
…On Mon, Jul 11, 2022 at 12:48 PM David Conran ***@***.***> wrote:
You shouldn't need to, but you would need to add/change code here:
https://github.com/crankyoldgit/IRremoteESP8266/blob/2bad02785274a54b5208228d80c159e0826f193a/examples/IRMQTTServer/IRMQTTServer.ino#L3078-L3080
e.g. The following should hard code it for you.
stdAc::state_t next = ac->getState(); // Changed
const stdAc::state_t prev = ac->getStatePrev(); // Unchanged
next.protocol = decode_type_t::NAMEOFAIRCON; // Added. You will need to change this.
next.model = 2; // Added. You will need to change this to what ever model number you need.
if (prev.protocol != next.protocol || forceMQTT) { // Unchanged
or change the default here:
https://github.com/crankyoldgit/IRremoteESP8266/blob/2bad02785274a54b5208228d80c159e0826f193a/src/IRsend.h#L98-L99
But seriously, you are probably doing something wrong. You should only
need to set it once, and MQTT will remember it for you.
I haven't tried the code changes above. But it should give you the jist of
what you need to do.
—
Reply to this email directly, view it on GitHub
<#1816 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAL7DFTF6RW5I35FTSC2VM3VTPUXDANCNFSM5XLNF4FQ>
.
You are receiving this because you authored the thread.Message ID:
<crankyoldgit/IRremoteESP8266/repo-discussions/1816/comments/3120002@
github.com>
|
Beta Was this translation helpful? Give feedback.
-
Hello,
I need help with the JSON code needed to configure the MQTTthing Homebridge plugin for my AMCOR AC.
The MQTTthing plugin is really convenient to control Homebridge devices and I can successfully send commands to my AC with the following topic code:
"topics": {
"setActive": "amcor/ac/cmnd/power",
"setTargetHeaterCoolerState": "amcor/ac/cmnd/mode",
"setCoolingThresholdTemperature": "amcor/ac/cmnd/temp",
"setHeatingThresholdTemperature": "amcor/ac/cmnd/temp",
"setRotationSpeed": {
"topic": "amcor/ac/cmnd/fanspeed",
"apply": "return [ 'min', 'low', 'med', 'high', 'max', 'auto' ][ Math.floor( message / 20 ) ];"
}
},
The problem is that I need to send 2 commands simultaniously to turn it on. I need to send Power = True and Mode = Auto. I can send power and then set it to auto, and it will turn on, but it's not conveninent.
I tried the following topic code but it doesn't work:
"topics": {
"setActive": {
"topic": "amcor/ac/cmnd",
"apply": "state.global.HVAC = state.global.HVAC || {}; state.global.HVAC.Power = message; state.global.HVAC.Mode = ‘auto’; return (JSON.stringify(state.global.HVAC));"
},
"getActive": "amcor/ac/stat/power",
"getCurrentHeaterCoolerState": "amcor/ac/stat/mode",
"setTargetHeaterCoolerState": {
"topic": "amcor/ac/cmnd",
"apply": "state.global.HVAC = state.global.HVAC || {}; state.global.HVAC.Mode = message; return (JSON.stringify(state.global.HVAC));"
},
"getTargetHeaterCoolerState": "amcor/ac/stat/mode",
"setCoolingThresholdTemperature": {
"topic": "amcor/ac/cmnd",
"apply": "state.global.HVAC = state.global.HVAC || {}; state.global.HVAC.Temp = message; return (JSON.stringify(state.global.HVAC));"
},
"getCoolingThresholdTemperature": "amcor/ac/stat/temp",
"setHeatingThresholdTemperature": {
"topic": "amcor/ac/cmnd",
"apply": "state.global.HVAC = state.global.HVAC || {}; state.global.HVAC.Temp = message; return (JSON.stringify(state.global.HVAC));"
},
"getHeatingThresholdTemperature": "amcor/ac/stat/temp",
"setRotationSpeed": {
"topic": "amcor/ac/cmnd",
"apply": "state.global.HVAC = state.global.HVAC || {}; state.global.HVAC.FanSpeed = 1; return (JSON.stringify(state.global.HVAC));"
}
},
Any help and guidance will be very much appreciated.
Thanks,
LDellus
Beta Was this translation helpful? Give feedback.
All reactions