Portisch / RF-Bridge-EFM8BB1

Alternative Firmware for the Sonoff RF Bridge EFM8BB1 chip
289 stars 122 forks source link

Support new Tasmota MQTT format to detect RfRaw message #187

Closed jcisio closed 3 years ago

jcisio commented 3 years ago

It seems that in recent version of Tasmota, the MQTT message format has been changed to add time data.

Old example:

18:30:23 MQT: /sonoff/bridge/RESULT = {"RfRaw":{"Data":"AA B1 04 0224 03FB 0BF4 1CAC 01101001100101011010100110010101101010010110011023 55"}}

Mine, currently (Tasmota 9.2.0):

21:20:06 MQT: tele/rfbridge/RESULT = {"Time":"2021-01-12T21:20:06","RfRaw":{"Data":"AA B1 04 0140 00E6 051E 0514 381828 55"}}

I don't know since when this change happened, or could it be configured. But we can see it everywhere, e.g. in March 2020 https://github.com/Portisch/RF-Bridge-EFM8BB1/issues/155

pfeerick commented 3 years ago

Looks like it's been a while since #142 also seeks to fix this...

easyservices commented 3 years ago

Hi there, here we go...the decoder tool that will make our life easier with the latest Tamosta version (at least it works the 9.x version) in order to automate B0 signal testings :-) bitbucket-converter-20210203-py3.txt

Have fun. Do not forget to rename it with .py instead of .txt and it works with python3.7+ btw this "hack" works only for tamosta devices as I made a quick and dirty fix that drops the previous ESPHome support...

jcisio commented 3 years ago

@easyservices what did you change? Normally with this PR (one line change) it should work already.

easyservices commented 3 years ago

@easyservices what did you change? Normally with this PR (one line change) it should work already.

1st fix - search pattern was incorrect for tamosta 9.x and >

original line 287 --> if '{"RfRaw":{"Data":"AA B1' in line: replaced with --> if '"RfRaw":{"Data":"AA B1' in line:

2nd fix - uri was incorrect for tamosta 9.x and >

original line from 72 (I suppose it works for ESPHome firmware but not for tamosta) --> url = str("http://{}/ax?c2=191&c1=RfRaw%20".format(mydevice)) url += szOutFinal.replace(" ","%20")

replaced with --> url = str("http://{}/cm?cmnd=Backlog%20RfRaw%20".format(mydevice)) url += szOutFinal.replace(" ","%20") url += "; RfRaw 0"

Ideal fixes would be to include a new args param to select ESPHome or Tamosta firmware :-) Cheers

jcisio commented 3 years ago

Ok thank you, I didn't use the sendCommand so I didn't notice it. Both these two fixes are included in https://github.com/Portisch/RF-Bridge-EFM8BB1/pull/142 so I think I'll close this PR.