Edge Shelly drivers for Gen1 and Gen2 Devices

thank you for your help, I really appreciate it.
I also wondered if actiontiles is limited to displaying only 4 components from one device. If I understand it correctly, I have one “main” (switch) and 4 “components” (relay1, sensor 1 to 3). write to support actiontiles for verification or help on how to get valuable adcs to be displayed.
As @Channelk wrote, the shelly UNI is a perfect device and the only one of all that has such an input for voltage measurement, it has so many uses, for example, if someone installs backup batteries, he can monitor their voltage, he would even know if there is a power outage or if it comes directly from the batteries. Or connect there a water level sensor in the tank, after calibration it could recalculate e.g. 1V= 1m

If the Action Tiles support answer is that there are limitations on supporting components, one thing that may help is if I simply move the adcs field up into the ‘Relay1’ (main) component.

I haven’t received an answer yet, but what you suggest could help. You could easily move “signal strenght”, it doesn’t support actiontiles anyway, and replace “voltage measurement” and it would remain there (refresh, switch, voltage measurement). We could try this

thank you and I wish you all the best in the new year, and good luck to you and your family in life

That would be easy to do, but I’ll wait to do anything until next week when you should get an answer from Action Tiles (I’m sure everyone is out on holiday right now).

Hello.
I have a Shelly 1 with a reed switch.
With this drive, can I see the state of the switch?
This Shelly I use is for opening the garage. And I wanted to know the state of the gate, so I could turn on the lights automatically

ok, let’s wait for actiontiles’ answer

Hi! Thanks for the awesome driver, it has improved a lot my experience with ST and Shelly. I read most of your threads in search for an answer to a doubt of mine, hopefully you can enlighten me.

To understand my need I have to briefly describe the challenge I am facing: I have a Shelly 2.5PM connected to two different light sources (220V GU10 lights and a AC-DC driver for my 24v led strip) and also connected to a traditional wall momentary button on SW1 input. In the same room I also have a Zigbee bulb that I would like to turn on in the night instead of the ceiling GU10 lights.

The dumb way would be making a routine that turn on the bulb when the output of the Shelly is turned on and subsequently also turns the latter off, but this means that for a couple of second I would have a very bright light in the room.

I am instead looking at three other approaches:

  1. using MQTT to listen for the button press (used in detached mode)
  2. using the Shelly built in function to issue an HTTP command on button press to command a virtual switch/button
  3. exposing the switch entity from the Shelly in SmartThings (as you have done for temperature, power draw, etc.)

My question is then: to your knowledge would options 2 and 3 be feasible?
Regarding option 2 I know you have the web Requestor driver but I would then need to periodically issue a GET request to scan the status of the Shelly switch while I am trying to accept a POST request from the switch.

Thanks in advance and sorry for the long post!

Hi Todd,

I got a response from Actiontiles, but the response is generic and I didn’t learn anything about my situation. could you try how you wrote the ADCS value in “main” and I would try to see if I can read the value in actiontiles.

well thank you.

Up to recently, ActionTiles could only get data from the Main component. Now that we are switching over to the new SmartThings platform, we can actually retrieve data from the additional components. We will look into integrating them into ActionTiles as part of our enhancement cycle.

My reading of the response from ActionTiles is that they ARE going to support other components besides ‘main’. They just don’t say exactly when - only that it will be part of their ‘enhancement cycle’ whenever that is. But I’d have to believe it can’t be that far off.

Can you hold out a bit longer? I’d prefer not make driver changes to accommodate ill-behaved applications if I don’t have to! I hope you understand.

Certainly if it looks like ActionTiles is not fixing this soon, we can revisit this.

1 Like

of course I’ll wait, it’s not really important for me in terms of what I’m still using UNI for. I just don’t understand a bit, if no component works, only “main” then it’s clear, only for me some components work and some don’t, it’s so hard to distinguish whether it’s a problem that actiontiles hasn’t finished it yet or it’s a problem in the device driver

There’s probably many ways to approach this.

  • It would make since to have a separate button that you could then use to trigger the desired device based on time of day
    • maybe one way to do this is to configure the Shelly to ignore the input state and instead have a SmartThings automation that triggers based on the Shelly input. I don’t currently have the inputs included in my driver for the 2.5 but that’s something I could add. So if you could tell the Shelly not to act on the input itself, you move that control to a SmartThings routine instead and can uniquely control the 2.5 switch vs. the zigbee bulb. I think that’s the idea you may be going for in your 3 possible approaches.

Specifically regarding your approaches #2 & #3:

2: I think this could work: but again it assumes you can configure the shelly to not act on the input to control its own relays. Just remember that the driver uses the HTTP ‘actions’ too, so be careful not to delete or change those or your SmartThings device will stop getting notified! But you couldn’t do this with webrequestor, since it only SENDS http requests. It’s not a server that listens for POST requests. For that you would need to use something like my HTTP Devices driver

3: I’m not sure I understand your thought here. This is what this Shelly driver does. Or maybe you are referring to the input states, which I mentioned above I could add?..

Sorry Todd,
I thought I was posting this on message number 438.

I bought a bunch of Shelly devices. ShellyFlood, ShellyMotion2, ShellyH&T (humidity and temperature), ShellyDoor&Window (contact switch)

I got the ShellyMotion2 working with your driver and edgebridge procedure.

I installed Shelly Device Driver V1.6 and the ShellyDW device works until it goes to sleep. ShellyFlood and ShellyH&T also go to sleep after an IP is configured.

Shelly saves battery life by putting their device to sleep.

The device wakes up when it has change data to send and then goes back to sleep in about three seconds.

I found this topic so I’ll post the Shelly device problem here. I searched for sleep and found your comment here.

Maybe I shouldn’t even be using the Shelly Device Driver V1.6 driver. I got it from your TAustin Driver Tests URL Channel and Drivers Web UI

Will these Shelly products work with MQTT? This IoT stuff is really getting complicated.

I worry that smartthings is going to eventually pull the plug on everything. I know you’re working hard to keep it alive and working.

These devices can send HTTP messages.

2023-01-04T19:50:50.723037867+00:00 INFO Shelly Device Driver V1.6 Sending HTTP request: http://10.0.0.4/status
2023-01-04T19:50:53.812624076+00:00 DEBUG Shelly Device Driver V1.6 HTTP ret:
2023-01-04T19:50:53.815964368+00:00 DEBUG Shelly Device Driver V1.6 HTTP code: [string “socket”]:1553: No route to host (os error 113)
2023-01-04T19:50:53.819294868+00:00 DEBUG Shelly Device Driver V1.6 HTTP response:
2023-01-04T19:50:53.822340659+00:00 ERROR Shelly Device Driver V1.6 HTTP request failed: nil [string “socket”]:1553: No route to host (os error 113) nil
2023-01-04T19:50:53.825526826+00:00 INFO Shelly Device Driver V1.6 Sending HTTP request: http://10.0.0.4/status
2023-01-04T19:50:56.935068743+00:00 DEBUG Shelly Device Driver V1.6 HTTP ret:
2023-01-04T19:50:56.938245201+00:00 DEBUG Shelly Device Driver V1.6 HTTP code: [string “socket”]:1553: No route to host (os error 113)
2023-01-04T19:50:56.941293910+00:00 DEBUG Shelly Device Driver V1.6 HTTP response:
2023-01-04T19:50:56.966573201+00:00 ERROR Shelly Device Driver V1.6 HTTP request failed: nil [string “socket”]:1553: No route to host (os error 113) nil
2023-01-04T19:50:56.969696576+00:00 ERROR Shelly Device Driver V1.6 Failed to get status for Shelly Contact 1
2023-01-04T19:50:56.972810160+00:00 DEBUG Shelly Device Driver V1.6 Shelly Contact 1 device thread event handled
2023-01-04T19:50:56.978124201+00:00 INFO Shelly Device Driver V1.6 <Device: 7af8d6bc-25fc-4b81-8be0-6f92bd89e1e9 (Shelly Contact 1)> received command: {“args”:{},“capability”:“partyvoice23922.refresh”,“command”:“push”,“component”:“main”,“positional_args”:{}}
2023-01-04T19:50:56.981824368+00:00 TRACE Shelly Device Driver V1.6 Found CapabilityCommandDispatcher handler in thisDriver
2023-01-04T19:50:56.984976743+00:00 INFO Shelly Device Driver V1.6 Refresh requested
2023-01-04T19:50:56.988161660+00:00 DEBUG Shelly Device Driver V1.6 Shelly Contact 1 device thread event handled
2023-01-04T19:50:56.993232118+00:00 INFO Shelly Device Driver V1.6 Sending HTTP request: http://10.0.0.4/status
2023-01-04T19:51:00.052487660+00:00 DEBUG Shelly Device Driver V1.6 HTTP ret:
2023-01-04T19:51:00.055654243+00:00 DEBUG Shelly Device Driver V1.6 HTTP code: [string “socket”]:1553: No route to host (os error 113)
2023-01-04T19:51:00.058782702+00:00 DEBUG Shelly Device Driver V1.6 HTTP response:
2023-01-04T19:51:00.061887118+00:00 ERROR Shelly Device Driver V1.6 HTTP request failed: nil [string “socket”]:1553: No route to host (os error 113) nil
2023-01-04T19:51:00.065154118+00:00 INFO Shelly Device Driver V1.6 Sending HTTP request: http://10.0.0.4/status
2023-01-04T19:51:03.173002160+00:00 DEBUG Shelly Device Driver V1.6 HTTP ret:
2023-01-04T19:51:03.176245452+00:00 DEBUG Shelly Device Driver V1.6 HTTP code: [string “socket”]:1553: No route to host (os er

The Shelly motion device works ok with this driver, since it can be woken up via wifi/http. However the flood device, and the H&T device cannot. For those, I have started a separate driver, but it requires the use of MQTT. I don’t know if that is an option for you, but if it is, let me know and I’ll walk you through getting that set up. I have the Flood device working and am still in the process of adding the H&T device, but should have that available soon. I will have to look into the door and window device as well, but haven’t yet gotten to that.

I’m want and willing to try MQTT. I’ll search for the driver and instructions.

Also, is node-red something worth installing and configuring. I don’t exactly know what it can do. I found a link yesterday but don’t yet know how to install and integrate it on the Rpi. I restored the Rpi from an old image after trying to figure it out.

Can node-red talk to all smartthings devices? , or just MQTT. I thought MQTT was for ESP32 devices.

https://flows.nodered.org/user/otaviojr

Since I know you have a Raspberry Pi, it should be fairly easy to get you going with MQTT.

You can run this command to install the Mosquitto broker on your Pi:

sudo apt install -y mosquitto mosquitto-clients

More info from the mosquitto website here, and this being Raspberry Pi-specific.

Regarding nodeRed, I’ll let others offer their opinions, as I have no experience with it personally.

MQTT is not just for ESP32 devices. It’s a general purpose messaging framework for IOT devices.

1 Like

I want to get MQTT setup so I can use flood, H&T, and DW devices.

I installed these drivers on the smartthings mobile app

  • MQTT Devices V1
  • MQTT Handler V1
  • Shelly Flood MQTT V1

Should I also install MQTT SmartApp on the Rpi?
I should probably get the apps above working first, because you say it needs ngrok. Is ngrok supposed to take glitch.com out of the picture when creating smartapps with smartthings SDK? Since I don’t know what I’m talking about I better hold off on MQTT SmartApp on the Rpi.

I already have this installed on the Rpi:

  • openVPN
  • pi-hole
  • mosquito
  • edgebridge
  • nodejs

I ran the MQTT discovery and got failed to open network connection. I don’t have firewalls.

I configured it with
Broker address 10.0.0.3
user (blank)
password (blank)

The Rpi is 10.0.0.3

I don’t think there is a login and password on mosquito.
The MQTT Discovery app re-populates the settings for Broker username and password with xxxx after I do a refresh.

I’ll read thru your documentation again. I’m missing something.

pi@raspberrypi:~ $ mosquitto_pub -h localhost -t “smartthings/switch/myswitch/config” -m “create it!”
bash: !”: event not found
pi@raspberrypi:~ $

Do I need to subscribe to it first.

I don’t know how to use this.

wptracy@wptracy:~$ smartthings edge:drivers:logcat --hub-address=10.0.0.223 -t b2774eb9-0ce4-464f-81…
──────────────────────────────────────────────────────────────────────────

Driver Id Name

──────────────────────────────────────────────────────────────────────────
1 e67c842f-49a5-4083-95f0-c8137ae3c2f6 Edge Counter Utility V1
2 6175f7c6-3a78-4625-a042-127a0e1c6f08 Edgebridge Monitor V1
3 7a236882-7479-4a21-b814-d40bbd53619f HTTP Devices V1
4 e8a1a0b7-32e4-4882-8d38-45a96ead543d LAN Motion Device Driver
5 e9469ad4-f363-42aa-b35e-16790312169a MQTT Devices V1
──────────────────────────────────────────────────────────────────────────
6 ab4ec49a-8392-4d98-81dd-3554c4a95370 MQTT Handler V1
7 8f390da7-c66d-4245-9ba9-e431f95c78ec Shelly Device Driver V1.6
8 782cce9b-dd7f-427f-993c-c9aec8dfb160 Shelly Flood MQTT V1
9 f3258c1d-b6e9-424d-8b3f-b1e8fe51c4ca Shelly Gen2 Device Driver V1.0
10 0fd9a9a4-8863-4a83-97a7-5a288ff0f5a6 Virtual Devices V2
──────────────────────────────────────────────────────────────────────────
11 a7d4ff68-2e8b-41f7-9be7-62bbe70f88f8 Web Requestor Multi v1.2
12 d58d8432-ea22-4d38-8300-2bd75fdf1358 Z-Wave Sensor
13 2cbf55e3-dbc2-48a2-8be5-4c3ce756b692 Z-Wave Switch
14 408981c2-91d4-4dfc-bbfb-84ca0205d993 Zigbee Contact
15 f82dec82-e5fa-487f-8f0f-22c3e4a8bd89 Zigbee Water Leak Sensor
──────────────────────────────────────────────────────────────────────────
? Select a driver. 6
connecting… connected
2023-01-05T18:01:20.616365667+00:00 TRACE MQTT Handler V1 Received event with handler capability
2023-01-05T18:01:20.622136375+00:00 INFO MQTT Handler V1 <Device: c174234b-857d-4e01-84e2-ec2d24b27c75 (MQTT Discovery)> received command: {“args”:{},“capability”:“partyvoice23922.refresh”,“command”:“push”,“component”:“main”,“positional_args”:{}}
2023-01-05T18:01:20.625643292+00:00 TRACE MQTT Handler V1 Found CapabilityCommandDispatcher handler in thisDriver
2023-01-05T18:01:20.628806708+00:00 INFO MQTT Handler V1 Refresh requested
2023-01-05T18:01:20.632012958+00:00 DEBUG MQTT Handler V1 Unsubscribing and disconnecting current client…
2023-01-05T18:01:20.635529583+00:00 DEBUG MQTT Handler V1 Unsubscribe failed with err: network connection is not opened
2023-01-05T18:01:20.638810042+00:00 DEBUG MQTT Handler V1 Disconnect failed with err: network connection is not opened
2023-01-05T18:01:20.648605292+00:00 INFO MQTT Handler V1 <Device: c174234b-857d-4e01-84e2-ec2d24b27c75 (MQTT Discovery)> emitting event: {“attribute_id”:“status”,“capability_id”:“partyvoice23922.status”,“component_id”:“main”,“state”:{“value”:“Connecting…”}}
2023-01-05T18:01:20.658358333+00:00 DEBUG MQTT Handler V1 MQTT Discovery device thread event handled
2023-01-05T18:01:20.674997292+00:00 ERROR MQTT Handler V1 MQTT client error: failed to open network connection: socket.connect failed: Connection refused (os error 111)
2023-01-05T18:01:20.678674875+00:00 INFO MQTT Handler V1 <Device: c174234b-857d-4e01-84e2-ec2d24b27c75 (MQTT Discovery)> emitting event: {“attribute_id”:“status”,“capability_id”:“partyvoice23922.status”,“component_id”:“main”,“state”:{“value”:“failed to open network connection: socket.connect failed: Connection refused (os error 111)”}}
2023-01-05T18:01:20.688859792+00:00 DEBUG MQTT Handler V1 MQTT run_sync returned error: failed to open network connection: socket.connect failed: Connection refused (os error 111)
2023-01-05T18:01:20.692864292+00:00 DEBUG MQTT Handler V1 client_reset_inprogress= true

I think the MQtt Contact fails too.

^Cwptracy@wptracy:~$ smartthings edge:drivers:logcat --hub-address=10.0.0.223 -t b2774eb9-0ce4-464f-…
──────────────────────────────────────────────────────────────────────────

Driver Id Name

──────────────────────────────────────────────────────────────────────────
1 e67c842f-49a5-4083-95f0-c8137ae3c2f6 Edge Counter Utility V1
2 6175f7c6-3a78-4625-a042-127a0e1c6f08 Edgebridge Monitor V1
3 7a236882-7479-4a21-b814-d40bbd53619f HTTP Devices V1
4 e8a1a0b7-32e4-4882-8d38-45a96ead543d LAN Motion Device Driver
5 e9469ad4-f363-42aa-b35e-16790312169a MQTT Devices V1
──────────────────────────────────────────────────────────────────────────
6 ab4ec49a-8392-4d98-81dd-3554c4a95370 MQTT Handler V1
7 8f390da7-c66d-4245-9ba9-e431f95c78ec Shelly Device Driver V1.6
8 782cce9b-dd7f-427f-993c-c9aec8dfb160 Shelly Flood MQTT V1
9 f3258c1d-b6e9-424d-8b3f-b1e8fe51c4ca Shelly Gen2 Device Driver V1.0
10 0fd9a9a4-8863-4a83-97a7-5a288ff0f5a6 Virtual Devices V2
──────────────────────────────────────────────────────────────────────────
11 a7d4ff68-2e8b-41f7-9be7-62bbe70f88f8 Web Requestor Multi v1.2
12 d58d8432-ea22-4d38-8300-2bd75fdf1358 Z-Wave Sensor
13 2cbf55e3-dbc2-48a2-8be5-4c3ce756b692 Z-Wave Switch
14 408981c2-91d4-4dfc-bbfb-84ca0205d993 Zigbee Contact
15 f82dec82-e5fa-487f-8f0f-22c3e4a8bd89 Zigbee Water Leak Sensor
──────────────────────────────────────────────────────────────────────────
? Select a driver. 5
connecting… connected
2023-01-05T18:52:56.434948260+00:00 TRACE MQTT Devices V1 Received event with handler capability
2023-01-05T18:52:56.439515309+00:00 INFO MQTT Devices V1 <Device: ca8ae6e6-ed92-494b-bce5-348220d23a05 (MQTT Contact)> received command: {“args”:{},“capability”:“partyvoice23922.refresh”,“command”:“push”,“component”:“main”,“positional_args”:{}}
2023-01-05T18:52:56.443088980+00:00 TRACE MQTT Devices V1 Found CapabilityCommandDispatcher handler in MQTT Devices
2023-01-05T18:52:56.446175561+00:00 INFO MQTT Devices V1 Refresh requested
2023-01-05T18:52:56.449434180+00:00 DEBUG MQTT Devices V1 Unsubscribing device from smartthings/contact
2023-01-05T18:52:56.455062240+00:00 DEBUG MQTT Devices V1 Unsubscribe failed with err: network connection is not opened
2023-01-05T18:52:56.458293873+00:00 DEBUG MQTT Devices V1 Already subscribed to topic smartthings/contact
2023-01-05T18:52:56.461736984+00:00 INFO MQTT Devices V1 <Device: ca8ae6e6-ed92-494b-bce5-348220d23a05 (MQTT Contact)> emitting event: {“attribute_id”:“status”,“capability_id”:“partyvoice23922.status”,“component_id”:“main”,“state”:{“value”:“Subscribed”}}
2023-01-05T18:52:56.471525588+00:00 DEBUG MQTT Devices V1 MQTT Contact device thread event handled
2023-01-05T18:52:59.704678036+00:00 INFO MQTT Devices V1 Attempting to reconnect to broker…
2023-01-05T18:52:59.720816795+00:00 ERROR MQTT Devices V1 MQTT client error: failed to open network connection: socket.connect failed: Connection refused (os error 111)
2023-01-05T18:52:59.723972300+00:00 WARN MQTT Devices V1 MQTT run_sync returned: failed to open network connection: socket.connect failed: Connection refused (os error 111)
2023-01-05T18:52:59.727477505+00:00 INFO MQTT Devices V1 <Device: c318f01c-51cb-4cb2-b144-1f76de136c7c (MQTT Device Creator V1b)> emitting event: {“attribute_id”:“status”,“capability_id”:“partyvoice23922.status”,“component_id”:“main”,“state”:{“value”:“Reconnecting…”}}
2023-01-05T18:52:59.739999658+00:00 INFO MQTT Devices V1 <Device: c318f01c-51cb-4cb2-b144-1f76de136c7c (MQTT Device Creator V1b)> emitting event: {“attribute_id”:“topiclist”,“capability_id”:“partyvoice23922.topiclist”,“component_id”:“main”,“state”:{“value”:" "},“visibility”:{“displayed”:false}}


You won’t need MQTT Handler or MQTT Devices drivers. And no, you don’t need to install the MQTT SmartApp for what you need. That’s a whole other thing and you don’t want to go down that path right now :slight_smile: .

Really the only driver you need for your Shelly battery devices is the Shelly Flood MQTT driver, so let’s focus on that one for now. It only supports Flood at the moment but I’m working on adding the H&T device as well.

Great that you have your MQTT broker installed. The next thing you should do is enable MQTT in your Shelly Flood device(s). You’ll do that through the Shelly app.

Once that is done, we can turn our attention to the Shelly Flood Edge driver. If it is installed to your hub, when you do an Add device / Scan for nearby devices, you should get a new device created called ‘Shelly MQTT Master’. Go into device Settings for that new device and configure your broker credentials and address. Then check the Status field on the device Controls screen to make sure it says ‘Connected to Broker’.

Now get ready to discover your Flood device(s). Since they are battery powered, you will have to press the button on the physical device to wake it up so it can be discovered. Then immediately start another Add device / Scan for nearby devices on your mobile app, and your flood device should get discovered and added as a new device. Be sure to go into Settings for these new devices and configure the temperature unit being sent by the device. On the Controls screen you should have updated fields and the bottom ‘Status’ field should say ‘Subscribed’.

Let me know if you run into any problems.

2 Likes

I couldn’t get the drivers to detect/discover so I deleted all of them:

  • MQTT Devices V1
    
  • MQTT Handler V1
    
  • Shelly Flood MQTT V1
    

I also couldn’t get Shelly Flood MQTT to keep the credentials of user nil and pwd nil.

I re-installed Shelly Flood MQTT and assigned Broker IP 10.0.0.3, user nil and pwd nil.

I googled for default mosquitto mqtt username password and found mosquitto.conf man page. It says:
The simplest option is to have no authentication at all. This is the default if no other options are given. Unauthenticated encrypted support is provided by using the certificate based SSL/TLS based options certfile and keyfile.

The Status says Reconnecting… , but the control screen says Connected. I never get the Connected to Broker on the control screen.

I press the push button on the flood device and the light comes on. I scan for nearby devices but it finds nothing.

Below is the logcat, Attempting to reconnect to broker, failed to open network connection . socket.connect failed. refused.

pi@raspberrypi:~ $ ps -ef |grep mosqu
mosquit+ 6117 1 0 Jan05 ? 00:00:34 /usr/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf
pi 9089 8966 0 08:52 pts/1 00:00:00 grep --color=auto mosqu

pi@raspberrypi:~ $ sudo systemctl status mosquitto.service
● mosquitto.service - Mosquitto MQTT Broker
Loaded: loaded (/lib/systemd/system/mosquitto.service; enabled; vendor pre>
Active: active (running) since Thu 2023-01-05 09:56:09 MST; 22h ago
Docs: man:mosquitto.conf(5)
man:mosquitto(8)
Main PID: 6117 (mosquitto)
Tasks: 1 (limit: 4915)
CPU: 34.747s
CGroup: /system.slice/mosquitto.service
└─6117 /usr/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf

Jan 05 09:56:09 raspberrypi systemd[1]: Starting Mosquitto MQTT Broker…
Jan 05 09:56:09 raspberrypi systemd[1]: Started Mosquitto MQTT Broker.
lines 1-13/13 (END)

wptracy@wptracy:~$ smartthings edge:drivers:logcat --hub-address=10.0.0.223 -t b2774eb9-0ce4-464f-…
──────────────────────────────────────────────────────────────────────────

Driver Id Name

──────────────────────────────────────────────────────────────────────────
1 e67c842f-49a5-4083-95f0-c8137ae3c2f6 Edge Counter Utility V1
2 6175f7c6-3a78-4625-a042-127a0e1c6f08 Edgebridge Monitor V1
3 7a236882-7479-4a21-b814-d40bbd53619f HTTP Devices V1
4 e8a1a0b7-32e4-4882-8d38-45a96ead543d LAN Motion Device Driver
5 8f390da7-c66d-4245-9ba9-e431f95c78ec Shelly Device Driver V1.6
──────────────────────────────────────────────────────────────────────────
6 782cce9b-dd7f-427f-993c-c9aec8dfb160 Shelly Flood MQTT V1
7 f3258c1d-b6e9-424d-8b3f-b1e8fe51c4ca Shelly Gen2 Device Driver V1.0
8 0fd9a9a4-8863-4a83-97a7-5a288ff0f5a6 Virtual Devices V2
9 a7d4ff68-2e8b-41f7-9be7-62bbe70f88f8 Web Requestor Multi v1.2
10 d58d8432-ea22-4d38-8300-2bd75fdf1358 Z-Wave Sensor
──────────────────────────────────────────────────────────────────────────
11 2cbf55e3-dbc2-48a2-8be5-4c3ce756b692 Z-Wave Switch
12 408981c2-91d4-4dfc-bbfb-84ca0205d993 Zigbee Contact
13 f82dec82-e5fa-487f-8f0f-22c3e4a8bd89 Zigbee Water Leak Sensor
──────────────────────────────────────────────────────────────────────────
? Select a driver. 6
connecting… connected
2023-01-06T16:01:04.125603530+00:00 INFO Shelly Flood MQTT V1 Attempting to reconnect to broker…
2023-01-06T16:01:04.201639072+00:00 ERROR Shelly Flood MQTT V1 MQTT client error: failed to open network connection: socket.connect failed: Connection refused (os error 111)
2023-01-06T16:01:04.204941405+00:00 WARN Shelly Flood MQTT V1 MQTT run_sync returned: failed to open network connection: socket.connect failed: Connection refused (os error 111)
2023-01-06T16:01:04.208575780+00:00 INFO Shelly Flood MQTT V1 <Device: d4272d16-f4a2-4a20-943c-247e34737357 (Shelly MQTT Master)> emitting event: {“attribute_id”:“status”,“capability_id”:“partyvoice23922.status”,“component_id”:“main”,“state”:{“value”:“Reconnecting…”}}
2023-01-06T16:01:19.225774454+00:00 INFO Shelly Flood MQTT V1 Attempting to reconnect to broker…
2023-01-06T16:01:19.299467537+00:00 ERROR Shelly Flood MQTT V1 MQTT client error: failed to open network connection: socket.connect failed: Connection refused (os error 111)
2023-01-06T16:01:19.302648871+00:00 WARN Shelly Flood MQTT V1 MQTT run_sync returned: failed to open network connection: socket.connect failed: Connection refused (os error 111)
2023-01-06T16:01:19.306162537+00:00 INFO Shelly Flood MQTT V1 <Device: d4272d16-f4a2-4a20-943c-247e34737357 (Shelly MQTT Master)> emitting event: {“attribute_id”:“status”,“capability_id”:“partyvoice23922.status”,“component_id”:“main”,“state”:{“value”:“Reconnecting…”}}

Port security.
Connection type Protocol Port number
Nonsecure* MQTT and HTTP 1883 or 80
Secure (TLS) MQTT and HTTPS 8883 or 443

from my ubuntu PC to Rpi which has mosquito running on it

wptracy@wptracy:~$ telnet 10.0.0.3 1883
Trying 10.0.0.3…
telnet: Unable to connect to remote host: Connection refused
wptracy@wptracy:~$ telnet 10.0.0.3 8883
Trying 10.0.0.3…
telnet: Unable to connect to remote host: Connection refused
wptracy@wptracy:~$ telnet 10.0.0.3 80
Trying 10.0.0.3…
Connected to 10.0.0.3.
Escape character is ‘^]’.
^]
telnet> quit
Connection closed.
wptracy@wptracy:~$ telnet 10.0.0.3 443
Trying 10.0.0.3…
telnet: Unable to connect to remote host: Connection refused
wptracy@wptracy:~$

pi@raspberrypi:/etc/mosquitto $ sudo su
root@raspberrypi:/etc/mosquitto# cd /
root@raspberrypi:/# find . -name mosquitto.conf -print
./usr/share/doc/mosquitto/examples/mosquitto.conf
find: ‘./run/user/1000/gvfs’: Permission denied
./etc/mosquitto/mosquitto.conf
root@raspberrypi:/# cat /etc/mosquitto/mosquitto.conf
Place your local configuration in /etc/mosquitto/conf.d/

A full description of the configuration file is at
/usr/share/doc/mosquitto/examples/mosquitto.conf.example

pid_file /run/mosquitto/mosquitto.pid

persistence true
persistence_location /var/lib/mosquitto/

log_dest file /var/log/mosquitto/mosquitto.log

include_dir /etc/mosquitto/conf.d

pi@raspberrypi:~ $ sudo netstat -tlnp | grep 1883
tcp 0 0 0.0.0.0:1883 0.0.0.0:* LISTEN 16793/mosquitto
tcp6 0 0 :::1883 :::* LISTEN 16793/mosquitto
pi@raspberrypi:~ $ sudo lsof -i:1883
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
mosquitto 16793 mosquitto 5u IPv4 81648 0t0 TCP *:1883 (LISTEN)
mosquitto 16793 mosquitto 6u IPv6 81649 0t0 TCP *:1883 (LISTEN)
pi@raspberrypi:~ $

pi@raspberrypi:~ $ sudo iptables --list
Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination
pi@raspberrypi:~ $

Can you show me a screen snapshot of your broker config options?

It should be fine not to have a userid and password configured. I think the default Mosquitto install does not require it.

I think pi-hole is goofing this up.

I have another Rpi I can install mosquitto on. I’ll try it.

I couldn’t telnet to Rpi port 1883 until I stopped pihole-FTL.service

pi@raspberrypi:~ $ sudo systemctl stop pihole-FTL.service
pi@raspberrypi:~ $ sudo systemctl restart mosquitto.service
pi@raspberrypi:~ $ sudo systemctl restart pihole-FTL.service
pi@raspberrypi:~ $

wptracy@wptracy:~$ telnet 10.0.0.3 1883
Trying 10.0.0.3…
Connected to 10.0.0.3.
Escape character is ‘^]’.
Connection closed by foreign host.
wptracy@wptracy:~$ telnet 10.0.0.3 1883
Trying 10.0.0.3…
telnet: Unable to connect to remote host: Connection refused
wptracy@wptracy:~$

But the app is still not connecting.

pi@raspberrypi:~ $ pihole disable
[i] Disabling blocking
[✓] Reloading DNS lists
[✓] Pi-hole Disabled
pi@raspberrypi:~ $ service pihole-FTL stop
pi@raspberrypi:~ $ pihole status
[✗] DNS service is NOT running
[✗] DNS service is NOT running
pi@raspberrypi:~ $