How to switch to MQTT switch from master to remote client?
If i switch from hass_camera the switch on hass_master work, but not from hass_master to hass_camera.
HA on hass_camera do not receive the incoming mqtt message, why?
This is my config, im usinging mosquitto like mqtt broker.
I don’t see anything in your slave config that will receive an MQTT message. The statestream will send all state changes out, but not receive anything.
From what I can see, all you want to do is to toggle gpio pins on a remote Pi. Using HA on the remote is a bit of overkill. I suggest you try something like this project, which is easier to configure
what I’m going to do is have an RPi in every room in the house, with an installation of HA installed, because every RPi will have to handle all the I/O in the room, like switchs, lights, sockets, windows opened, ecc …
But I want everything to be managed by an HA master.
will I document on flyte/pi-mqtt-gpio or are there other solutions?
I am sure there are other solutions - just search github.
I have this one bookmarked as it seemed well written and documented.
If you want to use HA, you could have an automation with an MQTT Trigger with an action that turns on the switch. I think the state of the switch should be reflected back to the host by the statestream. But as I said, this is rather a complex way of doing it.
A couple of other points
in your original post, the birth and will messages for the remote and slave must have different topics - otherwise any client subscribing will not know which HA instance has gone down.
the state and command topic should be different for the switch on the master.
A client sends commands via an MQTT message, and other clients receive the message by subscribing to them. In HA terms, the command_topic describes the message that HA sends as a command, and the state_topic defines the message that HA subscribes to in order to receive the state of the device.
You can have the state_topic the same as the command_topic, but then you are just subscribing to the message that HA has just sent, so you are not really getting the state of the device, just that the broker received the message and sent it back.