Learned rf code triggers twice

I’ve setup my RM4 Pro with HA and managed to learn a couple of codes, however when I run call service with the code below, the light turns on and off again. The same happens with the brightness command, when I run it the brightness jumps 2 steps not 1. Am I doing something wrong or is there a problem learning the codes?

entity_id: remote.rm4_pro_remote
device: Lamp1
command: Power On’

The data you are using to call the service seems ok. But you may try this just to check.

entity_id: remote.rm4_pro_remote
device: Lamp1
command: Power On
num_repeats: 0

If this again doesnot work, it should be the issue with the code you have learned. In that case you can see the codes learned in the hidden folder storage which is located in the config folder. The file name would have broadlink_remote on it and ends with the word codes. Open it with some text or code editor app and then check if the learned code is repeated. If so delete the repeated part of the code and try.

If this also doesnt work delete the learned codes and try learning again.

It looks like I resolved it. I tried numerous times to relearn the codes and always resulted with the same issue. I then went into the broadlink config file and rename one of the learned codes and restarted HA, after this all the codes worked as expected. Not sure why this resolved it, but replicated it a second time by deleting the codes and starting again. Again the second time resulted in the same issue and renaming one of the learned codes in the config file resolved the issue.