mqtt/ethernet gateway - node id?
-
Sure. Openhab connects to mqtt gateway without any problems, but i dont know where to find node and sensor ID ex. for switch "mysensor:MyMQTT/nodeID/sensorID/V_LIGHT:command:ON", what i should put instead of nodeID and sensorID? where to find theme? is there any option i can get nodeID and display it when debugging (node) on com port?
-
I am sorry to dig this old one out but I have the same question and it seems to be unanswered. How can I define a static Node Id instead of auto assign by the gateway?
Depending on what version of the library you're using it could be:
For version 1.5
void setup() { // Initialize library and add callback for incoming messages gw.begin(incomingMessage, AUTO, true); // Send the sketch version information to the gateway and Controller gw.sendSketchInfo("Relay", "1.0");where AUTO means auto assign, so replace by your static id
gw.begin(incomingMessage, 10 , true);For version 1.6/2.0 beta
It would be
// Define Node ID #define MY_NODE_ID 7 // INCLUDES // #include <SPI.h> #include <MySensor.h>Cheers
-
No, I don't believe the mysensors binding supports MQTT so won't provide node ID.
I am using the MQTT binding for openhab2 and using a mixture of auto and static node ID with the MYS 2.0 MQTT client gateway.
I use Node Red to assign node ID's I think someone already posted a workflow for it.
I have Node Red ping me a message saying that it's assigned a new ID but you can use mosquitto to subscribe to both the in and out topics so you can see each message going back and forth.
You could even use mosquitto to reply to the node on the MQTT topic and set it manually.
-
No, I don't believe the mysensors binding supports MQTT so won't provide node ID.
I am using the MQTT binding for openhab2 and using a mixture of auto and static node ID with the MYS 2.0 MQTT client gateway.
I use Node Red to assign node ID's I think someone already posted a workflow for it.
I have Node Red ping me a message saying that it's assigned a new ID but you can use mosquitto to subscribe to both the in and out topics so you can see each message going back and forth.
You could even use mosquitto to reply to the node on the MQTT topic and set it manually.
-
For 2.0 I think if you want to assign a static nodeID you only need to define it like you are.
You do not need to call getNodeID as that I believe will request an ID from the controller.
Hopefully someone can confirm that, I've only been using 2.0 for a single node after upgrading my gateway.