Speed of transmitting 433+sonoff+zigbee2mqtt+ikea bulb

Hello community,
I have the following set up
Motion detector 433 Mhz
Sonoff RF bridge with Tasmota
Zigbee2mqtt
and finally IKEA bulb

So in my bathroom motion is detected, bridge send that signal to Hassio and Hassio turns on the bulb. Works good but not fast enough. When person enters the bathroom it take around 2-3 seconds to have the light on.
I can not understand where is the bottle neck of this set up.
Maybe 433 motion detector and RF bridge is slow?
What would be possible improvements for this set up?

I have a Ikea motion detector with zigbee2mqtt. I can’t even reach the wall switch before the light turns on.
What did you flash your sonoff rf bridge with ? OpenMqttGateway is faster than tasmota.

I’ve flashed mine with Tasmota which I find ok but things could be better.
Is OpenMqttGateway perceivably faster than Tasmota on a Sonoff RF Bridge?

so probably RF is the bottle neck
I need to try this IKEA sensor, but it more than twice expensive than 433 sensors

I have two sonoff rf bridges (one in the back of my house, in the front, because the reach of the door sensor on my garage door is not enough) When the second arrived, I compared both tasmota and openmqttgateway. OpenMqttGateway is a little bit faster according to the logs.

Second, if you have lot of automations based on the rf bridge, you might check this topic:

https://community.home-assistant.io/t/sonoff-rf-bridge-strategies-for-receiving-data/108181

Strategy two is faster, even if it adds an extra mqtt call.

You also need to bear in mind the state processing of HA.
I was reprimanded for tagging so I’ll just say thar a certain member (with a thunderbird 2 avatar) advised that (say) a 1500 ms timer might take 3 seconds to generate an output.
As HA only updates registers on a 1 second basis
So say your sensor takes 250ms to transmit and just gets into a new second, it won’t register for say 950ms, it’s then processed, an action registered, and sent out, another second, and then (say) another 250ms to send and your switch to react, then that’s nearly 2.5secs, admittedly worst case, best case 1.5 sec from event to event
These are just hypothetical scenarios based on arbitrary times

You can put HA in parallel to the MQTT and have the switch listen directly.

I do this (for other reasons) with my living room lights. Both my “switch” and HA listen to the topic from the RF Bridge. So even if HA is shutdown the lights still work. It would remove any delay caused by HA.

There are of course downsides as it removes the ability for HA to intercept the MQTT message and decide not to turn the light on, for example. HA can of course still emit the messages to turn it ON or OFF though and it’s state should still track.

I don’t have switch. Bulb connected to the the electricity directly and controlled with hassio only.

Ah, the IKEA bulb is Zigbee I assume and your HassIO has the zigbee dongle or similar which HASSio controls. It’s still possible to decouple them, but probably not worth your while.

This STILL has to go through a zigbee bridge/hub

Are you sure about this ? If I turn my switch on and immediatly off, I see this in my log

2019-09-30 14:55:10 DEBUG (MainThread) [rflink.protocol] received data: 20;14;OK;
2019-09-30 14:55:10 DEBUG (MainThread) [rflink.protocol] got packet: 20;14;OK;
2019-09-30 14:55:10 DEBUG (MainThread) [rflink.protocol] decoded packet: {'node': 'gateway', 'protocol': 'unknown', 'ok': True}
2019-09-30 14:55:10 DEBUG (MainThread) [rflink.protocol] command response: {'node': 'gateway', 'protocol': 'unknown', 'ok': True}
2019-09-30 14:55:10 DEBUG (MainThread) [rflink.protocol] received data: 20;15;OK;
2019-09-30 14:55:10 DEBUG (MainThread) [rflink.protocol] got packet: 20;15;OK;
2019-09-30 14:55:10 DEBUG (MainThread) [rflink.protocol] decoded packet: {'node': 'gateway', 'protocol': 'unknown', 'ok': True}
2019-09-30 14:55:10 DEBUG (MainThread) [rflink.protocol] command response: {'node': 'gateway', 'protocol': 'unknown', 'ok': True}

All in the same second. (I only have set my rflink to debug)

Not 100%, I’ve not read the source code.
Check with pnbruckner, he has. (he’'s not steered me wrong yet).
I don’t see anything in your log to say this is wrong, they are all on the same second, there’s nothing to stop HA sending out 1000 messages/instructions on the same second ??? And I don’t see anything to suggest this is a message chain. Dunno, I generally note a lag in all things HA, Its a damn sight quicker than I can respond from a standing start so I’m happy with it.
Getting the MQTT to talk direct will obviously be quicker, but I don’t see any link even between a zigbee item and an MQTT one being direct. These things are all subjective anyway.
If the light was a compact flourescent we’d have time to ask HA to hurry up.
But even so, your log is may not be reporting what HA has done, it’s probably reporting what the MQTT bridge has recieved/sent, those message packets probably carry the time stamps of the action so the best way to be sure is : -

  1. select an event as a trigger
  2. act on the event
  3. get feedback that the event has been carried out
  4. compare timestamps on 1 and 3

This applies to an RF Bridge / A Tradfri(Zigbee) Bridge / an MQTT Bridge whatever.
Do the test and prove me wrong (I havn’t got MQTT or even Logs or History so I can’t)
Any information is good information, I dont’ mind being proved wrong, I just got the information from someone I respect. That’s what I said in my first post. I ‘may’ have misunderstood but this is my understanding.
Have you not noticed that if you do a transition on a lamp, it always seems to happen in multiples of 1 second intervals ?

I don’t have lamps that can do transitions from HA, so I never noticed. But I will try to do some more tests.

Regardless, that’s not my point, I think the point is to find out - before recommending someone buy a new device, possibly on a new platform, requiring a new hub/stick (whatever) and then finding out he has improved lag by 20ms
I would welcome any test data though, as I say, I’m not able to do any. :sob:

But what do people expect from free software, running on a raspberry pi (usually that is) That is basically there to turn lights on and off at given times … and now we want/expect it to run a nuclear reactor ???