Hi folks,
I’m just started with a docker image of home assistant to check if a change from OpenHab2 to HA would made the things easier
As a MQTT broker, I use mosquitto version 1.3.4 (build date 2018-09-28 22:21:32+0000) on a different host.
In the configuration.yaml, I have added the following:
mqtt:
broker: 192.168.192.235
port: 1883
client_id: home-assistant
discovery: false
switch:
- platform: mqtt
name: "buero licht"
state_topic: "homenet/touch01/stat/POWER"
command_topic: "homenet/touch01/cmnd/POWER"
retain: true
payload_on: "ON"
payload_off: "OFF"
state_on: "ON"
state_off: "OFF"
optimistic: false
qos: 0
- platform: mqtt
name: "buero led"
state_topic: "homenet/led01/stat/POWER"
command_topic: "homenet/led01/cmnd/POWER"
retain: true
payload_on: "ON"
payload_off: "OFF"
state_on: "ON"
state_off: "OFF"
optimistic: false
qos: 0
group:
Buero:
view: true
entities:
- switch.buero_licht
- switch.buero_led
logger:
default: debug
logs:
homeassistant.components.mqtt: debug
homeassistant.components.websocket_api: info
With this configuration, I’m able to switch the lights on. But it seems, that the state send back from the mqtt broker will not used by HA?
In my log, I could read the following:
-
I trigger the switch manually on:
2019-03-25 09:20:52 DEBUG (MainThread) [homeassistant.components.mqtt] Received message on /homenet/led01/stat/POWER: b'ON'
The message is received by HA, but the state of the switch in the UI of HA is not changed? -
I trigger the switch manually off:
2019-03-25 09:20:55 DEBUG (MainThread) [homeassistant.components.mqtt] Received message on /homenet/led01/stat/POWER: b'OFF'
-
I use the UI of HA to switch the light on:
2019-03-25 09:21:01 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: domain=switch, service=turn_on, service_data=entity_id=switch.buero_led>
2019-03-25 09:21:01 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: domain=mqtt, service=publish, service_data=topic=homenet/led01/cmnd/POWER, qos=0, retain=True, payload=ON>
2019-03-25 09:21:01 DEBUG (MainThread) [homeassistant.components.mqtt] Transmitting message on homenet/led01/cmnd/POWER: ON
2019-03-25 09:21:01 DEBUG (MainThread) [homeassistant.components.mqtt] Received message on /homenet/led01/stat/POWER: b’ON’
The light is going on, but after a second the switch in th UI of HA changes from ON to off but he light keeps on???
Any idea whats going wrong in my installation?
Thanks in advance
Joerg