Open ludekvodicka opened 7 years ago
It's weird. I have no problem like that. I'll try to enhance debug logging for better diagnostics.
I'm using Mosquitto MQTT provider together with your plugin and latest Loxone config. I'm running it inside the Docker images.
I'm also using Mosquitto and latest Loxone config on windows and raspberry pi. On both platforms without duplicate events. I added some debug messages. Please send me similar logs as previous.
I tried to rebuild docker machines but it seems that logs and behaviors are still the same. Should I configure anythig to be able to see new logs?
This is how I'm creating docker machine with your app
FROM node
RUN npm install -g node-lox-mqtt-gateway
RUN apt-get update
RUN apt-get --assume-yes install mosquitto-clients
ENTRYPOINT node /usr/local/lib/node_modules/node-lox-mqtt-gateway/bin/lox-mqtt-gateway.js --NODE_CONFIG_DIR='/data'
and this is my complet cfg file located in /data directory
{
"winston": [{
"Console": {
"level": "silly",
"colorize": true,
"timestamp": true
}
}],
"mqtt": {
"host": "mqtt://dum-mosquitto:1883",
"options": {
"rejectUnauthorized": false,
"clientId": "lox_to_mqtt_gateway"
}
},
"miniserver": {
"host": "loxone.dum:80",
"username": "xxxxx",
"password": "xxxx",
"readonly": false,
"encrypted" : true,
"mqtt_prefix": "lox"
}
}
and these are first lines from log:
[33mdum-loxone-mqtt |[0m 2017-01-10T08:57:56.695Z - [32minfo[39m: Loxone to MQTT gateway started
[33mdum-loxone-mqtt |[0m 2017-01-10T08:57:56.718Z - [32minfo[39m: MQTT - connect cmd=connack, retain=false, qos=0, dup=false, length=2, topic=null, payload=null, sessionPresent=false, returnCode=0
[33mdum-loxone-mqtt |[0m 2017-01-10T08:57:56.747Z - [32minfo[39m: WebSocketAPI - connect
Is there any version info I can check?
I tried it once more time. These seem to be the log lines (it's one click on switch button)
[32mdum-loxone-mqtt |[0m 2017-01-10T09:12:33.706Z - [34mdebug[39m: MQTT Adaptor - for mqtt: topic=lox/[technologie]/neprirazeno/tlacitko_rele1/state, data={"active":"on"}
[32mdum-loxone-mqtt |[0m 2017-01-10T09:12:33.707Z - [34mdebug[39m: WebSocketAPI - received update event: uuid=0eec80eb-007d-f7aa-ffff10b04d6bdd13, event=1
[32mdum-loxone-mqtt |[0m 2017-01-10T09:12:33.707Z - [34mdebug[39m: MQTT Adaptor - for mqtt: topic=lox/[technologie]/neprirazeno/tlacitko_rele1/state, data={"active":"on"}
[32mdum-loxone-mqtt |[0m 2017-01-10T09:12:33.714Z - [34mdebug[39m: WebSocketAPI - received update event: uuid=0eec80eb-007d-f7aa-ffff10b04d6bdd13, event=1
[32mdum-loxone-mqtt |[0m 2017-01-10T09:12:33.714Z - [34mdebug[39m: MQTT Adaptor - for mqtt: topic=lox/[technologie]/neprirazeno/tlacitko_rele1/state, data={"active":"on"}
[32mdum-loxone-mqtt |[0m 2017-01-10T09:12:33.717Z - [34mdebug[39m: WebSocketAPI - received update event: uuid=0eec80eb-007d-f7aa-ffff10b04d6bdd13, event=1
[32mdum-loxone-mqtt |[0m 2017-01-10T09:12:33.718Z - [34mdebug[39m: MQTT Adaptor - for mqtt: topic=lox/[technologie]/neprirazeno/tlacitko_rele1/state, data={"active":"on"}
[32mdum-loxone-mqtt |[0m 2017-01-10T09:12:33.719Z - [34mdebug[39m: WebSocketAPI - received update event: uuid=0eec80eb-007d-f7aa-ffff10b04d6bdd13, event=1
[32mdum-loxone-mqtt |[0m 2017-01-10T09:12:33.720Z - [34mdebug[39m: MQTT Adaptor - for mqtt: topic=lox/[technologie]/neprirazeno/tlacitko_rele1/state, data={"active":"on"}
[32mdum-loxone-mqtt |[0m 2017-01-10T09:12:33.732Z - [34mdebug[39m: WebSocketAPI - received update event: uuid=0eec80eb-007d-f7aa-ffff10b04d6bdd13, event=1
[32mdum-loxone-mqtt |[0m 2017-01-10T09:12:33.732Z - [34mdebug[39m: MQTT Adaptor - for mqtt: topic=lox/[technologie]/neprirazeno/tlacitko_rele1/state, data={"active":"on"}
[32mdum-loxone-mqtt |[0m 2017-01-10T09:12:33.733Z - [34mdebug[39m: WebSocketAPI - received update event: uuid=0eec80eb-007d-f7aa-ffff10b04d6bdd13, event=1
[32mdum-loxone-mqtt |[0m 2017-01-10T09:12:33.733Z - [34mdebug[39m: MQTT Adaptor - for mqtt: topic=lox/[technologie]/neprirazeno/tlacitko_rele1/state, data={"active":"on"}
[32mdum-loxone-mqtt |[0m 2017-01-10T09:12:33.737Z - [34mdebug[39m: WebSocketAPI - received update event: uuid=0eec80eb-007d-f7aa-ffff10b04d6bdd13, event=1
[32mdum-loxone-mqtt |[0m 2017-01-10T09:12:33.737Z - [34mdebug[39m: MQTT Adaptor - for mqtt: topic=lox/[technologie]/neprirazeno/tlacitko_rele1/state, data={"active":"on"}
[32mdum-loxone-mqtt |[0m 2017-01-10T09:12:33.737Z - [34mdebug[39m: WebSocketAPI - received update event: uuid=0eec80eb-007d-f7aa-ffff10b04d6bdd13, event=1
[32mdum-loxone-mqtt |[0m 2017-01-10T09:12:33.738Z - [34mdebug[39m: MQTT Adaptor - for mqtt: topic=lox/[technologie]/neprirazeno/tlacitko_rele1/state, data={"active":"on"}
[32mdum-loxone-mqtt |[0m 2017-01-10T09:12:33.738Z - [34mdebug[39m: WebSocketAPI - received update event: uuid=0eec80eb-007d-f7aa-ffff10b04d6bdd13, event=1
[32mdum-loxone-mqtt |[0m 2017-01-10T09:12:33.738Z - [34mdebug[39m: MQTT Adaptor - for mqtt: topic=lox/[technologie]/neprirazeno/tlacitko_rele1/state, data={"active":"on"}
[32mdum-loxone-mqtt |[0m 2017-01-10T09:12:33.748Z - [34mdebug[39m: WebSocketAPI - received update event: uuid=0eec80eb-007d-f7aa-ffff10b04d6bdd13, event=1
[32mdum-loxone-mqtt |[0m 2017-01-10T09:12:33.748Z - [34mdebug[39m: MQTT Adaptor - for mqtt: topic=lox/[technologie]/neprirazeno/tlacitko_rele1/state, data={"active":"on"}
[32mdum-loxone-mqtt |[0m 2017-01-10T09:12:33.749Z - [34mdebug[39m: WebSocketAPI - received update event: uuid=0eec80eb-007d-f7aa-ffff10b04d6bdd13, event=1
[32mdum-loxone-mqtt |[0m 2017-01-10T09:12:33.749Z - [34mdebug[39m: MQTT Adaptor - for mqtt: topic=lox/[technologie]/neprirazeno/tlacitko_rele1/state, data={"active":"on"}
[32mdum-loxone-mqtt |[0m 2017-01-10T09:12:33.750Z - [34mdebug[39m: WebSocketAPI - received update event: uuid=0eec80eb-007d-f7aa-ffff10b04d6bdd13, event=1
[32mdum-loxone-mqtt |[0m 2017-01-10T09:12:33.750Z - [34mdebug[39m: MQTT Adaptor - for mqtt: topic=lox/[technologie]/neprirazeno/tlacitko_rele1/state, data={"active":"on"}
[32mdum-loxone-mqtt |[0m 2017-01-10T09:12:33.751Z - [34mdebug[39m: WebSocketAPI - received update event: uuid=0eec80eb-007d-f7aa-ffff10b04d6bdd13, event=1
[32mdum-loxone-mqtt |[0m 2017-01-10T09:12:33.751Z - [34mdebug[39m: MQTT Adaptor - for mqtt: topic=lox/[technologie]/neprirazeno/tlacitko_rele1/state, data={"active":"on"}
[32mdum-loxone-mqtt |[0m 2017-01-10T09:12:33.752Z - [34mdebug[39m: WebSocketAPI - received update event: uuid=0eec80eb-007d-f7aa-ffff10b04d6bdd13, event=1
[32mdum-loxone-mqtt |[0m 2017-01-10T09:12:33.752Z - [34mdebug[39m: MQTT Adaptor - for mqtt: topic=lox/[technologie]/neprirazeno/tlacitko_rele1/state, data={"active":"on"}
[32mdum-loxone-mqtt |[0m 2017-01-10T09:12:33.752Z - [34mdebug[39m: WebSocketAPI - received update event: uuid=0eec80eb-007d-f7aa-ffff10b04d6bdd13, event=1
[32mdum-loxone-mqtt |[0m 2017-01-10T09:12:33.752Z - [34mdebug[39m: MQTT Adaptor - for mqtt: topic=lox/[technologie]/neprirazeno/tlacitko_rele1/state, data={"active":"on"}
[32mdum-loxone-mqtt |[0m 2017-01-10T09:12:33.753Z - [34mdebug[39m: WebSocketAPI - received update event: uuid=0eec80eb-007d-f7aa-ffff10b04d6bdd13, event=1
[32mdum-loxone-mqtt |[0m 2017-01-10T09:12:33.753Z - [34mdebug[39m: MQTT Adaptor - for mqtt: topic=lox/[technologie]/neprirazeno/tlacitko_rele1/state, data={"active":"on"}
[32mdum-loxone-mqtt |[0m 2017-01-10T09:12:33.753Z - [34mdebug[39m: WebSocketAPI - received update event: uuid=0eec80eb-007d-f7aa-ffff10b04d6bdd13, event=1
[32mdum-loxone-mqtt |[0m 2017-01-10T09:12:33.753Z - [34mdebug[39m: MQTT Adaptor - for mqtt: topic=lox/[technologie]/neprirazeno/tlacitko_rele1/state, data={"active":"on"}
[32mdum-loxone-mqtt |[0m 2017-01-10T09:12:33.770Z - [34mdebug[39m: WebSocketAPI - received update event: uuid=0eec80eb-007d-f7aa-ffff10b04d6bdd13, event=1
[32mdum-loxone-mqtt |[0m 2017-01-10T09:12:33.771Z - [34mdebug[39m: MQTT Adaptor - for mqtt: topic=lox/[technologie]/neprirazeno/tlacitko_rele1/state, data={"active":"on"}
[32mdum-loxone-mqtt |[0m 2017-01-10T09:12:33.771Z - [34mdebug[39m: WebSocketAPI - received update event: uuid=0eec80eb-007d-f7aa-ffff10b04d6bdd13, event=1
[32mdum-loxone-mqtt |[0m 2017-01-10T09:12:33.771Z - [34mdebug[39m: MQTT Adaptor - for mqtt: topic=lox/[technologie]/neprirazeno/tlacitko_rele1/state, data={"active":"on"}
[32mdum-loxone-mqtt |[0m 2017-01-10T09:12:33.772Z - [34mdebug[39m: WebSocketAPI - received update event: uuid=0eec80eb-007d-f7aa-ffff10b04d6bdd13, event=1
[32mdum-loxone-mqtt |[0m 2017-01-10T09:12:33.772Z - [34mdebug[39m: MQTT Adaptor - for mqtt: topic=lox/[technologie]/neprirazeno/tlacitko_rele1/state, data={"active":"on"}
[32mdum-loxone-mqtt |[0m 2017-01-10T09:12:33.784Z - [34mdebug[39m: WebSocketAPI - received update event: uuid=0eec80eb-007d-f7aa-ffff10b04d6bdd13, event=1
[32mdum-loxone-mqtt |[0m 2017-01-10T09:12:33.784Z - [34mdebug[39m: MQTT Adaptor - for mqtt: topic=lox/[technologie]/neprirazeno/tlacitko_rele1/state, data={"active":"on"}
[32mdum-loxone-mqtt |[0m 2017-01-10T09:12:33.785Z - [34mdebug[39m: WebSocketAPI - received update event: uuid=0eec80eb-007d-f7aa-ffff10b04d6bdd13, event=1
[32mdum-loxone-mqtt |[0m 2017-01-10T09:12:33.785Z - [34mdebug[39m: MQTT Adaptor - for mqtt: topic=lox/[technologie]/neprirazeno/tlacitko_rele1/state, data={"active":"on"}
[32mdum-loxone-mqtt |[0m 2017-01-10T09:12:33.794Z - [34mdebug[39m: WebSocketAPI - received update event: uuid=0eec80eb-007d-f7aa-ffff10b04d6bdd13, event=1
[32mdum-loxone-mqtt |[0m 2017-01-10T09:12:33.794Z - [34mdebug[39m: MQTT Adaptor - for mqtt: topic=lox/[technologie]/neprirazeno/tlacitko_rele1/state, data={"active":"on"}
[32mdum-loxone-mqtt |[0m 2017-01-10T09:12:33.794Z - [34mdebug[39m: WebSocketAPI - received update event: uuid=0e3b4ddb-00c9-e76d-ffffba26796ac754, event=3837.21125
[32mdum-loxone-mqtt |[0m 2017-01-10T09:12:33.794Z - [34mdebug[39m: MQTT Adaptor - for mqtt: topic=lox/[technologie]/mereni/elektromer_celkem/state, data={"total":3837.21125}
[32mdum-loxone-mqtt |[0m 2017-01-10T09:12:33.804Z - [34mdebug[39m: WebSocketAPI - received update event: uuid=0eec80eb-007d-f7aa-ffff10b04d6bdd13, event=1
[32mdum-loxone-mqtt |[0m 2017-01-10T09:12:33.804Z - [34mdebug[39m: MQTT Adaptor - for mqtt: topic=lox/[technologie]/neprirazeno/tlacitko_rele1/state, data={"active":"on"}
[32mdum-loxone-mqtt |[0m 2017-01-10T09:12:33.805Z - [34mdebug[39m: WebSocketAPI - received update event: uuid=0e3b4ddb-00c9-e76d-ffffba26796ac754, event=3837.21125
[32mdum-loxone-mqtt |[0m 2017-01-10T09:12:33.805Z - [34mdebug[39m: MQTT Adaptor - for mqtt: topic=lox/[technologie]/mereni/elektromer_celkem/state, data={"total":3837.21125}
[32mdum-loxone-mqtt |[0m 2017-01-10T09:12:33.805Z - [34mdebug[39m: WebSocketAPI - received update event: uuid=0eec80eb-007d-f7aa-ffff10b04d6bdd13, event=1
[32mdum-loxone-mqtt |[0m 2017-01-10T09:12:33.805Z - [34mdebug[39m: MQTT Adaptor - for mqtt: topic=lox/[technologie]/neprirazeno/tlacitko_rele1/state, data={"active":"on"}
[32mdum-loxone-mqtt |[0m 2017-01-10T09:12:33.805Z - [34mdebug[39m: WebSocketAPI - received update event: uuid=0e3b4ddb-00c9-e76d-ffffba26796ac754, event=3837.21125
[32mdum-loxone-mqtt |[0m 2017-01-10T09:12:33.805Z - [34mdebug[39m: MQTT Adaptor - for mqtt: topic=lox/[technologie]/mereni/elektromer_celkem/state, data={"total":3837.21125}
[32mdum-loxone-mqtt |[0m 2017-01-10T09:12:33.806Z - [34mdebug[39m: WebSocketAPI - received update event: uuid=0eec80eb-007d-f7aa-ffff10b04d6bdd13, event=1
[32mdum-loxone-mqtt |[0m 2017-01-10T09:12:33.806Z - [34mdebug[39m: MQTT Adaptor - for mqtt: topic=lox/[technologie]/neprirazeno/tlacitko_rele1/state, data={"active":"on"}
[32mdum-loxone-mqtt |[0m 2017-01-10T09:12:33.806Z - [34mdebug[39m: WebSocketAPI - received update event: uuid=0e3b4ddb-00c9-e76d-ffffba26796ac754, event=3837.21125
[32mdum-loxone-mqtt |[0m 2017-01-10T09:12:33.806Z - [34mdebug[39m: MQTT Adaptor - for mqtt: topic=lox/[technologie]/mereni/elektromer_celkem/state, data={"total":3837.21125}
[32mdum-loxone-mqtt |[0m 2017-01-10T09:12:33.810Z - [34mdebug[39m: WebSocketAPI - received update event: uuid=0eec80eb-007d-f7aa-ffff10b04d6bdd13, event=1
[32mdum-loxone-mqtt |[0m 2017-01-10T09:12:33.810Z - [34mdebug[39m: MQTT Adaptor - for mqtt: topic=lox/[technologie]/neprirazeno/tlacitko_rele1/state, data={"active":"on"}
[32mdum-loxone-mqtt |[0m 2017-01-10T09:12:33.810Z - [34mdebug[39m: WebSocketAPI - received update event: uuid=0e3b4ddb-00c9-e76d-ffffba26796ac754, event=3837.21125
[32mdum-loxone-mqtt |[0m 2017-01-10T09:12:33.810Z - [34mdebug[39m: MQTT Adaptor - for mqtt: topic=lox/[technologie]/mereni/elektromer_celkem/state, data={"total":3837.21125}
[32mdum-loxone-mqtt |[0m 2017-01-10T09:12:33.811Z - [34mdebug[39m: WebSocketAPI - received update event: uuid=0eec80eb-007d-f7aa-ffff10b04d6bdd13, event=1
[32mdum-loxone-mqtt |[0m 2017-01-10T09:12:33.811Z - [34mdebug[39m: MQTT Adaptor - for mqtt: topic=lox/[technologie]/neprirazeno/tlacitko_rele1/state, data={"active":"on"}
[32mdum-loxone-mqtt |[0m 2017-01-10T09:12:33.811Z - [34mdebug[39m: WebSocketAPI - received update event: uuid=0e3b4ddb-00c9-e76d-ffffba26796ac754, event=3837.21125
[32mdum-loxone-mqtt |[0m 2017-01-10T09:12:33.811Z - [34mdebug[39m: MQTT Adaptor - for mqtt: topic=lox/[technologie]/mereni/elektromer_celkem/state, data={"total":3837.21125}
[32mdum-loxone-mqtt |[0m 2017-01-10T09:12:33.811Z - [34mdebug[39m: WebSocketAPI - received update event: uuid=0eec80eb-007d-f7aa-ffff10b04d6bdd13, event=1
[32mdum-loxone-mqtt |[0m 2017-01-10T09:12:33.811Z - [34mdebug[39m: MQTT Adaptor - for mqtt: topic=lox/[technologie]/neprirazeno/tlacitko_rele1/state, data={"active":"on"}
[32mdum-loxone-mqtt |[0m 2017-01-10T09:12:33.811Z - [34mdebug[39m: WebSocketAPI - received update event: uuid=0e3b4ddb-00c9-e76d-ffffba26796ac754, event=3837.21125
And these are received mqtt messages:
root@2ee70ea8ad6f:/# mosquitto_sub -h dum-mosquitto -t "lox/[technologie]/neprirazeno/tlacitko_rele1/state"
{"active":"on"}
{"active":"on"}
{"active":"on"}
{"active":"on"}
{"active":"on"}
{"active":"on"}
{"active":"on"}
{"active":"on"}
{"active":"on"}
{"active":"on"}
{"active":"on"}
{"active":"on"}
{"active":"on"}
{"active":"on"}
{"active":"on"}
{"active":"on"}
{"active":"on"}
{"active":"on"}
{"active":"on"}
{"active":"on"}
{"active":"on"}
{"active":"on"}
{"active":"on"}
{"active":"on"}
{"active":"on"}
{"active":"on"}
{"active":"on"}
{"active":"on"}
{"active":"on"}
{"active":"on"}
which version is in /usr/local/lib/node_modules/node-lox-mqtt-gateway/package.json? New logging is in 0.2.9
You're right. It's 0.2.8.
But I'm not sure why. It seems that npm is returning old version
RUN npm install -g node-lox-mqtt-gateway
I also tried to replace content of /usr/local/lib/node_modules/node-lox-mqtt-gateway/ with content directly from GitHub but then I'm receiving following error:
[36mdum-loxone-mqtt |[0m module.js:472
[36mdum-loxone-mqtt |[0m throw err;
[36mdum-loxone-mqtt |[0m ^
[36mdum-loxone-mqtt |[0m
[36mdum-loxone-mqtt |[0m Error: Cannot find module 'unidecode'
[36mdum-loxone-mqtt |[0m at Function.Module._resolveFilename (module.js:470:15)
[36mdum-loxone-mqtt |[0m at Function.Module._load (module.js:418:25)
[36mdum-loxone-mqtt |[0m at Module.require (module.js:498:17)
[36mdum-loxone-mqtt |[0m at require (internal/module.js:20:19)
[36mdum-loxone-mqtt |[0m at Object.<anonymous> (/usr/local/lib/node_modules/node-lox-mqtt-gateway/lib/Adaptor.js:3:19)
[36mdum-loxone-mqtt |[0m at Module._compile (module.js:571:32)
[36mdum-loxone-mqtt |[0m at Object.Module._extensions..js (module.js:580:10)
[36mdum-loxone-mqtt |[0m at Module.load (module.js:488:32)
[36mdum-loxone-mqtt |[0m at tryModuleLoad (module.js:447:12)
[36mdum-loxone-mqtt |[0m at Function.Module._load (module.js:439:3)
After replacing content you must run "npm install" in node-lox-mqtt-gateway diretory
I wrote the testing script https://github.com/alladdin/node-lox-ws-api-testing. Please could you try it? Is there a duplicit events?
I'm not sure if this is bug or intended behaviour but I see a lot of duplicate events in the log
https://dl.dropboxusercontent.com/u/11355235/ShareX/2017/01/2017-01-08_22-09-31.png or https://dl.dropboxusercontent.com/u/11355235/ShareX/2017/01/2017-01-08_22-10-29.png
And also when I'm subscribed for any topic I receive several messages. For the example one switch press causes about 30 events - https://dl.dropboxusercontent.com/u/11355235/ShareX/2017/01/2017-01-08_22-18-19.png
Is this correct behaviour?