Multiple raspberry pi mqtt mosquitto. Help! Where to start

Hi,

I’m stuck and I need a push in the right direction.

I have 2 raspberry’s. One with hassbian were HA runs for my house, one with a RF transmitter and receiver for testing.

What i want to do is use the second Pi to send a MQTT message to the HA-pi when it receives a signal from a RF device.

So how do i connect the 2 pi’s? I have mosquitto installed and tested on both diveces.

Either MQTT Statestream or MQTT Eventstream. That would require that both Pis run Home Assistant.

1 Like

They’re already connected if they’re on the same network.

Just use your MQTT messages. That’s the purpose of it.

You may need to read up a bit on how MQTT works but you only need one broker (ie mosquitto installed on one pi only, probably the one with HA running).

What you’ll need to do is write some type of mqtt client program to run on the RF receiving Pi to publish MQTT messages when an RF signal is detected. Not easy stuff.

1 Like

@Tinkerer the Pi will be replaced bij a arduino or ESP8266 device. So i thought i could do it only with MQTT

@flamingm0e Is it that simple? I just need to use MQTT more i think. But i will need to make a script of some sort to make the 2nd Pi send the MQTT message?

@marthocoo Ok. the Pi with HA does have Mosquito installed. I see a lot of stuf about ESP8266 and arduinos used for the purpose i want to use it for, the problem is my Arduino hasn’t arrived yet so i though maby i can practice with the Pi until it arrives.

Yeah. An MQTT broker by itself doesn’t talk directly to hardware or anything. It’s just a message queue. You need to write your script to publish to a mqtt broker. It’s very very easy to do in Python, but if you’re going to put in an esp chip, the code will be completely different than the pi.

1 Like

Maby ill just wait for the esp. Alot of tutorials for that subject.