Python Plugin: Shelly MQTT

Python and python framework

Moderator: leecollings

marmachine
Posts: 128
Joined: Saturday 26 March 2016 10:19
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.4834
Location: Netherlands
Contact:

Re: Python Plugin: Shelly MQTT

Post by marmachine »

darrepac wrote: Friday 26 February 2021 22:48 Could be a nice new feature to be able to update all shelly with the plugin as is doing the HA plugin: https://community.home-assistant.io/t/m ... are/284474
In the hw settings we could which day/hour of the week, we want to update
Agree, however you'd want this controlled, instead of updating all hardware with a single button press...
I'm not familiar with HA, but was thinking to build this myself including detection and e-mail notification when updates available.
Again, i don't want to push updates to all Shelly equipment, but prefer to be able to select one single, a group, or all devices.
darrepac
Posts: 133
Joined: Tuesday 04 February 2014 21:31
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Isère, France
Contact:

Re: Python Plugin: Shelly MQTT

Post by darrepac »

marmachine wrote: Again, i don't want to push updates to all Shelly equipment, but prefer to be able to select one single, a group, or all devices.
Make sense!
extremeaudio
Posts: 47
Joined: Tuesday 24 November 2020 17:57
Target OS: Linux
Domoticz version:
Contact:

Re: Python Plugin: Shelly MQTT

Post by extremeaudio »

Hi, so I installed the MQTT broker, configured my Shelly 1PM and also added the python plugin and added everything.

In the log I can see Shelly connected, subscribed etc but the devices are not being created. Log as below. What should I try?
Spoiler: show

Code: Select all

2021-03-03 16:28:47.426 Status: Domoticz V2020.2 (c)2012-2020 GizMoCuz
2021-03-03 16:28:47.427 Status: Build Hash: b63341bc0, Date: 2020-04-26 13:47:55
2021-03-03 16:28:47.427 Status: Startup Path: /home/pi/domoticz/
2021-03-03 16:28:47.427 Status: Startup delay... waiting 15 seconds...
2021-03-03 16:29:02.462 Sunrise: 06:31:00 SunSet: 17:36:00
2021-03-03 16:29:02.462 Day length: 11:05:00 Sun at south: 12:04:00
2021-03-03 16:29:02.462 Civil twilight start: 05:58:00 Civil twilight end: 18:09:00
2021-03-03 16:29:02.462 Nautical twilight start: 05:20:00 Nautical twilight end: 18:47:00
2021-03-03 16:29:02.462 Astronomical twilight start: 04:42:00 Astronomical twilight end: 19:26:00
2021-03-03 16:29:02.555 Active notification Subsystems: fcm (1/13)
2021-03-03 16:29:02.568 Starting shared server on: :::6144
2021-03-03 16:29:02.545 Status: PluginSystem: Started, Python version '3.7.3'.
2021-03-03 16:29:02.557 Status: WebServer(HTTP) started on address: :: with port 8082
2021-03-03 16:29:02.564 Status: WebServer(SSL) started on address: :: with port 443
2021-03-03 16:29:02.569 Status: RxQueue: queue worker started...
2021-03-03 16:29:02.568 Status: TCPServer: shared server started...
2021-03-03 16:29:04.684 Kodi: (iBox) Starting thread.
2021-03-03 16:29:04.785 Kodi: Starting I/O service thread.
2021-03-03 16:29:04.570 Status: Hardware Monitor: Started
2021-03-03 16:29:04.583 Status: (Broadlink RM4 Pro) Started.
2021-03-03 16:29:04.583 Status: (Sony TV Bedroom) Started.
2021-03-03 16:29:04.583 Status: (Denon Bedroom) Started.
2021-03-03 16:29:04.583 Status: WOL: Started
2021-03-03 16:29:04.583 Status: Kodi: Started
2021-03-03 16:29:04.584 Status: (Shelly) Started.
2021-03-03 16:29:04.584 Status: NotificationSystem: thread started...
2021-03-03 16:29:04.584 Status: EventSystem: reset all events...
2021-03-03 16:29:04.585 Status: EventSystem: reset all device statuses...
2021-03-03 16:29:04.764 Status: Python EventSystem: Initalizing event module.
2021-03-03 16:29:04.764 Status: EventSystem: Started
2021-03-03 16:29:04.765 Status: EventSystem: Queue thread started...
2021-03-03 16:29:04.965 Status: PluginSystem: Entering work loop.
2021-03-03 16:29:05.687 Kodi: (iBox) Connected to '192.168.1.52:9090'.
2021-03-03 16:29:05.584 Status: MQTT: Connecting to 127.0.0.1:1883
2021-03-03 16:29:05.785 Status: MQTT: connected to: 127.0.0.1:1883
2021-03-03 16:29:05.986 Status: MQTT: Subscribed
2021-03-03 16:29:06.332 Status: (Broadlink RM4 Pro) Entering work loop.
2021-03-03 16:29:06.333 Status: (Broadlink RM4 Pro) Initialized version 1.6.3, author 'zak45'
2021-03-03 16:29:06.721 Status: (Sony TV Bedroom) Entering work loop.
2021-03-03 16:29:06.722 Status: (Sony TV Bedroom) Initialized version 1.2, author 'G3rard'
2021-03-03 16:29:06.853 Status: (Denon Bedroom) Entering work loop.
2021-03-03 16:29:06.854 Status: (Denon Bedroom) Initialized version 3.3.4, author 'dnpwwo,bvr'
2021-03-03 16:29:06.992 Status: (Shelly) Entering work loop.
2021-03-03 16:29:06.993 Status: (Shelly) Initialized version 0.5.7
2021-03-03 16:29:07.001 (Broadlink RM4 Pro) lang file : /home/pi/domoticz/plugins/Broadlink/lng/en_en.lng
2021-03-03 16:29:07.002 (Broadlink RM4 Pro) Language loaded for : en
2021-03-03 16:29:07.003 (Broadlink RM4 Pro) Listen on BROWebServer - Port: 9000
2021-03-03 16:29:07.115 (Broadlink RM4 Pro) Plugin Device count start on : 9
2021-03-03 16:29:07.127 (Broadlink RM4 Pro) Command line file updated: /home/pi/domoticz/plugins/Broadlink/log/6RM24.txt
2021-03-03 16:29:07.127 (Broadlink RM4 Pro) Connecting to: 192.168.1.54 : A043B018FCA5
2021-03-03 16:29:07.162 (Broadlink RM4 Pro) Connected to Broadlink device: 192.168.1.54 RM4
2021-03-03 16:29:07.171 (Broadlink RM4 Pro) Admin html file created: /home/pi/domoticz/www/templates/Broadlink-RM24-6.html
2021-03-03 16:29:07.210 (Shelly) New hardware creation enabled
2021-03-03 16:29:07.262 (Shelly) Connected to MQTT Server: 127.0.0.1:1883
2021-03-03 16:29:12.644 (Broadlink RM4 Pro) Update 1:'END of remotePlugin' (Broadlink RM4 Pro - RM24-Status)
2021-03-03 16:29:12.660 (Broadlink RM4 Pro) Update 1:'On' (Broadlink RM4 Pro - RM24-Status)
2021-03-03 16:29:16.921 (Denon Bedroom) Update 1:'On' (Denon Bedroom - Power)
2021-03-03 16:29:16.941 (Denon Bedroom) Update 50:'50' (Denon Bedroom - Main Zone)
2021-03-03 16:29:16.959 (Denon Bedroom) Update 2:'49' (Denon Bedroom - Main Volume)
2021-03-03 16:29:16.984 (Denon Bedroom) Update 20:'20' (Denon Bedroom - Zone 2)
2021-03-03 16:29:17.003 (Denon Bedroom) Update 0:'22' (Denon Bedroom - Volume 2)
2021-03-03 16:29:17.023 (Denon Bedroom) Update 40:'40' (Denon Bedroom - Tuner)
2021-03-03 16:29:17.074 (Denon Bedroom) Connecting
2021-03-03 16:29:17.074 (Denon Bedroom) Connected successfully to: 192.168.1.51:23
2021-03-03 16:29:17.144 (Denon Bedroom) Update 1:'On' (Denon Bedroom - Power)
2021-03-03 16:29:17.162 (Denon Bedroom) Update 50:'50' (Denon Bedroom - Main Zone)
2021-03-03 16:29:17.183 (Denon Bedroom) Update 2:'49' (Denon Bedroom - Main Volume)
2021-03-03 16:29:17.203 (Denon Bedroom) Update 20:'20' (Denon Bedroom - Zone 2)
2021-03-03 16:29:17.227 (Denon Bedroom) Update 0:'22' (Denon Bedroom - Volume 2)
2021-03-03 16:29:17.247 (Denon Bedroom) Update 40:'40' (Denon Bedroom - Tuner)
2021-03-03 16:29:35.292 Kodi: Restarting I/O service thread.
2021-03-03 16:29:40.056 InfluxLink: value Percentage,idx=1,name=CPU_Usage value=26.72
2021-03-03 16:29:49.624 InfluxLink: value Temperature,idx=2,name=Internal-Temperature value=62.3
2021-03-03 16:30:03.673 Status: Incoming connection from: 127.0.0.1
2021-03-03 16:30:09.753 InfluxLink: value Percentage,idx=1,name=CPU_Usage value=26.58
2021-03-03 16:30:16.835 (Broadlink RM4 Pro) Connected to Broadlink device: 192.168.1.54 RM4
2021-03-03 16:30:39.819 InfluxLink: value Percentage,idx=1,name=CPU_Usage value=27.31
2021-03-03 16:31:09.892 InfluxLink: value Percentage,idx=1,name=CPU_Usage value=26.24
2021-03-03 16:31:39.962 InfluxLink: value Percentage,idx=1,name=CPU_Usage value=26.05
2021-03-03 16:32:10.036 InfluxLink: value Temperature,idx=2,name=Internal-Temperature value=62.8
2021-03-03 16:32:10.036 InfluxLink: value Percentage,idx=1,name=CPU_Usage value=25.9
2021-03-03 16:32:40.141 InfluxLink: value Percentage,idx=1,name=CPU_Usage value=25.78
2021-03-03 16:33:09.726 InfluxLink: value Percentage,idx=1,name=CPU_Usage value=26.43
2021-03-03 16:33:19.908 InfluxLink: value Temperature,idx=2,name=Internal-Temperature value=63.4
2021-03-03 16:33:40.482 InfluxLink: value Percentage,idx=1,name=CPU_Usage value=26.62
2021-03-03 16:34:10.213 InfluxLink: value Percentage,idx=1,name=CPU_Usage value=25.16
2021-03-03 16:34:29.818 InfluxLink: value Temperature,idx=2,name=Internal-Temperature value=62.3
2021-03-03 16:34:39.956 InfluxLink: value Percentage,idx=1,name=CPU_Usage value=26.31
2021-03-03 16:35:10.080 InfluxLink: value Percentage,idx=1,name=CPU_Usage value=26.18
2021-03-03 16:35:18.609 (Broadlink RM4 Pro) Connected to Broadlink device: 192.168.1.54 RM4
2021-03-03 16:35:40.155 InfluxLink: value Percentage,idx=1,name=CPU_Usage value=26.55
2021-03-03 16:36:07.742 Status: MQTT: Worker stopped...
2021-03-03 16:36:08.743 Status: MQTT: Connecting to 192.168.1.53:1883
2021-03-03 16:36:08.744 Error: MQTT: Failed to start, return code: 14 (Check IP/Port)
2021-03-03 16:36:10.305 InfluxLink: value Percentage,idx=1,name=CPU_Usage value=25.62
2021-03-03 16:36:29.722 (Shelly) New hardware creation enabled
2021-03-03 16:36:29.343 Status: (Shelly) Stop directive received.
2021-03-03 16:36:29.343 Status: (Shelly) Exiting work loop.
2021-03-03 16:36:29.544 Status: (Shelly) Stopping threads.
2021-03-03 16:36:29.544 Status: (Shelly) Stopped.
2021-03-03 16:36:29.544 Status: (Shelly) Started.
2021-03-03 16:36:29.718 Status: (Shelly) Entering work loop.
2021-03-03 16:36:29.719 Status: (Shelly) Initialized version 0.5.7
2021-03-03 16:36:29.375 Error: (Shelly) Disconnected from MQTT Server: 127.0.0.1:1883
2021-03-03 16:36:29.773 Error: (Shelly) Failed to connect to: 192.168.1.53:1883, Description: Connection refused
2021-03-03 16:36:29.773 Error: (Shelly) Disconnected from MQTT Server: 192.168.1.53:1883
2021-03-03 16:36:37.775 Status: MQTT: Connecting to 192.168.1.53:1883
2021-03-03 16:36:37.776 Error: MQTT: Failed to start, return code: 14 (Check IP/Port)
2021-03-03 16:36:39.877 InfluxLink: value Percentage,idx=1,name=CPU_Usage value=26.27
2021-03-03 16:36:39.745 Error: (Shelly) Failed to connect to: 192.168.1.53:1883, Description: Connection refused
2021-03-03 16:36:39.745 Error: (Shelly) Disconnected from MQTT Server: 192.168.1.53:1883
2021-03-03 16:36:49.943 InfluxLink: value Temperature,idx=2,name=Internal-Temperature value=62.8
2021-03-03 16:36:49.730 Error: (Shelly) Failed to connect to: 192.168.1.53:1883, Description: Connection refused
2021-03-03 16:36:49.731 Error: (Shelly) Disconnected from MQTT Server: 192.168.1.53:1883
2021-03-03 16:36:59.759 Error: (Shelly) Failed to connect to: 192.168.1.53:1883, Description: Connection refused
2021-03-03 16:36:59.759 Error: (Shelly) Disconnected from MQTT Server: 192.168.1.53:1883
2021-03-03 16:37:07.810 Status: MQTT: Connecting to 192.168.1.53:1883
2021-03-03 16:37:07.810 Error: MQTT: Failed to start, return code: 14 (Check IP/Port)
2021-03-03 16:37:09.732 Error: (Shelly) Failed to connect to: 192.168.1.53:1883, Description: Connection refused
2021-03-03 16:37:09.732 Error: (Shelly) Disconnected from MQTT Server: 192.168.1.53:1883
2021-03-03 16:37:10.053 InfluxLink: value Percentage,idx=1,name=CPU_Usage value=26.12
2021-03-03 16:37:19.755 Error: (Shelly) Failed to connect to: 192.168.1.53:1883, Description: Connection refused
2021-03-03 16:37:19.755 Error: (Shelly) Disconnected from MQTT Server: 192.168.1.53:1883
2021-03-03 16:37:29.785 Error: (Shelly) Failed to connect to: 192.168.1.53:1883, Description: Connection refused
2021-03-03 16:37:29.785 Error: (Shelly) Disconnected from MQTT Server: 192.168.1.53:1883
2021-03-03 16:37:37.845 Status: MQTT: Connecting to 192.168.1.53:1883
2021-03-03 16:37:37.845 Error: MQTT: Failed to start, return code: 14 (Check IP/Port)
2021-03-03 16:37:39.807 Error: (Shelly) Failed to connect to: 192.168.1.53:1883, Description: Connection refused
2021-03-03 16:37:39.808 Error: (Shelly) Disconnected from MQTT Server: 192.168.1.53:1883
2021-03-03 16:37:40.118 InfluxLink: value Percentage,idx=1,name=CPU_Usage value=26.53
2021-03-03 16:37:49.831 Error: (Shelly) Failed to connect to: 192.168.1.53:1883, Description: Connection refused
2021-03-03 16:37:49.831 Error: (Shelly) Disconnected from MQTT Server: 192.168.1.53:1883
2021-03-03 16:37:59.808 Error: (Shelly) Failed to connect to: 192.168.1.53:1883, Description: Connection refused
2021-03-03 16:37:59.809 Error: (Shelly) Disconnected from MQTT Server: 192.168.1.53:1883
2021-03-03 16:38:00.265 InfluxLink: value Temperature,idx=2,name=Internal-Temperature value=63.4
2021-03-03 16:38:07.881 Status: MQTT: Connecting to 192.168.1.53:1883
2021-03-03 16:38:07.882 Error: MQTT: Failed to start, return code: 14 (Check IP/Port)
2021-03-03 16:38:09.835 Error: (Shelly) Failed to connect to: 192.168.1.53:1883, Description: Connection refused
2021-03-03 16:38:09.835 Error: (Shelly) Disconnected from MQTT Server: 192.168.1.53:1883
2021-03-03 16:38:10.329 InfluxLink: value Percentage,idx=1,name=CPU_Usage value=25.91
2021-03-03 16:38:19.810 Error: (Shelly) Failed to connect to: 192.168.1.53:1883, Description: Connection refused
2021-03-03 16:38:19.810 Error: (Shelly) Disconnected from MQTT Server: 192.168.1.53:1883
2021-03-03 16:38:20.563 (Shelly) New hardware creation enabled
2021-03-03 16:38:20.614 (Shelly) Connected to MQTT Server: localhost:1883
2021-03-03 16:38:20.184 Status: (Shelly) Stop directive received.
2021-03-03 16:38:20.184 Status: (Shelly) Exiting work loop.
2021-03-03 16:38:20.384 Status: (Shelly) Stopping threads.
2021-03-03 16:38:20.384 Status: (Shelly) Stopped.
2021-03-03 16:38:20.384 Status: (Shelly) Started.
2021-03-03 16:38:20.559 Status: (Shelly) Entering work loop.
2021-03-03 16:38:20.559 Status: (Shelly) Initialized version 0.5.7
2021-03-03 16:38:21.741 (Shelly) New hardware creation enabled
2021-03-03 16:38:21.793 (Shelly) Connected to MQTT Server: localhost:1883
2021-03-03 16:38:21.360 Status: (Shelly) Stop directive received.
2021-03-03 16:38:21.360 Status: (Shelly) Exiting work loop.
2021-03-03 16:38:21.561 Status: (Shelly) Stopping threads.
2021-03-03 16:38:21.561 Status: (Shelly) Stopped.
2021-03-03 16:38:21.561 Status: (Shelly) Started.
2021-03-03 16:38:21.738 Status: (Shelly) Entering work loop.
2021-03-03 16:38:21.739 Status: (Shelly) Initialized version 0.5.7
2021-03-03 16:38:21.417 Error: (Shelly) Disconnected from MQTT Server: localhost:1883
2021-03-03 16:38:37.914 Status: MQTT: Connecting to 192.168.1.53:1883
2021-03-03 16:38:37.915 Error: MQTT: Failed to start, return code: 14 (Check IP/Port)
2021-03-03 16:38:40.414 InfluxLink: value Percentage,idx=1,name=CPU_Usage value=26.72
2021-03-03 16:38:55.038 Status: MQTT: Worker stopped...
2021-03-03 16:38:56.050 Status: MQTT: Connecting to localhost:1883
2021-03-03 16:38:56.251 Status: MQTT: connected to: localhost:1883
2021-03-03 16:38:56.452 Status: MQTT: Subscribed
salopette
Posts: 187
Joined: Tuesday 07 March 2017 21:03
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Germany
Contact:

Re: Python Plugin: Shelly MQTT

Post by salopette »

(Shelly) Failed to connect to: 192.168.1.53:1883, Description: Connection refused
2021-03-03 16:37:09.732 Error: (Shelly) Disconnected from MQTT Server: 192.168.1.53:1883


2021-03-03 16:29:05.584 Status: MQTT: Connecting to 127.0.0.1:1883
2021-03-03 16:29:05.785 Status: MQTT: connected to: 127.0.0.1:1883
2021-03-03 16:29:05.986 Status: MQTT: Subscribed


something is wrong with your mqtt settings!
What kind of address did you have on shelly?
extremeaudio
Posts: 47
Joined: Tuesday 24 November 2020 17:57
Target OS: Linux
Domoticz version:
Contact:

Re: Python Plugin: Shelly MQTT

Post by extremeaudio »

The shelly is at 192.168.1.56

My domoticz server is 192.168.1.53

So from the Shelly 1 PM settings, I have enabled MQTT, set the MQTT server settings to 192.168.1.53:1883
In MQTT Client Gateway with Lan Interface I have set the IP address to 127.0.0.1 since the gateway is installed on the domoticz server and port to 1883
In the Shelly MQTT plugin too I have the same IP address which is 127.0.0.1 and 1883

In the username section of the MQTT client the field came filled as "admin". This is because my domoticz is from the preconfigured image called smarticz, and the documentation doesnt say what username and password they have chosen, I just assumed. So I just chose a password and proceeded and saved the settings. I used the same username and password in the Shelly MQTT settings too. I am not sure if the username and password are correct, or how to check or rectify if wrong. Would appreciate any help. Thank you.

I dont mind if someone can guide me how to remove the MQTT gateway completely so that I can follow the standard procedure for re installing it with the correct username and password created along the way.
salopette
Posts: 187
Joined: Tuesday 07 March 2017 21:03
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Germany
Contact:

Re: Python Plugin: Shelly MQTT

Post by salopette »

I don't think Shelly can do anything with local IP from Mqtt-Domoticz.
In Mqtt-Domoticz hardware configuration you should better enter the IP where the Mqtt broker is running. So 192.168.1.53.

And in the Shelly then also the IP 192.168.1.53
extremeaudio
Posts: 47
Joined: Tuesday 24 November 2020 17:57
Target OS: Linux
Domoticz version:
Contact:

Re: Python Plugin: Shelly MQTT

Post by extremeaudio »

So you mean to say I should enter 192.168.1.53 (Domoticz server address) on the MQTT GATEWAY hardware page instead of 127.0.0.1 ? If I do that it says disconnected in the log if I remember correctly.

In shelly relay web interface I have already entered 192.168.1.53 obviously.
salopette
Posts: 187
Joined: Tuesday 07 March 2017 21:03
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Germany
Contact:

Re: Python Plugin: Shelly MQTT

Post by salopette »

if the Mqtt server is running on the same machine as Domoticz, you should do that.
I have also made the setting for myself.
Attachments
sshot-2.jpg
sshot-2.jpg (71.58 KiB) Viewed 3772 times
sshot-1.jpg
sshot-1.jpg (144.63 KiB) Viewed 3772 times
extremeaudio
Posts: 47
Joined: Tuesday 24 November 2020 17:57
Target OS: Linux
Domoticz version:
Contact:

Re: Python Plugin: Shelly MQTT

Post by extremeaudio »

But on my build the very instant I change the IP address to the machine IP address the log shows this..

Code: Select all

2021-03-05 13:27:26.552 Status: MQTT: Worker stopped...
2021-03-05 13:27:27.554 Status: MQTT: Connecting to 192.168.1.53:1883
2021-03-05 13:27:27.555 Error: MQTT: Failed to start, return code: 14 (Check IP/Port)
2021-03-05 13:28:26.628 Error: MQTT: Failed to start, return code: 14 (Check IP/Port)
and if I change to 127.0.0.1 it shows

Code: Select all

2021-03-05 13:20:39.724 Status: MQTT: Worker stopped...
2021-03-05 13:20:40.022 Status: MQTT: Worker stopped...
2021-03-05 13:20:41.034 Status: MQTT: Connecting to 127.0.0.1:1883
2021-03-05 13:20:41.235 Status: MQTT: connected to: 127.0.0.1:1883
2021-03-05 13:20:41.435 Status: MQTT: Subscribed
But in either case, the shelly device does not show up in Devices
salopette
Posts: 187
Joined: Tuesday 07 March 2017 21:03
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Germany
Contact:

Re: Python Plugin: Shelly MQTT

Post by salopette »

Ok, what IP did you enter in the Shelly-Domoticz plugin? Not in the Shelly itself.
Attachments
sshot-1.jpg
sshot-1.jpg (138.3 KiB) Viewed 3758 times
extremeaudio
Posts: 47
Joined: Tuesday 24 November 2020 17:57
Target OS: Linux
Domoticz version:
Contact:

Re: Python Plugin: Shelly MQTT

Post by extremeaudio »

I have tried entering both IPs in the Shelly MQTT plugin IP field.127.0.0.1 as well as the actual IP address. But the device has never appeared.
salopette
Posts: 187
Joined: Tuesday 07 March 2017 21:03
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Germany
Contact:

Re: Python Plugin: Shelly MQTT

Post by salopette »

The Ip of Mqtt Broker has to be in there, i.e. that of the Domoticz if it is running on the same machine.
lwolf
Posts: 216
Joined: Saturday 10 November 2018 18:29
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Hungary
Contact:

Re: Python Plugin: Shelly MQTT

Post by lwolf »

extremeaudio wrote: Friday 05 March 2021 13:29 But on my build the very instant I change the IP address to the machine IP address the log shows this..

Code: Select all

2021-03-05 13:27:26.552 Status: MQTT: Worker stopped...
2021-03-05 13:27:27.554 Status: MQTT: Connecting to 192.168.1.53:1883
2021-03-05 13:27:27.555 Error: MQTT: Failed to start, return code: 14 (Check IP/Port)
2021-03-05 13:28:26.628 Error: MQTT: Failed to start, return code: 14 (Check IP/Port)
and if I change to 127.0.0.1 it shows

Code: Select all

2021-03-05 13:20:39.724 Status: MQTT: Worker stopped...
2021-03-05 13:20:40.022 Status: MQTT: Worker stopped...
2021-03-05 13:20:41.034 Status: MQTT: Connecting to 127.0.0.1:1883
2021-03-05 13:20:41.235 Status: MQTT: connected to: 127.0.0.1:1883
2021-03-05 13:20:41.435 Status: MQTT: Subscribed
But in either case, the shelly device does not show up in Devices
If something is available on the localhost / 127.0.0.1 but not available from the outside world, it is either a firewall issue, or the mqtt daemon is not binded to the correct network card. It is not Domoticz, neither Shelly plugin related error, it is standard Linux network and administrator know-how.
marmachine
Posts: 128
Joined: Saturday 26 March 2016 10:19
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.4834
Location: Netherlands
Contact:

Re: Python Plugin: Shelly MQTT

Post by marmachine »

Mine worked fine until mosquitto v2.0.0 was introduced through a update/upgrade command.
Took me couple of hours to discover it was only MQTT that was failing, then someone shared this link:

viewtopic.php?f=28&t=35706
chal
Posts: 3
Joined: Monday 02 October 2017 14:08
Target OS: -
Domoticz version:
Contact:

Re: Python Plugin: Shelly MQTT

Post by chal »

First of all thank you for this great plugin.

Everything is working fine, but when i restart a shelly energy device i get a negative reading:
Unbenannt.PNG
Unbenannt.PNG (16.96 KiB) Viewed 3533 times
is there anything i can do?
Unbenann8t.PNG
Unbenann8t.PNG (41 KiB) Viewed 3533 times
Thank you!
BuderKjell
Posts: 12
Joined: Monday 11 January 2016 19:21
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.1
Location: Stockholm Sweden
Contact:

Re: Python Plugin: Shelly MQTT

Post by BuderKjell »

I have used the plugin for some months and I am very satisfied, and of course I have sent a sponsoring.
The only thing that is not working for me is Shelly UNI ADC, when accessing the device by IP I can read the ADC value but it is not shown in Domoticz. I have enabled New Devices.
Any ideas?
User avatar
waltervl
Posts: 5148
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Python Plugin: Shelly MQTT

Post by waltervl »

BuderKjell wrote: Wednesday 26 May 2021 20:47 I have used the plugin for some months and I am very satisfied, and of course I have sent a sponsoring.
The only thing that is not working for me is Shelly UNI ADC, when accessing the device by IP I can read the ADC value but it is not shown in Domoticz. I have enabled New Devices.
Any ideas?
See https://github.com/enesbcs/Shelly_MQTT/issues/76
From firmware 20201202-141748/v1.9.3-rc3@50c6ab57
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
BuderKjell
Posts: 12
Joined: Monday 11 January 2016 19:21
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.1
Location: Stockholm Sweden
Contact:

Re: Python Plugin: Shelly MQTT

Post by BuderKjell »

Thank you. Uni is running 1.10.4.
I have about 40 Shellies Running without problems, two installation, both with Domoticz as controller.
New Devices enabled.
Suddenly it was there under Utility.
Domoticz updates VALUES faster then WebUI, about one second.
Very satisfied with that.
In1 Will connect a PIR, IN2 Will connect a door contact, tha same with ADC via a battery. A couple of temp sensor and another part of my barn, on the countryside, in the forrest, is protected.
No problems so far with my shellies, I see in the English and German support groups lot of people with offline problems.
Not on my installations.
Happy!
hendryman
Posts: 9
Joined: Sunday 22 October 2017 16:20
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Mosquitto Daemon Config Problem

Post by hendryman »

Amazing plugin! Thanks so much! Unfortunately, I have a Mosquitto config problem that prevents me from using this plugin smoothly.

Mosquitto > 2.0 has to be explicitly told to accept connections from other machines than the one Moisquitto runs on. I've created a conf file at

Code: Select all

/etc/mosquitto/conf.d/mosquitto.conf
with these two entries:

Code: Select all

listener 1883 0.0.0.0
allow_anonymous true
The problem is that Mosquitto doesn't use config files without being explicitly told to do so. When I start a Mosquitto instance from Terminal via

Code: Select all

mosquitto -c /etc/mosquitto/conf.d/mosquitto.conf
... it works! But my Mosquitto service daemon at

Code: Select all

/etc/init.d/mosquitto
ignores that file, resulting in the Shelly plug being blocked out.

How can I "teach" the daemon to use my config file?
User avatar
waltervl
Posts: 5148
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Python Plugin: Shelly MQTT

Post by waltervl »

According https://www.domoticz.com/wiki/MQTT you should edit the /etc/mosquitto/mosquitto.conf file. You made a /etc/mosquitto/conf.d/mosquitto.conf file. Is there no file in /etc/mosquitto?
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 0 guests