Navigation

    • Register
    • Login
    • OpenHardware.io
    • Categories
    • Recent
    • Tags
    • Popular
    1. Home
    2. Tomasz Pazio
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    Tomasz Pazio

    @Tomasz Pazio

    2
    Reputation
    33
    Posts
    680
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    Tomasz Pazio Follow

    Best posts made by Tomasz Pazio

    • RE: Humidity, temperature, motion and bunch of relays...

      @BulldogLowell works fine with this 🙂 thanks for support.

      posted in Troubleshooting
      Tomasz Pazio
      Tomasz Pazio
    • RE: Need idea for turn off speakers when tv is off

      Ok solution is now live 🙂
      PowerNode from GreenWave with power monitoring.
      I'm monitoring power consumption on DVBT reciever. When it goes up from idle, tv and speakers turn on, when goes to idle consumption it turn off all 🙂

      posted in General Discussion
      Tomasz Pazio
      Tomasz Pazio

    Latest posts made by Tomasz Pazio

    • RE: Fibaro HC2 Virtual Device Gateway

      Any progress on this topic? Fibaro have good controller, it would be interesting to have it fully integrated with Mysensors.

      posted in Controllers
      Tomasz Pazio
      Tomasz Pazio
    • RE: My Slim 2AA Battery Node

      @m26872 thanks for advice, bootloader burned on IDE 1.0.x and after that, sketches are uploaded properly on 1.6.x.

      One more question, how it should report battery state? I can not see any variable created for this in Vera.

      posted in My Project
      Tomasz Pazio
      Tomasz Pazio
    • RE: My Slim 2AA Battery Node

      Hi, I build the board but I still have issues with burning ATMega328p chip.
      Can you describe and attach files that should work?
      The only success "burn" I had with burning bootloader was with hex and boards entry from first post using arduino uno and ips programer ( so it is like burning uno bootloader with your setup)
      After that I was trying to upload sketch but than it was not possible because of "?# in boards file but there is no such sign.
      I rewert file to stock and burn sketch like it would be standard uno board but using programer and not standard usb. No idea if it is corect so that is why I ask for more details.
      Thank you in advance
      Tomasz

      posted in My Project
      Tomasz Pazio
      Tomasz Pazio
    • RE: Need idea for turn off speakers when tv is off

      Ok solution is now live 🙂
      PowerNode from GreenWave with power monitoring.
      I'm monitoring power consumption on DVBT reciever. When it goes up from idle, tv and speakers turn on, when goes to idle consumption it turn off all 🙂

      posted in General Discussion
      Tomasz Pazio
      Tomasz Pazio
    • Need idea for turn off speakers when tv is off

      I have some idea to turn off speakers connected to power when tv turn off.
      I was thinking about ping tv/reciever and when off than simple relay switch.. but... tv has no LAN and recieever do not support ping reply.
      Any idea how to make it happen? Power consumption monitoring?

      posted in General Discussion
      Tomasz Pazio
      Tomasz Pazio
    • RE: Humidity, temperature, motion and bunch of relays...

      @BulldogLowell works fine with this 🙂 thanks for support.

      posted in Troubleshooting
      Tomasz Pazio
      Tomasz Pazio
    • RE: Humidity, temperature, motion and bunch of relays...

      @Dwalt think that I undersand the idea but no idea how to write this in code, google gives a lot of examples but hard for me to code this 😞

      posted in Troubleshooting
      Tomasz Pazio
      Tomasz Pazio
    • RE: Humidity, temperature, motion and bunch of relays...

      Sorry I was to fast. I have problem with second "array" or sensors, first is working on pins 14-17 so analog. Second part should work on pins 5-8 but I have no idea how to make this. All works fine now but on 4 relays, I need to add 4 more.

      posted in Troubleshooting
      Tomasz Pazio
      Tomasz Pazio
    • Humidity, temperature, motion and bunch of relays...

      Hi everybody,
      I'm trying to have a sketch for my leaving room which should have 8 relays, humidity, temperature and motion sensors.
      I was able to merge few sketches to one and it works fine with 4 relays but i have problem with second "array" or sensors
      this is my working sketch

      #include <MySensor.h>
      #include <SPI.h>
      #include <Wire.h>
      #include <DHT.h>
      #include <SimpleTimer.h>
      #define CHILD_ID_HUM 20
      #define CHILD_ID_TEMP 21
      #define CHILD_ID_MOTION 22
      
      #define RELAY_1  14  // Arduino Digital I/O pin number for first relay (second on pin+1 etc)
      #define NUMBER_OF_RELAYS 4 // Total number of attached relays
      #define RELAY_ON 0  // GPIO value to write to turn on attached relay
      #define RELAY_OFF 1 // GPIO value to write to turn off attached relay
      #define HUMIDITY_SENSOR_DIGITAL_PIN 19
      #define MOTION_SENSOR_DIGITAL_PIN 3
      #define INTERRUPT MOTION_SENSOR_DIGITAL_PIN-2 // Usually the interrupt = pin -2 (on uno/nano anyway)
      unsigned long SLEEP_TIME = 600000; // Sleep time between reads (in milliseconds) - 10mins
      
      MySensor gw;
      DHT dht;
      SimpleTimer timer;
      
      float lastTemp;
      float lastHum;
      boolean lastTripped;
      boolean metric = true;
      
      MyMessage msgHum(CHILD_ID_HUM, V_HUM);
      MyMessage msgTemp(CHILD_ID_TEMP, V_TEMP);
      MyMessage msg(CHILD_ID_MOTION, V_TRIPPED);
      
      
      void setup()  
      {   
        // Initialize library and add callback for incoming messages
        gw.begin(incomingMessage, AUTO, true);
        
        dht.setup(HUMIDITY_SENSOR_DIGITAL_PIN); 
        // Send the sketch version information to the gateway and Controller
        gw.sendSketchInfo("HumTempRelayMotion", "1.4");
         // Register all sensors to gw 
          gw.present(CHILD_ID_HUM, S_HUM);
          gw.present(CHILD_ID_TEMP, S_TEMP);
          gw.present(CHILD_ID_MOTION, S_MOTION);
        // Fetch relay status
         for (int sensor=1, pin=RELAY_1; sensor<=NUMBER_OF_RELAYS;sensor++, pin++) {
          // Register all sensors to gw (they will be created as child devices)
          gw.present(sensor, S_LIGHT);
          // Then set relay pins in output mode
          pinMode(pin, OUTPUT);   
          // Set relay to last known state (using eeprom storage) 
          digitalWrite(pin, gw.loadState(sensor)?RELAY_ON:RELAY_OFF);
      
      }
        //Serial.begin(9600);
        timer.setInterval(30000, getMeasure);
        metric = gw.getConfig().isMetric;
      
      }
      
      void loop() 
      {
        // Alway process incoming messages whenever possible
        gw.process();
        timer.run();
      
        boolean tripped = digitalRead(MOTION_SENSOR_DIGITAL_PIN) == HIGH;    
        if (tripped != lastTripped) {
          lastTripped = tripped;
          Serial.print("M: ");
          Serial.println(tripped);
          gw.send(msg.set(tripped?"1":"0"));  // Send tripped value to gw
         }
      }
      
      void incomingMessage(const MyMessage &message) {
        // We only expect one type of message from controller. But we better check anyway.
        if (message.type==V_LIGHT) {
           // Change relay state
           digitalWrite(message.sensor-1+RELAY_1, message.getBool()?RELAY_ON:RELAY_OFF);
           // Store state in eeprom
           gw.saveState(message.sensor, message.getBool());
           // Write some debug info
           Serial.print("Incoming change for sensor:");
           Serial.print(message.sensor);
           Serial.print(", New status: ");
           Serial.println(message.getBool());
         } 
      }
      void getMeasure() {
        delay(dht.getMinimumSamplingPeriod());
      
        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);
          }
          gw.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;
            gw.send(msgHum.set(humidity, 1));
            Serial.print("H: ");
            Serial.println(humidity);
              }
      }
      
      
      posted in Troubleshooting
      Tomasz Pazio
      Tomasz Pazio
    • RE: Relay / Motion Multisensor

      Guys, I would like to use this sketch with dht but on Uno and with 8 relays and use analog pins...
      Should I Just change part:

      #define RELAY 8
      To
      #define RELAY A0
      ?

      posted in My Project
      Tomasz Pazio
      Tomasz Pazio