I'm trying to connect to my Shelly Plug S using MQTT. I am using Python client 'Paho' and MQTT broker 'Mosquitto'. I added the Shelly to my adres so it now has ip: 192.168.212.12. I configured my MQTT with a username and password. For the adres field I put '192.168.212.12:1883'. Is this correct?
I have the Mosquitto broker running on my pc so I guess it is on localhost/127.0.0.1
When I try to connect using my Python code I get this error:
[WinError 10061] No connection could be made because the target machine actively refused it.
The settings in my Shelly look like this:
{
"device": {
"type": "SHPLG-S",
"mac": "2CF4322670CA",
"hostname": "shellyplug-s-2670CA",
"num_outputs": 1,
"num_meters": 1
},
"wifi_ap": {
"enabled": false,
"ssid": "shellyplug-s-2670CA",
"key": ""
},
"wifi_sta": {
"enabled": true,
"ssid": "Inet24",
"ipv4_method": "dhcp",
"ip": null,
"gw": null,
"mask": null,
"dns": null
},
"wifi_sta1": {
"enabled": false,
"ssid": null,
"ipv4_method": "dhcp",
"ip": null,
"gw": null,
"mask": null,
"dns": null
},
"mqtt": {
"enable": true,
"server": "192.168.212.12:1883",
"user": "simon",
"id": "shellyplug-s-2670CA",
"reconnect_timeout_max": 60.000000,
"reconnect_timeout_min": 2.000000,
"clean_session": true,
"keep_alive": 60,
"max_qos": 0,
"retain": false,
"update_period": 30
},
"coiot": {
"update_period": 15
},
"sntp": {
"server": "time.google.com",
"enabled": true
},
"login": {
"enabled": false,
"unprotected": false,
"username": "admin",
"password": "admin"
},
"pin_code": "",
"name": "",
"fw": "20200309-104506/v1.6.0@43056d58",
"discoverable": true,
"build_info": {
"build_id": "20200309-104506/v1.6.0@43056d58",
"build_timestamp": "2020-03-09T10:45:06Z",
"build_version": "1.0"
},
"cloud": {
"enabled": false,
"connected": false
},
"timezone": "Europe/Amsterdam",
"lat": 52.370201,
"lng": 4.895170,
"tzautodetect": true,
"tz_utc_offset": 3600,
"tz_dst": false,
"tz_dst_auto": true,
"time": "13:26",
"unixtime": 1585229213,
"hwinfo": {
"hw_revision": "prod-190516",
"batch_id": 1
},
"max_power": 2500,
"led_status_disable": false,
"led_power_disable": false,
"relays": [
{
"ison": true,
"has_timer": false,
"overpower": false,
"default_state": "off",
"auto_on": 0.00,
"auto_off": 0.00,
"btn_on_url": null,
"out_on_url": null,
"out_off_url": null,
"schedule": false,
"schedule_rules": [
"1630-01234-off",
"0800-01234-on"
],
"max_power": 2500
}
],
"meters": [
{
"power": 3.84,
"is_valid": true,
"timestamp": 1585229213,
"counters": [
4.126,
4.227,
4.376
],
"total": 377
}
]
}
Is some of this info incorrect or is something else wrong? I hope somebody can help me.