How do I realise MQTT Eventbus feature in MQTTv2? There’s nothing in the docs. I’ve found this post that mimics the behaviour with a set of rules but it’s a bit of a hack especially the cron rule which adds things periodically.
So what’s the proper way of doing this in MQTTv2? I would like to know this from the authors of the MQTTv2 binding with a proper example.
There is a pull request for the readme/docu pending, with a dedicated section of how to replicate the eventbus.
The official way is indeed to use a script on each side (if your goal is to synchronize instances), which gives you more power on what to synchronize.
Do you mind to share the pull request cause I couldn’t find it?
@marcelser: I guess David means this file: GitHub Link
@David_Graeff: Thank you for the clarification. I use (currently) Node Red as RuleEngine and therefore I have to pass all events via MQTT. Unfortunately I had to switch back to the first version. The additional latency created by processing the Xtend Rules is clearly noticeable in time-sensitive applications such as a light switch. I’ll try the days again with a JS233 Groovy script, but of course I would prefer a native solution without rule and scripts. What do you think?
I’m not using xtend rules at all. I avoid OH1 means if possible.
Try with js233 scripts or use the automation engine directly by writing a trigger-action JSON yourself. Paper UI unfortunately can’t do that correctly yet. Your are basically running native this way. The JSON is declarative so will only setup a native Java code chain.