jesserockz / wizmote-esphome

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Two Wizmote simultaneosly

hirkkak opened this issue · comments

Hello, Congratulations for your work, first of all.

I had a wizmote controller and it has been very useful for me to make it work with HA. The fact is that I decided to buy a second controller to have the same functions twice. But it only works when I put the MAC field, which also doesn't support multiple values (or I don't know how to put them). And if I don't fill it, only the first wizmote works. Is there any solution for this? Is there a way to make both work simultaneously?.

Greetings and thank you very much!

After some more testing, the new controller no longer works.
No event is heard (using developer options)
Neither esphome.wizmote_choose nor esphome.wizmote_action
But if both events are shown in the esphome log

Off button of the remote that not works.
[01:10:07][D][esp_now:071]: mac: 6C.29.90.0D.6A.1E (6), data: 81.E3. (13)

Off button of the remote that works.
[01:10:50][D][esp_now:071]: mac: 6C. (6), data: 81.DA. (13)

EDIT2: The new controller randomly works(some days it works and other days it doesn't). How can i debug it?

The blueprint is only set up for a single remote. You need to set up two automations from the blueprint, or you could modify the blueprint to support multiple remotes.

As for you other issue, I am not too sure. The logs you are seeing above are showing that the remote is sending and ESPHome is receiving correctly.

I think it is to do with last_sequence being shared amongst all on_esp_now_message calls rather than saving the last_sequence per remote mac address.

Whichever message (remote) has the highest wizmote.sequence number will trigger wizmote on_button.

I have two remote here and only one usually fires events into home assistant yet both remotes are being seen in the esphome logs.

If I keep clicking the non-responsive remote enough times to have a higher sequence number, it will begin to function then the other remote will fail until its sequence number is the highest. This probably explains the behavior @hirkkak is seeing.

I discovered that new remote works only when i reboot HA, until i use any button on the old one.
Then only works the first one until i reboot HA again.

I tried to use same button on the old one for about 100 times, but didn`t work. Any idea?

I think you may need to press the buttons on the new remote many more times. This will not solve the issue but will confirm it is the same one I have observed.

Could you press the number 1 on each remote and post the esphome log output here?

Hi, here is the conclusion.

Button 3, on Working Wiz1 Remote:
[00:39:19][D][esp_now:071]: mac: 6C. (6), data: (13)

Button 3, on NON Working Wiz2 Remote:
[00:39:52][D][esp_now:071]: mac: 6C.29.90.0D.6A.1E (6), data: 81.8C. (13)

Button 3, on NON Working Wiz2 remote after about 100 clicks.
[00:41:03][D][esp_now:071]: mac: 6C.29.90.0D.6A.1E (6), data: 81.F7. (13)

Buttton 3, on WORKING Wiz1:
[00:41:40][D][esp_now:071]: mac: 6C. (6), data: (13)

Button 3, on NON Working Wiz2 remote after thousands clicks.
[00:45:44][D][esp_now:071]: mac: 6C.29.90.0D.6A.1E (6), data: (13)

Button 3, on WORKING Wiz2 remote after thousands clicks + 2.
[00:46:14][D][esp_now:071]: mac: 6C.29.90.0D.6A.1E (6), data: (13)

So you are right. The highest one, wins!!

Now, if i click 3 times on wiz 1, have to click other 3 on wiz2 to get working and vice versa

The question is? There is some magical and extra easy solution? ;-)

Thx in advance for all, and sorry for delay, away from home.

Hi i replaced '<=' by '==' it seem works perfectly on wizmote.cpp

void WizMoteListener::on_esp_now_message(esp_now::ESPNowPacket packet) {
WizMotePacket wizmote = WizMotePacket::build(packet);
//if (wizmote.sequence <= this->last_sequence_)
if (wizmote.sequence == this->last_sequence_)

this->last_sequence_ = wizmote.sequence;

Ah sorry, I misunderstood your original issue. Yeah this makes perfect sense that the sequence needs to be unique per remote mac. I will try make some time to fix this.

ezoic increase your site revenue