first of all thank you for reading , my first time to post and still learning HA .
I got Sonoff RF Brdige and flash it using espurna. Im able to see the RF signal from sonoff PIR .
but it keeps changing
sample captured rfin:
30F201A404CED11A1E
311001A404CED11A1E
30FC01A404C4D11A1E
30E801A404CED11A1E
30FC01A404C4D11A1E
30F201A404C4D11A1E
only the last 5 digit is common/unique “D11A1E”
what i did is to replace the other character with nothing to extract the unique 5 digit , but the line is too long:
value_template: '{{ value_json.rfin | replace(“3110019A04CE”, “”) | replace(“312E01A404CE”, “”) | replace(“30F201A404CE”, “”) | ,etc
then match it :
payload_on: “D11A1E”
===
another way i tried is to use last ()
value_template: ‘{{ value_json.rfin | last() }}’
then just match it with
payload_on: “E”
Im sure there is a better way , appreciate any suggestions from the community,
thank you.
the goal is to captured the unique 5 digit
from different PIR and door sensor using RF
thank you
Hello,
Yes a better way would be to filter at the gateway level, here is the principle:
hi 1technophile , thank you . i read your link , I agree that gateway level should be the best. But im not skilled to do it . Before I post it , i really googled and read a lot of post… Im just thinking if I can somehow truncate the first numbers ( the current truncate remove from the last characters ) …
thanks again …
From what you indicated above you should be able to load OpenMQTTGateway into Sonoff RF Bridge and be able to publish only the constant data code
thank you , I will explore/read that . / cheers
hi 1technophile , i bought another RF bridge . and trying to compile it using Arduino . im getting this error:
appreciate if you can give me any clue or direct me to correct info …thanks
===
OpenMQTTGateway:82: error: ‘mqtt_server’ was not declared in this scope
_ PubSubClient client(mqtt_server, mqtt_port, callback, eClient);_
===
no need to reply 1technophile , thank you. Its more on Arduino setup ( new setup on another machine) i make it portable and update again the libraries . Im able to compile it now. /cheers
1 Like
The reason for changing signal is timing, quotation from Tinkerman:
“The code structure is simple:
Sync time (2 bytes)
Low level time (2 bytes)
High level time (2 bytes)
Data (3 bytes)
So this is what a Noru message looks like: “24E0 0140 0384 D00358”. That means: 9440us sync time, 320us low time and 900us high time. Data is “D00358”, this identifies the button in the remote. The timing is not necessarily strict, but you can see the high time is 3 times longer than the low time and the sync time is 10 times longer than the high time.”
So your logic about last digits must be OK.
thank you for your insights… Now im using OpenMQTTGateway ( thanks to 1technophile) to listen to RF signals .
Im hoping that broadlink Pro should be able to do the same since it also can learn code .
1 Like
Hi 1technophile ,
is there a way to somehow secure the signal from the gateway level , like from every RF signal I will prefix it with something before publishing the RF Value to MQTT ?
thanks
Hi,
You mean to secure the mqtt communications with the broker or between RF device and the gateway ?
Thanks, from gateway to Mqtt broker.
eg… The RF signal is 1234567, but the gateway will send prefix+1234567…
Prefix=abcd, I will see from broker… abcd1234567… im just thinking in case somebody have RF gateway at my neighbor, even he replay the RF, my HA will not match it because of the prefix.
Sorry , my logic is wrong . and it does not solve my issue . Thanks anyway.