Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
S

stress nero

@stress nero
About
Posts
15
Topics
5
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Vera luup engine rebooting.
    S stress nero

    After adding the sensors to vera edge I started to get random luup engine reboots i am not sure what i need to do to fix that issue. I am using RPI3 ethernet gateway. can one of u seasoned veterans take a look and see if i need to make any adjustments on the code side please. it also says controller did not repond under ALTUI.

    #define MY_DEBUG 
    #define MY_RADIO_NRF24
    #include <SPI.h>
    #include <MySensors.h>
    #include <DHT.h>
    
    #define DIGITAL_INPUT_WATER_SENSOR 5 // Digital input did you attach your soil sensor.
    
    #define CHILD_ID_HUM 0
    #define CHILD_ID_TEMP 1
    #define CHILD_ID_MOT 2   // Id of the sensor child
    #define CHILD_ID_LIGHT 3
    #define CHILD_ID_WAT 4      // Child id for Motion
    
    #define LIGHT_SENSOR_PIN A0 //Ambient light sensor reading 
    #define WATER_LEAK_PIN 5
    #define HUMIDITY_SENSOR_DIGITAL_PIN 4
    #define DIGITAL_INPUT_SENSOR 3   // The digital input you attached your motion sensor.  (Only 2 and 3 generates interrupt!)
    #define INTERRUPT DIGITAL_INPUT_SENSOR-2 // Usually the interrupt = pin -2 (on uno/nano anyway)
    
    
    unsigned long SLEEP_TIME = 30000; // Sleep time between reads (in milliseconds)
    
    DHT dht;
    float lastTemp;
    float lastHum;
    boolean metric = true; 
    uint16_t lastlux;
    
    MyMessage msgHum(CHILD_ID_HUM, V_HUM);
    MyMessage msgTemp(CHILD_ID_TEMP, V_TEMP);
    MyMessage msgMot(CHILD_ID_MOT, V_TRIPPED);
    MyMessage msgWat(CHILD_ID_WAT, V_TRIPPED);
    MyMessage msgLight(CHILD_ID_LIGHT,  V_LIGHT_LEVEL);
    int lastWaterValue = -1; 
    int lastLightLevel;
    
    void setup()  
    { 
      dht.setup(HUMIDITY_SENSOR_DIGITAL_PIN); 
      pinMode(DIGITAL_INPUT_SENSOR, INPUT);      // sets the motion sensor digital pin as input
      pinMode(DIGITAL_INPUT_WATER_SENSOR, INPUT);
      pinMode(LIGHT_SENSOR_PIN, INPUT);   
    } 
     
     void presentation()
    {   
      // Send the Sketch Version Information to the Gateway
      sendSketchInfo("Humidity/Motion", "1.0");
     
      // Register all sensors to gw (they will be created as child devices)
      present(CHILD_ID_HUM, S_HUM);
      present(CHILD_ID_TEMP, S_TEMP);
      present(CHILD_ID_MOT, S_MOTION);
      present(CHILD_ID_WAT, S_MOISTURE);
      present(CHILD_ID_LIGHT, S_LIGHT_LEVEL);  
    }
    
    void loop()
    {
      // Read digital motion value
        bool tripped = digitalRead(DIGITAL_INPUT_SENSOR) == HIGH;
    
        Serial.println(tripped);
        send(msgMot.set(tripped?"1":"0"));  // Send tripped value to gw
    
       
      float temperature = dht.getTemperature();
      if (isnan(temperature)) {
          Serial.println("Failed reading temperature from DHT");
      } else if (temperature != lastTemp) {
        lastTemp = temperature;
        if (!metric) {
          temperature = dht.toFahrenheit(temperature);
        }
        send(msgTemp.set(temperature, 1));
        Serial.print("T: ");
        Serial.println(temperature);
      }
      
      float humidity = dht.getHumidity();
      if (isnan(humidity)) {
          Serial.println("Failed reading humidity from DHT");
      } else if (humidity != lastHum) {
          lastHum = humidity;
          send(msgHum.set(humidity, 1));
          Serial.print("H: ");
          Serial.println(humidity);
      
    }
    
    int WaterValue = digitalRead(DIGITAL_INPUT_WATER_SENSOR); // 1 = Not triggered, 0 = In water
    if (WaterValue != lastWaterValue) {
    Serial.println(WaterValue);
    if (WaterValue==0)
    {
    Serial.println("Water!!!");
    send(msgWat.set("Water"));
    }
    else
    {
    Serial.println("No Water");
    send(msgWat.set("No Water")); // Send tripped when water detected
    lastWaterValue = WaterValue;
    
    }
         // Read lux from TEMT6000
       uint16_t lightLevel = analogRead(LIGHT_SENSOR_PIN);  // 1000/1024
      if (int(lightLevel - lastLightLevel) > 5 || int(lastLightLevel - lightLevel) > 5) {
          send(msgLight.setSensor(CHILD_ID_LIGHT).set(lightLevel,1));
         }
     }
     // Sleep until interrupt comes in on motion sensor. Send update every two minute.
        sleep(digitalPinToInterrupt(DIGITAL_INPUT_SENSOR), CHANGE, SLEEP_TIME);
    }
    
    
    Vera

  • how to query domoticz's security panel
    S stress nero

    thank for the input

    Development

  • how to query domoticz's security panel
    S stress nero

    @sundberg84 can you give me an example, and with lua will you be able to have a button that can toggle the armed and bypassed states.

    Development

  • how to query domoticz's security panel
    S stress nero

    @sundberg84 said in how to query domoticz's security panel:

    I use lua:

    if (devicechanged['Motiondetector'] == 'On' and otherdevices['Security Panel'] == 'Arm Away') then

    is there a way to put the motion sensor in bypassed mode or does it have to be a combination of the security panel being armed. I have a vera controller and there is a button to arm and bypass when in bypassed i get no alerts, how can that be done in domticz.

    Development

  • ESP8266 and Start inclusion doesnt work
    S stress nero

    @riochicken I figured it out, i am using rpi3 and apparently a couple files in the mysensors folder needed to be edited. Now since you use vera when building the sensors are you making any special edits or just using defaults from the sketches. I see some people have sleep times and other small adjustments.

    Vera

  • Vera and rpi3 setup that worked for me
    S stress nero

    After looking for days asking and questions in the forums i finally got my rpi3 and vera ui7 setup properly with working inclusion button.
    1.use the master branch
    2. Before you add your ./configure settings ( dont include--my-gateway=ethernet --my-controller-url-address=) or u will prob get ethernet connect error).
    use putty and do sudo nano /home/pi/MySensors/configure
    then scroll down to function detect_machine and change it to match the settings below. link below were i found the info.
    link text

    function detect_machine {
    ...
        case $hardware in
    ...
        BCM2835)
            soc="BCM2835"
            if [[ $machine == "Raspberry"* ]]; then
                local rev=($(detect_rpi_revision))
                if [[ $rev == "a02082" || $rev == "a22082" ]]; then
                    tp="RPi3"
                else
                    tp="Rpi2"
                fi
            fi
            ;;```
    
    

    If the radio is wired properly after you run make and sudo ./bin/mysgw -d you should get a success message like in the tutoriallink text
    3 To get the start/include button to work after you upload the files to vera from link text
    using putty again sudo nano /home/pi/MySensors/examples_linux/mysgw.cpp and add
    #define MY_INCLUSION_MODE_FEATURE after that reboot and it should work. forgot where i found the info.

    Vera

  • ESP8266 and Start inclusion doesnt work
    S stress nero

    when i use that library i cant get the it to run it always fails after make but it runs when i use the beta? can you post your steps also for the ip address we supposed to use the veras ip correct?

    Vera

  • ESP8266 and Start inclusion doesnt work
    S stress nero

    I am having the same issue with RPI 3 ethernet gateway, vera says connected but nothing happens when i hit the pair button, also MYScontroller i see sensor and they talking so i think the gateway and sensors are working.

    Vera

  • TMT6000
    S stress nero

    @stress-nero the light values was fixed bad jump wire position,
    ![alt text](0_1500037741362_upload-bc52de37-cdbc-47f8-aed4-288746977651 image url)

    Troubleshooting

  • TMT6000
    S stress nero

    @mfalkvidd it's a ambient light sensor. I was going to use a esp8266 with these to make a 5in1 node inspired by a video i saw with just header wires , but decided to use arduino nano instead. What i posted seems to work ok but being brand new i figure i would let someone else take a look and see if everything was ok with what i have so far or if i could make it better.
    https://www.sparkfun.com/products/8348

    Troubleshooting

  • TMT6000
    S stress nero

    @mfalkvidd the one in development when i posted i did not realize that it was under development, and can you help me sorting the tmt6000 sersor out for the sketch.

    Troubleshooting

  • TMT6000
    S stress nero

    @stress-nero said in TEMT6000:

    Hello first time user here, I have been trying to build a 4in1 light, motion, tem/hum using a nano, temt6000, dht22, and sr501 using the examples and already made sketches i can combine everything, but i am not sure if i am entering the info for the temt6000 correctly. Can someone take a look please```
    Insert Code Here

    
    // Enable and select radio type attached
    #define MY_RADIO_NRF24
    //#define MY_RADIO_RFM69
    
    #include <SPI.h>
    #include <MySensors.h>  
    #include <DHT.h>
    
    #define CHILD_ID_HUM 0
    #define CHILD_ID_TEMP 1
    #define CHILD_ID_MOTION 2
    #define CHILD_ID_LIGHT 3
    
    #define LIGHT_SENSOR_ANALOG_PIN 0
    int lastLightLevel;
    
    #define HUMIDITY_SENSOR_DIGITAL_PIN 4
    
    #define DIGITAL_INPUT_SENSOR 2   // The digital input you attached your motion sensor.  (Only 2 and 3 generates interrupt!)
    
    
    DHT dht;
    float lastTemp;
    float lastHum;
    boolean metric = false; 
    
    unsigned long interval= 3000;//dht.getMinimumSamplingPeriod(); // the time we need to wait
    unsigned long previousMillis=0; // millis() returns an unsigned long.
    unsigned long SLEEP_TIME = 120000; // Sleep time between reports (in milliseconds)
    
    MyMessage msgHum(CHILD_ID_HUM, V_HUM);
    MyMessage msgTemp(CHILD_ID_TEMP, V_TEMP);
    MyMessage msgMot(CHILD_ID_MOTION, V_TRIPPED);
    MyMessage msg(CHILD_ID_LIGHT, V_LIGHT_LEVEL);
    uint16_t lastlux;
    
    void setup()  
    { 
      dht.setup(HUMIDITY_SENSOR_DIGITAL_PIN); 
    
     // metric = getConfig().isMetric;
    
     pinMode(DIGITAL_INPUT_SENSOR, INPUT);      // sets the motion sensor digital pin as input
     }
    
    void presentation()  
    { 
      // Send the Sketch Version Information to the Gateway
      sendSketchInfo("4-1 Sensor", "1.0");
    
      // Register all sensors to gw (they will be created as child devices)
      present(CHILD_ID_HUM, S_HUM);
      present(CHILD_ID_TEMP, S_TEMP);
      present(CHILD_ID_MOTION, V_TRIPPED);
      present(CHILD_ID_LIGHT, S_LIGHT_LEVEL);
    }
    
    void loop()      
    {  
      // Read digital motion value
      boolean tripped = digitalRead(DIGITAL_INPUT_SENSOR) == HIGH;
       
    // only run loop if time has passed. 
    unsigned long currentMillis = millis(); // grab current time       
    
     // check if "interval" time has passed
     if ((unsigned long)(currentMillis - previousMillis) >= interval) {
    
     
           send(msgMot.set(tripped?"1":"0")); 
                  
      
          #ifdef MY_DEBUG
           Serial.print("Motion: ");
           Serial.println(tripped);
          #endif
    
    
    
     
      
      // Fetch temperatures from DHT sensor
      float temperature = dht.getTemperature();
      if (isnan(temperature)) {
          Serial.println("Failed reading temperature from DHT");
      } else if (temperature != lastTemp) {
        lastTemp = temperature;
        if (!metric) {
          temperature = dht.toFahrenheit(temperature);
        }
        send(msgTemp.set(temperature, 1));
        #ifdef MY_DEBUG
        Serial.print("T: ");
        Serial.println(temperature);
        #endif
      }
     
      // Fetch humidity from DHT sensor
      float humidity = dht.getHumidity();
      if (isnan(humidity)) {
          Serial.println("Failed reading humidity from DHT");
      } else if (humidity != lastHum) {
          lastHum = humidity;
          send(msgHum.set(humidity, 1));
          #ifdef MY_DEBUG
          Serial.print("H: ");
          Serial.println(humidity);
          #endif
      }   
     // Read lux from TEMT6000
      float lightLevel = analogRead(LIGHT_SENSOR_ANALOG_PIN) *  9.;  // 1000/1024
      if (int(lightLevel - lastLightLevel) > 10 || int(lastLightLevel - lightLevel) > 10) {
          send(msg.setSensor(CHILD_ID_LIGHT).set(lightLevel,1));
          lastLightLevel = lightLevel;
     }
    
       // save the "current" time
       previousMillis = millis();
    
     }  
    
      // Sleep until interrupt comes in on motion sensor. Send update every two minute.
      //sleep(digitalPinToInterrupt(DIGITAL_INPUT_SENSOR), CHANGE, SLEEP_TIME);
    
    }
    

    0_1499978821740_upload-a3bebffe-d25d-49db-8ffb-1a043392c708

    sorry for the double post.

    Troubleshooting

  • TEMT6000
    S stress nero

    @stress-nero do the v light levels values look good or am i missing something?

    Development

  • TEMT6000
    S stress nero

    Hello first time user here, I have been trying to build a 4in1 light, motion, tem/hum using a nano, temt6000, dht22, and sr501 using the examples and already made sketches i can combine everything, but i am not sure if i am entering the info for the temt6000 correctly. Can someone take a look please```
    Insert Code Here

    
    // Enable and select radio type attached
    #define MY_RADIO_NRF24
    //#define MY_RADIO_RFM69
    
    #include <SPI.h>
    #include <MySensors.h>  
    #include <DHT.h>
    
    #define CHILD_ID_HUM 0
    #define CHILD_ID_TEMP 1
    #define CHILD_ID_MOTION 2
    #define CHILD_ID_LIGHT 3
    
    #define LIGHT_SENSOR_ANALOG_PIN 0
    int lastLightLevel;
    
    #define HUMIDITY_SENSOR_DIGITAL_PIN 4
    
    #define DIGITAL_INPUT_SENSOR 2   // The digital input you attached your motion sensor.  (Only 2 and 3 generates interrupt!)
    
    
    DHT dht;
    float lastTemp;
    float lastHum;
    boolean metric = false; 
    
    unsigned long interval= 3000;//dht.getMinimumSamplingPeriod(); // the time we need to wait
    unsigned long previousMillis=0; // millis() returns an unsigned long.
    unsigned long SLEEP_TIME = 120000; // Sleep time between reports (in milliseconds)
    
    MyMessage msgHum(CHILD_ID_HUM, V_HUM);
    MyMessage msgTemp(CHILD_ID_TEMP, V_TEMP);
    MyMessage msgMot(CHILD_ID_MOTION, V_TRIPPED);
    MyMessage msg(CHILD_ID_LIGHT, V_LIGHT_LEVEL);
    uint16_t lastlux;
    
    void setup()  
    { 
      dht.setup(HUMIDITY_SENSOR_DIGITAL_PIN); 
    
     // metric = getConfig().isMetric;
    
     pinMode(DIGITAL_INPUT_SENSOR, INPUT);      // sets the motion sensor digital pin as input
     }
    
    void presentation()  
    { 
      // Send the Sketch Version Information to the Gateway
      sendSketchInfo("4-1 Sensor", "1.0");
    
      // Register all sensors to gw (they will be created as child devices)
      present(CHILD_ID_HUM, S_HUM);
      present(CHILD_ID_TEMP, S_TEMP);
      present(CHILD_ID_MOTION, V_TRIPPED);
      present(CHILD_ID_LIGHT, S_LIGHT_LEVEL);
    }
    
    void loop()      
    {  
      // Read digital motion value
      boolean tripped = digitalRead(DIGITAL_INPUT_SENSOR) == HIGH;
       
    // only run loop if time has passed. 
    unsigned long currentMillis = millis(); // grab current time       
    
     // check if "interval" time has passed
     if ((unsigned long)(currentMillis - previousMillis) >= interval) {
    
     
           send(msgMot.set(tripped?"1":"0")); 
                  
      
          #ifdef MY_DEBUG
           Serial.print("Motion: ");
           Serial.println(tripped);
          #endif
    
    
    
     
      
      // Fetch temperatures from DHT sensor
      float temperature = dht.getTemperature();
      if (isnan(temperature)) {
          Serial.println("Failed reading temperature from DHT");
      } else if (temperature != lastTemp) {
        lastTemp = temperature;
        if (!metric) {
          temperature = dht.toFahrenheit(temperature);
        }
        send(msgTemp.set(temperature, 1));
        #ifdef MY_DEBUG
        Serial.print("T: ");
        Serial.println(temperature);
        #endif
      }
     
      // Fetch humidity from DHT sensor
      float humidity = dht.getHumidity();
      if (isnan(humidity)) {
          Serial.println("Failed reading humidity from DHT");
      } else if (humidity != lastHum) {
          lastHum = humidity;
          send(msgHum.set(humidity, 1));
          #ifdef MY_DEBUG
          Serial.print("H: ");
          Serial.println(humidity);
          #endif
      }   
     // Read lux from TEMT6000
      float lightLevel = analogRead(LIGHT_SENSOR_ANALOG_PIN) *  9.;  // 1000/1024
      if (int(lightLevel - lastLightLevel) > 10 || int(lastLightLevel - lightLevel) > 10) {
          send(msg.setSensor(CHILD_ID_LIGHT).set(lightLevel,1));
          lastLightLevel = lightLevel;
     }
    
       // save the "current" time
       previousMillis = millis();
    
     }  
    
      // Sleep until interrupt comes in on motion sensor. Send update every two minute.
      //sleep(digitalPinToInterrupt(DIGITAL_INPUT_SENSOR), CHANGE, SLEEP_TIME);
    
    }
    

    0_1499978821740_upload-a3bebffe-d25d-49db-8ffb-1a043392c708

    Development
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular