Send Data to Another Pi on Network

I am in the process of updating a very old (5+ years) implementation of Home Assistant.

The system is setup so that the Home Assistant pi can turn on/off my projector by sending a 1/2 to another pi that is attached to the serial port of the projector. In the old implemenattion, I would run python scripts via shell commands but the new implementation of home assiatnt cannot run anything that uses an import (e.g., import socket). While I’m pretty good at fiddling with things until they work I am not an advanced programmer. What direction should I go? Should I look at using AppDaemon or would MQTT somehow work? I’ve looked into each approach and neither looks that easy so I want to pick the right path up front. Thoughts?

Thanks!

Personally, I like MQTT. It’s simple and you could control your projector on/off from your phone, anything with a browser or even a 433mHz “button”.

I setup a MQTT server on my piZero and everthing worked great… until it didn’t. Now it looks as though the client is reconized by the HA mosquitto MQTT broker but nothing transfers between the two pi’s. Is MQTT flakey or is it generally reliable? Thanks!

MQTT is extremely robust and very mature. It was developed by IBM.

Get the program MQTT-Explorer by Thomas Nordquist. This will give you a picture of everything your MQTT broker is doing.

I have my MQTT broker on a Raspberry Pi3 in my basement. It doesn’t have to be separate from your MQTT nodes, but it makes it cleaner.

You have one device that publishes to a topic, and another device that subscribes to the same topic.

So the Home Assistant should publish to the topic- and MQTT-Explorer should see it.

I have never published from Home Assistant, preferring to do it from Node Red. Mostly because I don’t grok automations.

You didn’t tell what system you put in place to exchange information.
There is no “auto-magical” transfer between the 2 instances.

See MQTT State Stream to MQTT Discovery - Blueprints Exchange - Home Assistant Community (home-assistant.io) for a “master/slave” HA configuration via MQTT.

If your “slave” PI doesn’t run HA, can’t you use plain SSH to send command from HA?

My issue was that I was not sending my log-in credentials correctly. It looked like my client was connected but it really wasn’t. Working now. Thanks!