Compile to add Subscribe? and other questions #10300
-
I see a note in the docs that says I have to compile my own version of Tasmota to include the MQTT Subscribe command. I see there's a header file I must adjust and I'll stumble through that. I'm brand new to Tasmota. My main device is the Wemos D1-mini and I've used the arduino IDE and various libraries (like pub-sub) to make my things. I'm trying to duplicate this basic setup... using 2 Wemos D1-minis and a node-red/mosquito broker:
Details:
I've got the first device, the motion sensor, responding to movement. And I have a rule to publish an ON value to the topic. (still trying to understand how to Subscribe on the second device).
When I wiggle my hand in from of the PIR sensor, I see this in the console:
I never see the 0 value (low/gnd state) five seconds after the last time the GPIO12 pin went high. Questions:
Thanks for any advice, |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments
-
Hello @TinajaLabs For general support please join us on Discord (see link on main Readme) Pub/sub is at the core of Tasmota. The additional feature you are referring is 'generic subscribing to any topic from a Rule or a Script. Let's discuss this on Discord |
Beta Was this translation helpful? Give feedback.
-
Hi @TinajaLabs As said above, there are multiple ways to reach your goal
I hope this gives you some directions Sorry again for my 1st message, I'm not yet used to Discussions. |
Beta Was this translation helpful? Give feedback.
-
Thanks, Barbudor, I'll transition to Discord. This, Discussions, seemed like a better place to lay out my setup and conditions, but maybe Discord will work as well. I am busy this morning but will get back with more questions later. |
Beta Was this translation helpful? Give feedback.
-
Hi @TinajaLabs |
Beta Was this translation helpful? Give feedback.
-
Use -fullrules binary on https://github.com/tasmota/binaries/. It has all the rule defines enabled, including MQTT subscribe. |
Beta Was this translation helpful? Give feedback.
Hi @TinajaLabs
As said above, there are multiple ways to reach your goal
Publishing directly from PIR to Leds on standard topic
Your PIR module could publish directly to the LED module on a standard topic like
Publish cmnd/topicled/POWER on
You need Rules only on the PIR moduleOr eve use the command
SwitchTopic
to have the PIR module to natively publish to a given custom topicPublishing directly from PIR to leds on an EVENT
Your PIR module could publish directly to the LED module on an evet topic like
Publish cmnd/topicled/EVENT pirevent
You also need Rules on the led module such as
on Event#pirevent DO whateveryouwant endon
Publishing and subscribing to a custom generic event
Th…