@123 Thanks fresh brain and have noted a typo in my rfbridge_demultiplexer.py where I copied and pasted the last line of the dictionary to add further commands. This of course missed the trailing comma and then stopped the script.
All is working well now. Thank you for your time, effort and patience.
Log Details (WARNING)
Sun Dec 29 2019 21:38:28 GMT+0200 (Israel Standard Time)
No matching payload found for entity: doorbell with state topic: tele/sonoff_MSSR1/RESULT. Payload: , with value template Template("{% if value_json.RfReceived.Data == '8C81D2' %}
{{'ON'}}
{% endif %}")
(Iām using a Python function node instead of JavaScript)
codes = {
'bridge1_codes' : {
'xxxxxx':['backdoor','ON'],
'xxxxxx':['backdoor','OFF']
},
'bridge2_codes' : {
'xxxxxx':['garagedoor','OFF'],
'xxxxxx':['garagedoor','ON']
}
}
try:
tmp = msg['topic'].split('/')[1]
d = codes['{}_codes'.format(tmp)]
except:
d = None
if d is not None:
try:
data = msg['payload']['RfReceived']['Data']
except:
data = None
msg = {}
msg['payload'] = None
if data is not None:
if data in d.keys():
msg['topic'] = 'hass/{}/status'.format(d[data][0])
msg['payload'] = d[data][1]
if msg['payload'] is not None:
return msg
I have multiple rf bridges in my house with 6 door/window sensors, Some single buttons and remotes for my alarm. I used to run tasmota but last week I have converted all the bridges to esphome. It is MUCH faster than tasmota. Also the range seems to be a lot better. No mqtt traffic anymore but straight into home assistant via the native esphome api. My log was also flooded with payload warnings but that problem is also fixed now.
Can someone explain how thatās possible? Is the receiverās gain adjustable?
Probably indicative of configuration problems requiring correction. It wasnāt running optimally so any performance comparisons with esphome are rendered moot.
Well, in general esphome is known for its performance and faster than Tasmota.
My configuration was correct, these logs are warnings, no errors. It was working rock solid for months, but simply not as fast as esphome. I can recommend it to everyone. Not only for the rf bridges but also for other devices. As far as the gain settings, Iām not sure you can. You can set the tolerance and use filters. This can help a lot in enhancing the stability of the signal/range
I too have just dipped my toe in with ESPHome and the RF Bridge. The response is definitely quicker. Iāve not made any attempt, as yet, to test range though.
Wether the response time is because itās not going through the MQTT server I canāt determine.
As mentioned in my previous posts, Iām using 5 RF Bridges and for me the demux option works great as any of them can pick up the signal from my sensors and I only get one message into home assistant. My reliability has increased as a result.
What Iād like to try next is using 5 ESPHome RF Bridges in the same way but my python skills arenāt yet up to that.
Following the successful test of the ESPHome version, Iāll buy another 4 RF bridges and see if I can run them side by side to see what the real differences are.
And if anyone can help me work up a demux for them itād be a great help.
As each sensor is defined on the RF Bridge itāll certainly eliminate rogue codes that I, and others, have been experiencing.
i think the response is quicker because the data is going straight into Home Assistant via the native ESPHome API and indeed, not via MQTT.
Before i did the conversion to ESPHome i needed 4 bridges in total, now i need 3, because there are no misfires anymore.
If you want to expand your range via multiple bridges, you could simply try to end your automation with a automation.turn_off a delay of a couple of seconds, and then a automation.turn_on. If you do so, the first message will trigger the automation and turns it off immediately so the other ātriggersā will not result in multiple automation runs. With Tasmota i was not aware of the demux option, so i simply subscribed all my bridges to the same topic, and used the automations as described above. Worked like a charm!
How exactly did you do that? I can see nothing about Sonoff RF Bridge on the ESPHome website.
Iām using my RF Bridge with OMG and wonder if there are any benefits of switching to ESPHome (have some Wemos D1 mini with ESPHome as remote sensors and hoping to convert my Sonoff Basic to ESPHome, too).
I am trying this python script but fail to provide the needed JSON to Python Dict transformation. In my setup the āpayloadā is always transfered as string to the python script:
My automation:
All parameter values are passed as strings. Normally the solution would be to convert the string using pythonās json.loads but that is unavailable in python_script. To make it available, you would need to import json but python_script does not allow importing modules.
Someone else encountered the same hurdle and there was no solution to convert the string to a dict:
Thanks for this negative answer which at least saves me hours of useless effortsā¦ actually I would have tried exactly that.
With Python scripts its even worse: you cannot do simple slicing like a[:4]. It appears to be a naked installation without even the basic modules. I am surprised as one argument for me to try HomeAssisstant was the underlying Python framework.