MQTT tracker does not work after reconnection

106 views
Skip to first unread message

Yuriy Yatsyshyn

unread,
Jan 16, 2016, 8:27:43 AM1/16/16
to Home Assistant Dev
Hi.
I am trying to use MQTT tracker.
All works until temporary disconection.
Loggs:

....
WARNING
:homeassistant.components.mqtt:Disconnected from MQTT (1). Trying to reconnect in 8s
WARNING
:homeassistant.components.mqtt:Disconnected from MQTT (1). Trying to reconnect in 16s
INFO
:homeassistant.components.mqtt:Successfully reconnected to the MQTT server

No any message received after this message.
(I send message manualy from

CloudMQTT Console)

Anybody knows what should I do?

Paulus Schoutsen

unread,
Jan 16, 2016, 1:01:08 PM1/16/16
to home-assi...@googlegroups.com
This issue is being tracked here: https://github.com/balloob/home-assistant/issues/873

--
You received this message because you are subscribed to the Google Groups "Home Assistant Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to home-assistant-...@googlegroups.com.
To post to this group, send email to home-assi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/home-assistant-dev/655142db-c50a-49b9-8ac9-bd253aae7b78%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
It's nice to be important but it's more important to be nice.

Yuriy Yatsyshyn

unread,
Jan 16, 2016, 1:04:00 PM1/16/16
to Home Assistant Dev
Thank you.

субота, 16 січня 2016 р. 20:01:08 UTC+2 користувач Paulus Schoutsen написав:
This issue is being tracked here: https://github.com/balloob/home-assistant/issues/873
On Sat, Jan 16, 2016 at 5:27 AM, Yuriy Yatsyshyn <yats...@gmail.com> wrote:
Hi.
I am trying to use MQTT tracker.
All works until temporary disconection.
Loggs:

....
WARNING
:homeassistant.components.mqtt:Disconnected from MQTT (1). Trying to reconnect in 8s
WARNING
:homeassistant.components.mqtt:Disconnected from MQTT (1). Trying to reconnect in 16s
INFO
:homeassistant.components.mqtt:Successfully reconnected to the MQTT server

No any message received after this message.
(I send message manualy from

CloudMQTT Console)

Anybody knows what should I do?

--
You received this message because you are subscribed to the Google Groups "Home Assistant Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to home-assistant-dev+unsub...@googlegroups.com.

Yuriy Yatsyshyn

unread,
Jan 16, 2016, 1:32:23 PM1/16/16
to Home Assistant Dev
Hi Paulus Scoutsen.
I think, I have founded decision:
class MQTT(object):
   
""" Implements messaging service for MQTT. """
   
def __init__(self, hass, broker, port, client_id, keepalive, username,
                 password
, certificate):
       
import paho.mqtt.client as mqtt

       
self.userdata = {
           
'hass': hass,
           
'topics': {},
           
'progress': {},
       
}

       
if client_id is None:
           
self._mqttc = mqtt.Client(clean_session=False)
       
else:
           
self._mqttc = mqtt.Client(client_id=client_id,clean_session=False)

       
self._mqttc.user_data_set(self.userdata)

       
if username is not None:
           
self._mqttc.username_pw_set(username, password)
       
if certificate is not None:
           
self._mqttc.tls_set(certificate)

       
self._mqttc.on_subscribe = _mqtt_on_subscribe
       
self._mqttc.on_unsubscribe = _mqtt_on_unsubscribe
       
self._mqttc.on_connect = _mqtt_on_connect
       
self._mqttc.on_disconnect = _mqtt_on_disconnect
       
self._mqttc.on_message = _mqtt_on_message

       
self._mqttc.connect(broker, port, keepalive)Введіть тут код...
Parameter clean_session SHOULD BE FALSE.
clean_session=False

Am I right?


субота, 16 січня 2016 р. 20:01:08 UTC+2 користувач Paulus Schoutsen написав:
This issue is being tracked here: https://github.com/balloob/home-assistant/issues/873

On Sat, Jan 16, 2016 at 5:27 AM, Yuriy Yatsyshyn <yats...@gmail.com> wrote:
Hi.
I am trying to use MQTT tracker.
All works until temporary disconection.
Loggs:

....
WARNING
:homeassistant.components.mqtt:Disconnected from MQTT (1). Trying to reconnect in 8s
WARNING
:homeassistant.components.mqtt:Disconnected from MQTT (1). Trying to reconnect in 16s
INFO
:homeassistant.components.mqtt:Successfully reconnected to the MQTT server

No any message received after this message.
(I send message manualy from

CloudMQTT Console)

Anybody knows what should I do?

--
You received this message because you are subscribed to the Google Groups "Home Assistant Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to home-assistant-dev+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages