Page 2 of 2
Re: NodeJS Module: node-domoticz-mqtt
Posted: Thursday 12 July 2018 15:56
by emme
uh... switch off and back on doesn't work... got to try this!!!

do you have any error in domoticz log?
the strange thing is..... I do NOT have this issue with scenarios (that goes only ON ) or groups (that can be go OFF either)
Re: NodeJS Module: node-domoticz-mqtt
Posted: Thursday 12 July 2018 17:08
by Charley
Now the On and Off are both working.
But I may have found the problem with setting the color
Code: Select all
2018-07-12 17:04:08.079 MQTT: Topic: domoticz/in, Message: {"command":"switchlight","idx":59,"switchcmd":"Off"}
2018-07-12 17:04:23.754 MQTT: Topic: domoticz/in, Message: {"command":"switchlight","idx":59,"switchcmd":"On"}
2018-07-12 17:04:28.752 MQTT: Topic: domoticz/in, Message: {"command":"setcolbrightnessvalue","idx":59,"hex":"FF0B85","brightness":90,"iswhite":false}
2018-07-12 17:04:28.752 Status: MQTT: setcolbrightnessvalue: ID: 3b, bri: 100, color: '{m: 3, RGB: ff0a84, CWWW: 0000, CT: 0}'
2018-07-12 17:04:42.385 MQTT: Topic: domoticz/in, Message: {"command":"switchlight","idx":59,"switchcmd":"On"}
2018-07-12 17:05:30.416 MQTT: Topic: domoticz/in, Message: {"command":"switchlight","idx":59,"switchcmd":"Off"}
2018-07-12 17:05:41.778 MQTT: Topic: domoticz/in, Message: {"command":"switchlight","idx":59,"switchcmd":"On"}
2018-07-12 17:05:53.740 MQTT: Topic: domoticz/in, Message: {"command":"setcolbrightnessvalue","idx":59,"hex":"FF0B85","brightness":90,"iswhite":false}
2018-07-12 17:05:53.740 Status: MQTT: setcolbrightnessvalue: ID: 3b, bri: 100, color: '{m: 3, RGB: ff0a84, CWWW: 0000, CT: 0}'
Domoticz uses hex for the idx
and the color on status MQTT is different
Re: NodeJS Module: node-domoticz-mqtt
Posted: Friday 10 May 2019 1:14
by khouloud
Hello
need your help please
I have a setup domoticz on my raspberry pi I get the value H / T, Brightness, window status, air conditioner state. and now I want to create a platform web to visualize this data the question:
It is possible to exploit this data from domoticz via node.js or node Red to send them on the web platform
they are tuto to help me ?
help me please
Re: NodeJS Module: node-domoticz-mqtt
Posted: Friday 20 September 2019 11:18
by Kenneth9
This is a great function for node-red and I got it working
www.subway.com However I struggle to see how I can get this data into domoticz? I have setup the MQTT in domoticz and it is subscribed but I'm not sure where to go from there.
Re: NodeJS Module: node-domoticz-mqtt
Posted: Friday 20 September 2019 11:36
by waaren
Kenneth9 wrote: ↑Friday 20 September 2019 11:18
This is a great function for node-red and I got it working. However I struggle to see how I can get this data into domoticz? I have setup the MQTT in domoticz and it is subscribed but I'm not sure where to go from there.
Did you find
this wiki page on MQTT <-> domoticz ?
Re: NodeJS Module: node-domoticz-mqtt
Posted: Friday 20 September 2019 23:30
by FireWizard
Hi,
In addition to waaren's link to the MQTT wiki, I also recommend reading the information in this link:
https://piandmore.wordpress.com/.
Regards
Re: NodeJS Module: node-domoticz-mqtt
Posted: Friday 10 January 2020 15:52
by Westcott
Hiya Nayr,
Thanks for writing this library!
For my first-ever Node.js project, it's part of a Tuya devices control script.
I've had to modify your library library slightly to catch bad JSON reads.
Code: Select all
SyntaxError: Unexpected token O in JSON at position 1
Code: Select all
domoMQTT.on('message', function (topic, message) {
try {
var jsonData = JSON.parse(message)
if (TRACE) { console.log('MQTT IN: ' + message.toString()) };
if (IDX.contains(jsonData.idx)) {
self.mqttData(jsonData);
}
} catch(e) {
console.log('MQTT IN: ' + e);
}
});