Why do "passive nodes" need to set their Node ID manually?
-
Hmmm...., I get this compile time error if I remove the static ID:
#error MY_PASSIVE_NODE configuration requires setting MY_NODE_ID -
Hmmm...., I get this compile time error if I remove the static ID:
#error MY_PASSIVE_NODE configuration requires setting MY_NODE_ID -
Which MySensor example should I use, then, for a TH sensor? I want it to report temperature, humidity, and battery voltage. And I want Domoticz to be able to graph all three (including negative temperature values). I was surprised that none of the given examples was exactly this. What do you recommend?
-
Which MySensor example should I use, then, for a TH sensor? I want it to report temperature, humidity, and battery voltage. And I want Domoticz to be able to graph all three (including negative temperature values). I was surprised that none of the given examples was exactly this. What do you recommend?
-
@NeverDie I have no idea. The passive node is a bit of a hack, since MySensors nodes were initially designed to always have a path to the gateway. Hacks usually have unintended side-effects and it appears you have found one of those side-effects.
@mfalkvidd OK, but setting the passive node sketch aside, which of the other "normal" example sketches do you recommend?
-
@mfalkvidd OK, but setting the passive node sketch aside, which of the other "normal" example sketches do you recommend?
-
@mfalkvidd OK, but setting the passive node sketch aside, which of the other "normal" example sketches do you recommend?
I have started to test node-red (Which dont work yet...) so I have created a dummy sketch for parse the data to domoticz.
// Enable debug prints #define MY_DEBUG #define MY_GATEWAY_SERIAL // Enable passive mode #define MY_PASSIVE_NODE #define MY_REPEATER_FEATURE // Passive mode requires static node ID #define MY_NODE_ID 0 // Enable and select radio type attached // #define MY_RADIO_NRF24 //#define MY_RF24_PA_LEVEL RF24_PA_HIGH //#define MY_RADIO_NRF5_ESB //#define MY_RADIO_RFM69 //#define MY_RADIO_RFM95 #include <MySensors.h> #define CHILD_ID_HUM 0 #define CHILD_ID_TEMP 1 #define CHILD_ID_BINARY 2 // Initialize general message MyMessage msgTemp(CHILD_ID_TEMP, V_TEMP); MyMessage msgHum(CHILD_ID_HUM, V_HUM); MyMessage msgBinary(CHILD_ID_BINARY, V_STATUS); int counter = 0; float temperature = 0; float humidity = 0; int binary = 0; void setup() { } void presentation() { // Send the sketch version information to the gateway and controller sendSketchInfo("Passive node", "1.0"); // Register all sensors to gw (they will be created as child devices) present(CHILD_ID_TEMP, S_TEMP); present(CHILD_ID_HUM, S_HUM); present(CHILD_ID_BINARY, S_BINARY); } void loop() { // generate some random data counter ++; if (counter == 20 ){ temperature = 0; humidity = 0; counter = 0; } else { temperature = 25.0 + random(0,30)/10.0; humidity = 55.0 + random(-20,20); } /* if (binary == 0){ send(msgBinary.set(binary,2)); binary = 1; }else { send(msgBinary.set(binary,2)); binary = 0; } */ send(msgTemp.set(temperature,2)); send(msgHum.set(humidity,2)); wait(1000); } -
I have started to test node-red (Which dont work yet...) so I have created a dummy sketch for parse the data to domoticz.
// Enable debug prints #define MY_DEBUG #define MY_GATEWAY_SERIAL // Enable passive mode #define MY_PASSIVE_NODE #define MY_REPEATER_FEATURE // Passive mode requires static node ID #define MY_NODE_ID 0 // Enable and select radio type attached // #define MY_RADIO_NRF24 //#define MY_RF24_PA_LEVEL RF24_PA_HIGH //#define MY_RADIO_NRF5_ESB //#define MY_RADIO_RFM69 //#define MY_RADIO_RFM95 #include <MySensors.h> #define CHILD_ID_HUM 0 #define CHILD_ID_TEMP 1 #define CHILD_ID_BINARY 2 // Initialize general message MyMessage msgTemp(CHILD_ID_TEMP, V_TEMP); MyMessage msgHum(CHILD_ID_HUM, V_HUM); MyMessage msgBinary(CHILD_ID_BINARY, V_STATUS); int counter = 0; float temperature = 0; float humidity = 0; int binary = 0; void setup() { } void presentation() { // Send the sketch version information to the gateway and controller sendSketchInfo("Passive node", "1.0"); // Register all sensors to gw (they will be created as child devices) present(CHILD_ID_TEMP, S_TEMP); present(CHILD_ID_HUM, S_HUM); present(CHILD_ID_BINARY, S_BINARY); } void loop() { // generate some random data counter ++; if (counter == 20 ){ temperature = 0; humidity = 0; counter = 0; } else { temperature = 25.0 + random(0,30)/10.0; humidity = 55.0 + random(-20,20); } /* if (binary == 0){ send(msgBinary.set(binary,2)); binary = 1; }else { send(msgBinary.set(binary,2)); binary = 0; } */ send(msgTemp.set(temperature,2)); send(msgHum.set(humidity,2)); wait(1000); } -
Well I wanted to filter noise values and I also want to use influx/grafana as a complement to domoticz
-
@smilvert So, do you have the gateway connected directly to Node Red, which then feeds Domoticz and also feeds influx/grafana? I think I want to do the same, if that's how to do it.
-
@NeverDie
Just cut domoticz out of the picture as node-red/influx/grafana works perfect with any gateway serial/ethernet/mqtt.
I prefer the serial gateway in my own experience is the most stable and no reliance on wifi routers and things.
Domoticz has nowhere near the same flexibility when graphing etc. -
@NeverDie
Just cut domoticz out of the picture as node-red/influx/grafana works perfect with any gateway serial/ethernet/mqtt.
I prefer the serial gateway in my own experience is the most stable and no reliance on wifi routers and things.
Domoticz has nowhere near the same flexibility when graphing etc.@rmtucker Ahhhhhh, that's right, it was rmtucker, not toyman, who had done it: https://forum.mysensors.org/topic/6961/nrf5-bluetooth-action/1078
-
@NeverDie @mfalkvidd Passive nodes communicate without message ACKs - ID requests may never make their way to the controller, hence the requirement of a static node ID.
-
@NeverDie @mfalkvidd Passive nodes communicate without message ACKs - ID requests may never make their way to the controller, hence the requirement of a static node ID.
-
I have started to test node-red (Which dont work yet...) so I have created a dummy sketch for parse the data to domoticz.
// Enable debug prints #define MY_DEBUG #define MY_GATEWAY_SERIAL // Enable passive mode #define MY_PASSIVE_NODE #define MY_REPEATER_FEATURE // Passive mode requires static node ID #define MY_NODE_ID 0 // Enable and select radio type attached // #define MY_RADIO_NRF24 //#define MY_RF24_PA_LEVEL RF24_PA_HIGH //#define MY_RADIO_NRF5_ESB //#define MY_RADIO_RFM69 //#define MY_RADIO_RFM95 #include <MySensors.h> #define CHILD_ID_HUM 0 #define CHILD_ID_TEMP 1 #define CHILD_ID_BINARY 2 // Initialize general message MyMessage msgTemp(CHILD_ID_TEMP, V_TEMP); MyMessage msgHum(CHILD_ID_HUM, V_HUM); MyMessage msgBinary(CHILD_ID_BINARY, V_STATUS); int counter = 0; float temperature = 0; float humidity = 0; int binary = 0; void setup() { } void presentation() { // Send the sketch version information to the gateway and controller sendSketchInfo("Passive node", "1.0"); // Register all sensors to gw (they will be created as child devices) present(CHILD_ID_TEMP, S_TEMP); present(CHILD_ID_HUM, S_HUM); present(CHILD_ID_BINARY, S_BINARY); } void loop() { // generate some random data counter ++; if (counter == 20 ){ temperature = 0; humidity = 0; counter = 0; } else { temperature = 25.0 + random(0,30)/10.0; humidity = 55.0 + random(-20,20); } /* if (binary == 0){ send(msgBinary.set(binary,2)); binary = 1; }else { send(msgBinary.set(binary,2)); binary = 0; } */ send(msgTemp.set(temperature,2)); send(msgHum.set(humidity,2)); wait(1000); }@smilvert Got it working: https://www.openhardware.io/view/510/Multi-Sensor-TempHumidityPIR-LeakMagnetLightAccel#tabs-source
I cited you in the credits at the beginning of the sketch.