Switch platform: rpi_rf Protocol issue

Hi all,

Not sure if this is a bug or user error? I have got one switch working on RF, A energenie plug so I believe the hardware set up is fine. So Kitchen switch is fine.

(Kitchen) 2016-06-04 09:26:16 - [INFO] rfrx: 1916675 [pulselength 354, protocol 1]

When i scan for the signal for my little water fountain, using the script from https://raw.githubusercontent.com/milaq/rpi-rf/master/scripts/rpi-rf_receive

(Fountain)2016-06-04 09:27:14 - [INFO] rfrx: 15667645 [pulselength 126, protocol 3]

Protocol 1,2,5 when changed in the configuration.yaml and then flicking the switch on the gui sends the correct protocol message to the Rx python script

but if i set it as 3, i get

2016-06-04 09:31:34 - [INFO] rfrx: 15667645 [pulselength 517, protocol 5]

and 4 gives me

2016-06-04 09:47:33 - [INFO] rfrx: 1916675 [pulselength 354, protocol 1]

for comparison if I set it as protocol: 2 i get
2016-06-04 09:49:34 - [INFO] rfrx: 15667693 [pulselength 664, protocol 2]

switch:
 platform: rpi_rf
 gpio: 17
 switches:
  kitchen:
   protocol: 1
   code_on: 1916675
   code_off: 1916674
  Fountain:
   protocol: 3
   code_on: 15667645
   code_off: 15667693

(code above was formatted correctly i believe before I pasted it here)

Hope that made sense? sorry if I am missing something obvious but has anyone got any advise please?
(Pi and HA’s software is up to date and I have rebooted the Pi)

1 Like

Hi

Could you take some pictures of the units i also had problems with some of the rf switches because they have special protocols in place if you google the codes on the units you could find some information on the switches if you willing to take pictures of the units i am willing to have a look

for me it requires running a command line execute for 3 of my switches but it works :slight_smile:

Greetz Mark

Thanks for reply, sorry if I was unclear, my switches ( Energenie plugs) are working fine for me using Protocol 1

The issue is when I try and set up another switch, which uses a different Protocol. In this case I want to use 3.

I think there is a bug in Home Assistant that if you try and set Protocol 3 in the configuration it sets it as Protocol 5 and if you set Protocol 4 it sets it as Protocol 1
"Fountain:
protocol: 3
code_on: 15667645
code_off: 15667693
gives me a transmit of
2016-06-04 09:47:33 - [INFO] rfrx: 1916675 [pulselength 354, protocol 1]

But i am new to this so may well be wrong?

I followed this excellent video guide https://www.youtube.com/watch?v=5UUazFbK-Hg

Alright i read over the switch part sorry about that just took a look at the switches and re read the post to me its a little unclear why you would switch protocols because you send different commands to te units

also i see that the code you are receiving is different than what you send dit you look on protocol 1 if 15667645 and 15667693 return normal and not like 1916675

Greetings Mark

Thanks for the response

Using the script to record the button presses to turn on my fountain, i get

(Fountain)2016-06-04 09:27:14 - [INFO] rfrx: 15667645 [pulselength 126, protocol 3]

(Protocol 3)

So in my config i have put Protocol 3 I am not just randomly changing it, I presume in the HA config i am supposed to put the same protocol number as what was recorded?
"“Fountain:
protocol: 3
code_on: 15667645
code_off: 15667693”

BUT when i do that, HA transmits as if i selected Protocol 5

2016-06-04 09:31:34 - [INFO] rfrx: 15667645 [pulselength 517, protocol 5]

i would have thought it should have transmitted this?
“2016-06-04 09:31:34 - [INFO] rfrx: 15667645 [pulselength 517, protocol 3]”

Yeah my switches have said that they needed different protocols before but i usually stick witch default (1)

as far as i can see that should work if it doesn’t i would just go trough every protocol to see if one of them is working
i looked on the internet for a little while and found that Energenie also have there on library for there board they sell hope i doesn’t come to that but otherwise that might be a solution

i would try to “fire” your codes with different protocols and try to read them once more to see what kind of output it provides you with try pressing 5 or 6 times to see if the signals you get are consistent

Greeting, Mark

@NewToThis I am having the exact same problem. I am setting the protocol as something and the HA is transmitting as protocol 5. Really strange. Don’t know why.

Did you figure out how to solve your problem?

1 Like

Hi
I deed manage to fix it an now works fine.
I am using raspberry pi version 2 (but i think will work on 1) and installed latest version of jesy and HA (not all in one installer, it always failed somewhere on the installation for me).
To install the rf sniffer and rpi rf I used the fallowing instructions:

Another tip don’t use the chip rf transmitter receivers they are not that reliable (they pick up noise and sometime don’t respond when the code is sent.
Hope this helps, all the best.
PS Just remembered one of the problems is the type of wires you use to connect the transmitter to the pi it make it work or not.I initialy used this ones and had the same problem like mention before. Then i made it works with telephone copper wire that i solder on to the rf transmitter.
Hope all makes sens

1 Like

Thank you for the reply @adifoto.
In-fact, I am exactly following the video by BruhAutomation (Ben) and I faced this similiar problem.

So, if I understood you correctly, in the home-assistant for one of the switch you are setting the protocol as “1”, but when you sniff the received packet you see that the protocol is being received as “5”.
And you solved this by soldering a wire instead of using a ribbon cable to connect to pi (Currently, I am using a ribbon cable.)
I am going to try your fix and will you keep posted on whether this fixed it. Thanks for the help.

I did not understand this comment:

Another tip don’t use the chip rf transmitter receivers they are not that reliable (they pick up noise and sometime don’t respond when the code is sent.

Can you clarify this please?

Sorry just realized i misspelled cheap i tried the 2 variation of rf transmitter/receive module :
the one that Ben and i are using: http://www.ebay.com.au/itm/221922788716?_trksid=p2057872.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT
and the cheap ones: http://www.ebay.com.au/itm/433Mhz-WL-RF-Transmitter-Receiver-Link-Kit-Module-for-Arduino-ARM-MCU-Wireless-/380717847790?hash=item58a48d54ee:m:mHvksNaLC2o69zWwCDM4XvQ
The last one are not that reliable, how mentioned before, they do not have much of the range without a proper built antenna and even so sometime are not responsive ore at least the one i have are not.
Hope this makes sense, let me know if you have any problems.
Adi

@adifoto Sure, I faced some problem with the cheap ones. Then I bough the heterodynes, the better ones, the one you and ben are using.

I am currently facing the problem with the heterodynes.
But I am still not able to figure out the problem.

I am not sure, why the protocol gets changed while transmitting.

Did soldering fix your problem?

PS i got the switches code by using the arduino not the raspberry rpi rf sniffer that was much easier and without any other noises. Let me know if you need any detail about that.

@adifoto Yes, even I was unable to get the sniffing code working with Raspberry PI. There was a lot of background noise.

I use the Arduino, RF-switch program to find the codes. Now, I am even able to control the remotes using the arduino, turn on and off.

But unable to do the same with Home assistant due to the protocol problem.

Strange that many problems are so common. Maybe we should document somewhere, so that it is helpful for others too.

1 Like

Yes, same here, but after I used copper wire it start working, but couldn’t be bother using the pi sniffer. Arduino sniffer is the best.
About documenting we doing some here, but i understand your frustration, i just got to frustrated and live it and later come back but now i control a blind (trough arduino - automation) and 3 switches.