I have a 433MHz “dumb” doorbell that I want to add to my HA using OpenMQTTGateway.
The problem I have is that it sends 2 different codes.
On first press it sends the following:
home/433toMQTT/protocol 2
home/433toMQTT/bits 32
home/433toMQTT/length 699
home/433toMQTT 1769526675
On the second press it sends:
home/433toMQTT/protocol 2
home/433toMQTT/bits 32
home/433toMQTT/length 701
home/433toMQTT 3532948947
Then it sends the first again, then the second and so on each press.
How can I add this as a single entity to HA?
Hey, are you talking about the push and release, or two consecutive pushes?
and it is always 699 and 701?
Two consecutive pushes.
First push: 1769526675
Second push: 3532948947
Third: 1769526675
Forth: 3532948947
And so on…
The length are different every time, between 680-700ish.
I don’t have a door bell set up through OpenMQTTGateway yet, but it seems as though you have it configured as a toggle rather than a push button.
It’s not configured in any way in HA, that is just what I get from OpenMQTTGateway.
Also I cannot hardware configure it to send something else.
What happens if you wait more than 3 seconds before the second press?
In user_config.h there is a variable that creates delay of 3 seconds.
//variables to avoid duplicates
#define time_avoid_duplicate 3000 // if you want to avoid duplicate mqtt message received set this to > 0, the value is the time in milliseconds during which we don't publish duplicates
From the .ino
boolean isAduplicate(long value){
trc(F("isAduplicate"));
// check if the value has been already sent during the last time_avoid_duplicate
for (int i = 0; i < array_size;i++){
if (ReceivedSignal[i][0] == value){
unsigned long now = millis();
if (now - ReceivedSignal[i][1] < time_avoid_duplicate){ // change
trc(F("--don't pub. duplicate--"));
return true;
}
}
}
It doesn’t matter how much I wait between the pushes, the codes will be sent alternatively.