You are right if we use the ack current functionnality you will have to choose into HA config between ack topic and 433tomqtt topic.
If I sum up HA can have 2 kind of data from the gateway:
-feedback when sensing a command to the gateway that indicates that the gateway received it
-data coming from signals published to mqtt
And it should be the same topic to be able to update HA switches when pressing a button from a remote or the HA command.
You could use optimistic: true but you prefer that the gateway says that it received the message so as to update the switch.
Am I right?
One other track; is it not the goal of MQTT QOS level 1 to handle that ?
Yes you could use optimistic: true but basically you than ignoring the state topic i.e. you could even leave it out of the config.
MQTT QOS is quality of service on protocol level and you donât really want to use it as you can end up with resend of packages. The ACK we are talking about here is on service/application level.
But in principle we are only confirming that the gateway has received a command and successfully transmitted it via RF⌠this doesnât mean that the switch has received it and turned itself on or off⌠however it is just nice to have the interface updated either way
I am scared now to update as i had problems to upload the sketch⌠i used the webbrowser arduino to upload and it worked but as i am not that familiar with all of this i might want to let it as it is till someone would provide a step by step tutorial for this Thanks anyway for your efforts
Iâve grabbed the new code and had a look. The âhome/sensors/irâ MQTT feed now relays the transmitted IR code which is great. However when I used this feed as my state loop my switch seems to turn off for a second and then bounce back to on. I suspect this is due to both states (on/off) being triggered by the same payload value (the same IR code).
I might try using a if then else statement to publish back either a On or Off to designate the two states.
e.g.
if (signalSent == true && String(state) == âOffâ){
char state[] = âOnâ;
trc("State changed to " + String(state));
boolean result = client.publish(subjectGTWIRtoMQTT, state); //datacallback);
if (result)trc(F(âAcknowedgement of reception publishedâ));
} else if (signalSent == true && String(state) == âOnâ){
char state[] = âOffâ;
trc("State changed to " + String(state));
boolean result = client.publish(subjectGTWIRtoMQTT, state); //datacallback);
if (result)trc(F(âAcknowedgement of reception publishedâ));
}else{
trc(âState un-changedâ);
trc(state);
}
if (result)trc(F(âAcknowedgement of reception publishedâ));
}
Unfortunately my state variable stays as a constant and never changes (char state[] = âOffâ), I think its cause the PubSub library publish function wants a constant char value as the message.
Indeed as it is the same code for on and off iâm not sure this new acknowledgement function is usefull in this case, optimistic : true could be a bypass before finding another way.
I have a request on the openmqttgateway github.
Asking to be compatible with homie convention
Iâm investigating time on this but before going further i would like to know the degree of compatibility with home assistant.
My main concern is about the fact that several mqtt payload must be sent in case one needs to send a rf signal with some particular parameters.
Currently if you want to send a signal with a special protocol or pulselength you set it into the topic: home/MQTTto433/433_1/PLSL_360 123456
In one mqtt message we are able to send 123456 and other parameters.
With the homie convention we will have to publish 3 messages: homie/openmqttgateway/rf-send/plsl/set 360 homie/openmqttgateway/rf-send/protocol/set 1 homie/openmqttgateway/rf-send/set 123456
I would like to have your thoughts on that, can this example be implemented easily into home assistant ?
Hello @1technophile im getting below error when compiling in IDE
WARNING: Spurious .github folder in 'Adafruit NeoPixel' library
C:\Users\Ashfaq\Downloads\OpenMQTTGateway-master\OpenMQTTGateway-master\OpenMQTTGateway\OpenMQTTGateway.ino: In function 'void receivingMQTT(char*, char*)':
OpenMQTTGateway:349: error: 'class IRsend' has no member named 'sendCOOLIX'
irsend.sendCOOLIX(data, 24);
^
OpenMQTTGateway:362: error: 'class IRsend' has no member named 'sendLG'
irsend.sendLG(data, 28);
^
exit status 1
'class IRsend' has no member named 'sendCOOLIX'
Please check the arduino ide version that you are using and library versions, in particular irremote for esp8266, you should have the last ones available.
it worked thanks. Iâm using IR part what Iâm trying to do is if my roommate turns off AC from remote then HA to turn it back ON. I tried reading the OFF button on Ac remote the numbers which I get is not same⌠it will be different every read. Anyway, I can do this automation?
Did you check the info published into ir advanced topic?
You should have the protocol also into this topic, when it is equal to -1 donât take into account the value given.
Regarding your automation it should be possible but i let the ha expert answer your question.