Navigation

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

    Topics created by TommySharp

    • TommySharp

      Sound Level Sensor?
      Hardware • • TommySharp  

      1
      0
      Votes
      1
      Posts
      530
      Views

      No one has replied

    • TommySharp

      Looking for a suitable "pinhole" type push to reset button
      Hardware • • TommySharp  

      2
      0
      Votes
      2
      Posts
      888
      Views

      mfalkvidd

      The first link in https://forum.mysensors.org/topic/4235/nice-push-buttons should do the trick, and the ones called "tact switches" further down in that thread.
    • TommySharp

      Help parsing a string to grab a value?
      General Discussion • • TommySharp  

      4
      1
      Votes
      4
      Posts
      1183
      Views

      TommySharp

      Thanks for your help guys! I got it resolved....
    • TommySharp

      Count people entering/leaving a shop?
      General Discussion • • TommySharp  

      2
      0
      Votes
      2
      Posts
      811
      Views

      Boots33

      I used a cheap ebay infrared door minder in my parking sensor it seems to work very well for the price.
    • TommySharp

      Retrofit sensors into 240v LED Night Light : Help a novice?
      My Project • • TommySharp  

      7
      0
      Votes
      7
      Posts
      1978
      Views

      SuperKris

      The kind of "PSU" thats is in that night light is not ideal for a mysensors application. I suggest you use this one: https://www.domoticz.com/forum/viewtopic.php?f=42&t=7832 I think using the housing is a good idea, but please throw away those electronics. Here in the netherlands we have a cheap ass store called "Action" where they sell those 433mhz controlled remote plug in switches. You get 3 of them + a remote control for just € 10,-. I think they can be a pretty good housing too.
    • TommySharp

      Pulse Power Meter with OpenHAB?
      OpenHAB • • TommySharp  

      7
      0
      Votes
      7
      Posts
      4886
      Views

      mbj

      @joseraj Yes, the V_VAR2 solution works well. I have used it for a long time. Of course it is possible to modify the sketch so that no request for a start value is made and always start at 0. But I like the idea of getting a start value from the controller when it is needed to restart the node.
    • TommySharp

      Can we run two gateways at once?
      General Discussion • • TommySharp  

      2
      0
      Votes
      2
      Posts
      1080
      Views

      mfalkvidd

      Yes you can. They need to use different radio channels (modify MyConfig.h), but that's it. Just add the new gw in your controller.
    • TommySharp

      Help work out correct MQTT message to activate relay
      General Discussion • • TommySharp  

      11
      0
      Votes
      11
      Posts
      3462
      Views

      TommySharp

      Awesome! I'd much rather use a client gateway so might just hold off until the next release of MySensors and then use the MQTT Client Gateway.
    • TommySharp

      1.4 Gateway and 1.5 Sensors?
      General Discussion • • TommySharp  

      3
      0
      Votes
      3
      Posts
      1000
      Views

      m26872

      Luckily it works great since my controller (fhem) not yet support EthGw v1.5.
    • TommySharp

      Power Meter Pulse Sensor : Help with example script?
      Development • • TommySharp  

      2
      0
      Votes
      2
      Posts
      1298
      Views

      epierre

      some posts from Domoticz: https://www.domoticz.com/forum/viewtopic.php?f=42&t=7282 V_VAR1 https://www.domoticz.com/forum/viewtopic.php?f=42&t=8229 http://www.domoticz.com/forum/viewtopic.php?f=21&t=5027&start=60 V_TEXT http://domoticz.com/forum/viewtopic.php?t=6517&p=52663
    • TommySharp

      Combine Relay Actuator (with button) and BinarySwitch examples?
      My Project • • TommySharp  

      7
      0
      Votes
      7
      Posts
      4915
      Views

      Sander Stolk

      Well well well... I've got it working with 2 relays and 2 door sensors. See my sketch below! The problem is the relays which are configured by counting and adding up numbers and the child_id's for 1 button and the debouncer missing config in the skecth. With this sketch you can monitor 2 doors and 2 relays // Example sketch showing how to control physical relays. // This example will remember relay state even after power failure. #include <MySensor.h> #include <SPI.h> #include <Bounce2.h> #define RELAY_1 4 // Arduino Digital I/O pin number for first relay (second on pin+1 etc) #define NUMBER_OF_RELAYS 2 // 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 BUTTON_PIN_1 3 // Arduino Digital I/O pin for button/reed switch #define BUTTON_PIN_2 8 // Arduino Digital I/O pin for button/reed switch MySensor gw; Bounce debouncer_1 = Bounce(); Bounce debouncer_2 = Bounce(); int oldValue_1=-1; int oldValue_2=-1; MyMessage msgGK(BUTTON_PIN_1,V_TRIPPED); MyMessage msgGD(BUTTON_PIN_2,V_TRIPPED); 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("Garagebox", "1.0"); // 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); } // Setup the doorsensor //pinMode(BUTTON_PIN,INPUT); // Activate internal pull-up //digitalWrite(BUTTON_PIN,HIGH); pinMode(BUTTON_PIN_1,INPUT); // Activate internal pull-up digitalWrite(BUTTON_PIN_1,HIGH); pinMode(BUTTON_PIN_2,INPUT); // Activate internal pull-up digitalWrite(BUTTON_PIN_2,HIGH); // After setting up the button, setup debouncer //debouncer.attach(BUTTON_PIN); //debouncer.interval(5); debouncer_1.attach(BUTTON_PIN_1); debouncer_1.interval(5); debouncer_2.attach(BUTTON_PIN_2); debouncer_2.interval(5); // Register binary input sensor to gw (they will be created as child devices) // You can use S_DOOR, S_MOTION or S_LIGHT here depending on your usage. // If S_LIGHT is used, remember to update variable type you send in. See "msg" above. gw.present(BUTTON_PIN_1, S_DOOR); gw.present(BUTTON_PIN_2, S_DOOR); } // Check if digital input has changed and send in new value void loop() { // Alway process incoming messages whenever possible gw.process(); debouncer_1.update(); // Get the update value int value_1 = debouncer_1.read(); if (value_1 != oldValue_1) { // Send in the new value gw.send(msgGK.set(value_1==HIGH ? 1 : 0)); oldValue_1 = value_1; } debouncer_2.update(); // Get the update value int value_2 = debouncer_2.read(); if (value_2 != oldValue_2) { // Send in the new value gw.send(msgGD.set(value_2==HIGH ? 1 : 0)); oldValue_2 = value_2; } } 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()); } }