Hi Akriss
Thanks for quick response. I do appreciate it.
ok so I’ve commented out:
mqtt:
broker: core-mosquitto
username: !secret mqtt_username
password: !secret mqtt_password
and integrated Mosquitto as a new integration referencing the local IP address as host with account/password as stated in Mosiquitto config and “Enable Discovery” ticked.
With the following configuration.yaml:
# mqtt:
# broker: core-mosquitto
# username: !secret mqtt_username
# password: !secret mqtt_password
switch:
- platform: mqtt
name: "sonoff 1"
state_topic: “stat/sonoff_1/RESULT”
value_template: "{{ value_json.POWER }}"
qos: 0
command_topic: “cmnd/sonoff_1/POWER”
payload_on: "ON"
payload_off: "OFF"
availability_topic: “tele/sonoff_1/LWT”
payload_available: “Online”
payload_not_available: “Offline”
retain: true
the result is “sonoff 1 unavailable” being displayed.
Sonoff config is:
Sonoff Basic Module
Sonoff1
MQTT parameters
Host ()
192.168.0.17
Port (1883)
1883
Client (DVES_51CD30)
DVES_%06X
User (DVES_USER)
airoguard
Password
••••••••
Topic = %topic% (sonoff)
sonoff_1
Full Topic (%prefix%/%topic%/)
%topic%/%prefix%/
No apparent activity in home-assistant.log:
2019-03-28 12:21:52 WARNING (MainThread) [homeassistant.components.sensor] Setup of platform ring is taking over 10 seconds.
2019-03-28 12:21:52 WARNING (MainThread) [homeassistant.components.camera] Setup of platform ring is taking over 10 seconds.
2019-03-28 12:26:40 WARNING (MainThread) [homeassistant.helpers.entity] Update of camera.front_door is taking over 10 seconds
2019-03-28 12:29:41 WARNING (MainThread) [homeassistant.helpers.entity] Update of camera.front_door is taking over 10 seconds
2019-03-28 12:32:43 WARNING (MainThread) [homeassistant.helpers.entity] Update of camera.front_door is taking over 10 seconds
2019-03-28 12:38:46 WARNING (MainThread) [homeassistant.helpers.entity] Update of camera.front_door is taking over 10 seconds
Mosquitto log (sonoff IP is 192.168.0.35):
1553675819: |-- getuser(airoguard) AUTHENTICATED=1 by http
1553675819: New client connected from 172.30.32.1 as 879a3d12-a371-4c9d-9f5a-2445aa214d37 (c1, k60, u'airoguard').
1553675843: Saving in-memory database to /data/mosquitto.db.
1553677643: Saving in-memory database to /data/mosquitto.db.
1553679444: Saving in-memory database to /data/mosquitto.db.
1553681245: Saving in-memory database to /data/mosquitto.db.
1553683047: Saving in-memory database to /data/mosquitto.db.
1553684847: Saving in-memory database to /data/mosquitto.db.
1553686649: Saving in-memory database to /data/mosquitto.db.
1553688449: Saving in-memory database to /data/mosquitto.db.
1553690250: Saving in-memory database to /data/mosquitto.db.
1553692051: Saving in-memory database to /data/mosquitto.db.
1553693853: Saving in-memory database to /data/mosquitto.db.
1553695653: Saving in-memory database to /data/mosquitto.db.
1553697455: Saving in-memory database to /data/mosquitto.db.
1553699256: Saving in-memory database to /data/mosquitto.db.
1553701057: Saving in-memory database to /data/mosquitto.db.
1553702857: Saving in-memory database to /data/mosquitto.db.
1553704658: Saving in-memory database to /data/mosquitto.db.
1553706460: Saving in-memory database to /data/mosquitto.db.
1553708261: Saving in-memory database to /data/mosquitto.db.
1553710062: Saving in-memory database to /data/mosquitto.db.
1553711862: Saving in-memory database to /data/mosquitto.db.
1553713664: Saving in-memory database to /data/mosquitto.db.
1553715464: Saving in-memory database to /data/mosquitto.db.
1553717265: Saving in-memory database to /data/mosquitto.db.
1553719067: Saving in-memory database to /data/mosquitto.db.
1553720867: Saving in-memory database to /data/mosquitto.db.
1553721776: Client 879a3d12-a371-4c9d-9f5a-2445aa214d37 disconnected.
1553721794: New connection from 172.30.32.1 on port 1883.
1553721794: |-- mosquitto_auth_unpwd_check(airoguard)
1553721794: |-- ** checking backend http
1553721794: |-- url=http://127.0.0.1:8080/login
1553721794: |-- data=username=airoguard&password=XXXXXX&topic=&acc=-1&clientid=
[INFO] found airoguard on local database
1553721795: |-- getuser(airoguard) AUTHENTICATED=1 by http
1553721795: New client connected from 172.30.32.1 as ad47b603-6851-49ac-8dee-0238725edd00 (c1, k60, u'airoguard').
1553722669: Saving in-memory database to /data/mosquitto.db.
1553724470: Saving in-memory database to /data/mosquitto.db.
1553726270: Saving in-memory database to /data/mosquitto.db.
1553728071: Saving in-memory database to /data/mosquitto.db.
1553729873: Saving in-memory database to /data/mosquitto.db.
1553731674: Saving in-memory database to /data/mosquitto.db.
1553733474: Saving in-memory database to /data/mosquitto.db.
1553735275: Saving in-memory database to /data/mosquitto.db.
1553735781: Client ad47b603-6851-49ac-8dee-0238725edd00 disconnected.
1553736023: New connection from 192.168.0.17 on port 1883.
1553736023: |-- mosquitto_auth_unpwd_check(airoguard)
1553736023: |-- ** checking backend http
1553736023: |-- url=http://127.0.0.1:8080/login
1553736023: |-- data=username=airoguard&password=XXXXXX&topic=&acc=-1&clientid=
[INFO] found airoguard on local database
1553736023: |-- getuser(airoguard) AUTHENTICATED=1 by http
1553736023: New client connected from 192.168.0.17 as 1F8cK6imjoGh26IW7ulMbL (c1, k60, u'airoguard').
1553736023: Client 1F8cK6imjoGh26IW7ulMbL disconnected.
1553736023: New connection from 192.168.0.17 on port 1883.
1553736023: |-- mosquitto_auth_unpwd_check(airoguard)
1553736023: |-- ** checking backend http
1553736023: |-- url=http://127.0.0.1:8080/login
1553736023: |-- data=username=airoguard&password=XXXXXX&topic=&acc=-1&clientid=
[INFO] found airoguard on local database
1553736024: |-- getuser(airoguard) AUTHENTICATED=1 by http
1553736024: New client connected from 192.168.0.17 as 04d7d6b4-addc-4602-a917-40714e7be645 (c1, k60, u'airoguard').
1553736075: Client 04d7d6b4-addc-4602-a917-40714e7be645 disconnected.
1553736093: New connection from 192.168.0.17 on port 1883.
1553736093: |-- mosquitto_auth_unpwd_check(airoguard)
1553736093: |-- ** checking backend http
1553736093: |-- url=http://127.0.0.1:8080/login
1553736093: |-- data=username=airoguard&password=XXXXXX&topic=&acc=-1&clientid=
[INFO] found airoguard on local database
1553736094: New client connected from 192.168.0.17 as 5c33b195-9870-4c44-8912-5d81189f1731 (c1, k60, u'airoguard').
1553736094: |-- getuser(airoguard) AUTHENTICATED=1 by http
1553736857: New connection from 192.168.0.17 on port 1883.
1553736857: |-- mosquitto_auth_unpwd_check(airoguard)
1553736857: |-- ** checking backend http
1553736857: |-- url=http://127.0.0.1:8080/login
1553736857: |-- data=username=airoguard&password=XXXXXX&topic=&acc=-1&clientid=
[INFO] found airoguard on local database
1553736858: |-- getuser(airoguard) AUTHENTICATED=1 by http
1553736858: New client connected from 192.168.0.17 as 3dlqjwaCPHesqFOzA6y4K6 (c1, k60, u'airoguard').
1553736858: Client 3dlqjwaCPHesqFOzA6y4K6 disconnected.
1553736858: New connection from 192.168.0.17 on port 1883.
1553736858: |-- mosquitto_auth_unpwd_check(airoguard)
1553736858: |-- ** checking backend http
1553736858: |-- url=http://127.0.0.1:8080/login
1553736858: |-- data=username=airoguard&password=XXXXXX&topic=&acc=-1&clientid=
[INFO] found airoguard on local database
1553736859: |-- getuser(airoguard) AUTHENTICATED=1 by http
1553736859: New client connected from 192.168.0.17 as 97d71427-25b0-474e-92e6-d37fd0a6d73b (c1, k60, u'airoguard').
1553737076: Saving in-memory database to /data/mosquitto.db.
1553737297: Client 97d71427-25b0-474e-92e6-d37fd0a6d73b disconnected.
1553737301: Socket error on client 5c33b195-9870-4c44-8912-5d81189f1731, disconnecting.
1553737313: New connection from 192.168.0.17 on port 1883.
1553737313: |-- mosquitto_auth_unpwd_check(airoguard)
1553737313: |-- ** checking backend http
1553737313: |-- url=http://127.0.0.1:8080/login
1553737313: |-- data=username=airoguard&password=XXXXXX&topic=&acc=-1&clientid=
[INFO] found airoguard on local database
1553737315: New client connected from 192.168.0.17 as 1bf55e8a-31d6-46cd-8a4b-1da35e59b04b (c1, k60, u'airoguard').
1553737315: |-- getuser(airoguard) AUTHENTICATED=1 by http
Still something wrong?
Thanks
Rob