I installed Mosquito on my Raspberry. now I have specified my Rasperry as MQTT server on my Shellys. On NodeRed I also added the MQTT server. on Nodered it also indicates that it is connected to the MQTT server. However, he does not receive any packages from Shelly, does anyone know exactly how to do this or has instructions so that I can see what I am doing wrong ..?
If you are using mosquitto version >= 2.0 then you have to setup the configuration to allow connections from other devices on the lan. However, if you installed mosquitto from the Raspbian repo then it should not be version 2. You can check using apt policy mosquitto
Mine says
mosquitto:
Installed: 1.5.7-1+deb10u1
Candidate: 1.5.7-1+deb10u1
If you install MQTT Explorer on one of your computers you can connect to mosquitto and easily see what, if anything, is publishing. That will tell you whether it is a problem with the Shellys connecting to mosquitto or something else. It is an indispensable tool if you are using MQTT, in my opinion.
I am note sure that you haven’t put the cart before the horse. MQTT is very easy to use, but everything needs to be set exactly.
I assume that if you are using Shelley’s you will be sending a simple message to turn on and off. What you first need to do in node red is to set up an MQTT out node. On this node there will be a box with a pencil next to it, press the pencil. The next page will allow you to set up the MQTT broker, this is your current machines Pi address and of course the port setting of 1883. You can give this connection an name for convenience when using this broker later.
On your Shelley, you need to set the MQTT broker to the Pi address and port that you set up previously on the Shelley.
Now you need to sort out what signal the Shelley needs for on and off. This is done by attaching a dashboard switch node to the MQTT out node and setting on and off payloads.
Hopefully this has helped a bit, sorry I cannot give you help with the Shelley set up because I don’t have any experience with them.
Something that you could intent is, in the topic properties put "#". it help you to look all the topic and payload that there are on MQTT. Or use MQTT Explorer / MQTT.fx
Hi automati.
Don't know if you have solved the issue in the meantime. I use shellies with NR and mosquitto and they works very well together.
Since you write "However he (Node-red or mosquitto, please clarify) does not receive any packages from Shelly" I assume that you want to subscribe to the data from shelly via the mosquitto broker and, therefore, you need a "mqtt in"node. Have you done this? Also be sure to have specified the same topic both in mqtt in node and the shelly device configuration page (field Custom MQTT prefix of tab "Internet & Security -> Advanced-developer Setting "
HTH
I would at first install an mqtt client on your pc/laptop/...
check you can publish ánd receive messages
then check your shelly settings: internet & security - advanced. Check mqtt is enabled and the settings are ok.
as said above, in your mqtt client listen for topic # (you might see a lot coming to you) and see what you receive when you switch shelly manual on and off.
with the results and shelly’s doc, find out how to operate shelly from your mqtt client.
Could be something like:
shellies/shellyswitch25-F40E6A/relay/0
shellies/shellyswitch25-F40E6A/relay/0/command
then open node red and try to implement it as above said.