I am a newbie and have flashed my first sonoff.
Installed MQTT and config a device.
But I am stuck here, I don’t see the device.
I am searching for a few days now but no luck.
I am out off options.
That’s why my question for help here.
I have the sonoff active and when I stop and start mqtt I see this in the log:
[INFO] Setup mosquitto configuration
[WARN] SSL not enabled - No valid certs found!
[INFO] No local user available
[INFO] Initialize Hass.io Add-on services
[INFO] Initialize Home Assistant discovery
[INFO] Start Mosquitto daemon
1549804693: mosquitto version 1.4.15 (build date 2018-03-04 15:35:59+0000) starting
1549804693: Config loaded from /etc/mosquitto.conf.
1549804693: *** auth-plug: startup
1549804693: ** Configured order: http
1549804693: Opening ipv4 listen socket on port 1883.
1549804693: Opening ipv6 listen socket on port 1883.
1549804693: Opening websockets listen socket on port 1884.
1549804693: Warning: Mosquitto should not be run as root/administrator.
1549804701: New connection from “ip sonoff” on port 1883.
[INFO] found wimpie on Home Assistant
1549804702: New client connected from “ip sonoff” as Schreibtischlampe_4AEAA3 (c1, k10, u’wimpie’).
This I got in my configurator.yaml:
mqtt:
discovery: true
broker: 192.168…“ip PI”
This I got in my switches.yaml:
- platform: mqtt
name: “Schreibtischlampe”
state_topic: “stat/sonoffDEV/POWER”
command_topic: “cmnd/sonoffDEV/POWER”
qos: 1
payload_on: “ON”
payload_off: “OFF”
retain: true
This I got in my sonoff s20:
Sonoff S2X Module
Sonoff
Program Version | 6.4.1(sonoff) |
---|---|
Build Date & Time | 2018-12-24T14:41:00 |
Core/SDK Version | 2_4_2/2.2.1(cfd48f3) |
Uptime | 0T03:18:43 |
Flash write Count | 90 at 0xFA000 |
Boot Count | 39 |
Restart Reason | Power on |
Friendly Name 1 | Sonoff |
AP1 SSId (RSSI) “ISP” (82%) | |
Hostname | sonoffDEV-2723.local |
IP Address | 192.168… “ip sonoff” |
Gateway | 192.168… |
Subnet Mask | 255.255.255.0 |
DNS Server | 89.101.251.229 |
MAC Address | 84:F3:EB:4A:EA:A3 |
MQTT Host | 192.168…“ip from PI” |
MQTT Port | 1883 |
MQTT User | wimpie |
MQTT Client | Schreibtischlampe_4AEAA3 |
MQTT Topic | sonoffDEV |
MQTT Group Topic | sonoffs |
MQTT Full Topic | cmnd/sonoffDEV/ |
MQTT Fallback Topic | cmnd/Schreibtischlampe_4AEAA3_fb/ |
I use HA 0.87
Mosquito broker integrations “This integration has no devices”
This is the mqtt config:
{
“logins”: [],
“anonymous”: true,
“customize”: {
“active”: false,
“folder”: “mosquitto”
},
“certfile”: “fullchain.pem”,
“keyfile”: “privkey.pem”
}
I only change anonymous from false to true.
But this is what I get from the HA log:
019-02-10 14:31:38 WARNING (MainThread) [homeassistant.components.mqtt] Data in your config entry is going to override your configuration.yaml: {‘broker’: ‘core-mosquitto’, ‘discovery’: True, ‘password’: ‘O_29G6HtZNp4Hl0uXyEIPK__gGqZOzqW’, ‘port’: 1883, ‘protocol’: ‘3.1.1’, ‘username’: ‘homeassistant’}
2019-02-10 14:31:39 ERROR (Thread-2) [homeassistant.components.mqtt] Unable to connect to the MQTT broker: Connection Refused: not authorised.
2019-02-10 14:31:39 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Mosquitto broker for mqtt
Traceback (most recent call last):
File “/usr/local/lib/python3.6/site-packages/homeassistant/config_entries.py”, line 258, in async_setup
result = await component.async_setup_entry(hass, self)
File “/usr/local/lib/python3.6/site-packages/homeassistant/components/mqtt/init.py”, line 568, in async_setup_entry
hass, conf, hass.data[DATA_MQTT_HASS_CONFIG], entry)
File “/usr/local/lib/python3.6/site-packages/homeassistant/components/mqtt/init.py”, line 380, in _async_setup_discovery
config_entry) # type: bool
File “/usr/local/lib/python3.6/site-packages/homeassistant/components/mqtt/discovery.py”, line 284, in async_start
hass, discovery_topic + ‘/#’, async_device_message_received, 0)
File “/usr/local/lib/python3.6/site-packages/homeassistant/components/mqtt/init.py”, line 320, in async_subscribe
qos, encoding)
File “/usr/local/lib/python3.6/site-packages/homeassistant/components/mqtt/init.py”, line 702, in async_subscribe
await self._async_perform_subscription(topic, qos)
File “/usr/local/lib/python3.6/site-packages/homeassistant/components/mqtt/init.py”, line 737, in _async_perform_subscription
_raise_on_error(result)
File “/usr/local/lib/python3.6/site-packages/homeassistant/components/mqtt/init.py”, line 822, in _raise_on_error
‘Error talking to MQTT: {}’.format(mqtt.error_string(result_code)))
homeassistant.exceptions.HomeAssistantError: Error talking to MQTT: The client is not currently connected.