Just wondering, any of you guys looked into touch switches like below 
jeylites
Posts
-
In wall light switch node - Custom PCB -
[SOLVED] Gateway as a sensor node in v1.6Should a Repeater have it's on unique ID or the same ID as the NODE that it's repeating?
-
Repeater and the routingShould a Repeater have it's on ID or the same ID as the NODE that it's repeating?
-
Replacing Radio with ESP8266 on Nodes and GatewayAnyone here knows if we could replace NRF24L01+ or RFM69 radio to an ESP8266, both on Gateway and Nodes?
-
Array Relay Button ActuatorThe following sketch has got what you're looking for. Hope that helps.
Relay With Actuator Switch Toggle
#include <MySensor.h> #include <SPI.h> #include <Bounce2.h> #define RELAY_ON 0 // switch around for realy HIGH/LOW state #define RELAY_OFF 1 MySensor gw; #define RADIO_ID 11 // Radio ID, whatever channel you assigned to #define noRelays 6 const int relayPin[] = {A0, A1, A2, A3, A4, A5}; const int buttonPin[] = {3, 4, 5, 6, 7, 8}; class Relay // relay class, store all relevant data (equivalent to struct) { public: int buttonPin; // physical pin number of button int relayPin; // physical pin number of relay byte oldValue; // last Values for key (debounce) boolean relayState; // relay status (also stored in EEPROM) }; Relay Relays[noRelays]; Bounce debouncer[noRelays]; MyMessage msg[noRelays]; void setup(){ gw.begin(incomingMessage, RADIO_ID, true); delay(250); gw.sendSketchInfo("MultiRelayButton", "0.9b"); delay(250); // Initialize Relays with corresponding buttons for (int i = 0; i < noRelays; i++){ Relays[i].buttonPin = buttonPin[i]; // assign physical pins Relays[i].relayPin = relayPin[i]; msg[i].sensor = i; // initialize messages msg[i].type = V_LIGHT; debouncer[i] = Bounce(); // initialize debouncer debouncer[i].attach(buttonPin[i]); debouncer[i].interval(5); pinMode(Relays[i].buttonPin, INPUT_PULLUP); pinMode(Relays[i].relayPin, OUTPUT); Relays[i].relayState = gw.loadState(i); // retrieve last values from EEPROM digitalWrite(Relays[i].relayPin, Relays[i].relayState? RELAY_ON:RELAY_OFF); // and set relays accordingly gw.send(msg[i].set(Relays[i].relayState? true : false)); // make controller aware of last status gw.present(i, S_LIGHT); // present sensor to gateway delay(250); } } void loop() { gw.process(); for (byte i = 0; i < noRelays; i++){ debouncer[i].update(); byte value = debouncer[i].read(); // if (value != Relays[i].oldValue && value == 0){ if (value != Relays[i].oldValue){ Relays[i].relayState = !Relays[i].relayState; digitalWrite(Relays[i].relayPin, Relays[i].relayState?RELAY_ON:RELAY_OFF); gw.send(msg[i].set(Relays[i].relayState? true : false)); gw.saveState( i, Relays[i].relayState );} // save sensor state in EEPROM (location == sensor number) Relays[i].oldValue = value; } } // process incoming message void incomingMessage(const MyMessage &message){ if (message.type == V_LIGHT){ if (message.sensor <noRelays){ // check if message is valid for relays..... previous line if [[[ (message.sensor <=noRelays){ ]]] Relays[message.sensor].relayState = message.getBool(); digitalWrite(Relays[message.sensor].relayPin, Relays[message.sensor].relayState? RELAY_ON:RELAY_OFF); // and set relays accordingly gw.saveState( message.sensor, Relays[message.sensor].relayState ); // save sensor state in EEPROM (location == sensor number) } } } -
In wall light switch node - Custom PCBNice work so far. I had a similar idea to use Binary Switch to turn ON/OFF my relays and lights but I had to discard the idea after going through several issues. Occasionally my serial gateway would fail to connect to the Vera and it would paralyze all my lightings. Essentially the Binary switches talk's to the Relays by going through the gateway. So decided to redesign the electronics to accommodate Relay with Button Actuator Sketch. If you lose the gateway, you could still bet that it would work though I wouldn't say it's 100% reliable but it gets the job done. Lately, I'm also exploring other avenues to somehow use www.Souliss.net concepts on MySensor and I was informed that My sensor Ver 2.0 Beta has got something similar by using ESP8266. I don't know how much of this is true but I'm pretty sure @hek will be able to explain.
-
New to this and frustrated with the arduino IDEOut of curiosity, what version Arduino are you running? I ran version 1.0.6 without any problems. I only have an issue on 1.6.7. It looks like 1.6.7 manages library differently.
-
New to this and frustrated with the arduino IDEAfter checking, I notice there are two library folder. There is one in My Documents and another in Program Files - Arduino - library. Which MY Sensor files need to go into which folder?
-
New to this and frustrated with the arduino IDEThanks guys, I'm going to give a third try.
-
New to this and frustrated with the arduino IDEWhere do you have to install MY Sensor library? I have downloaded Arduino-Master and copied all the files into Arduino Library but its not working.
-
Mysensors stopped working on Vera@msebbe Mine's been abruptly going offline 3 versions ago. Are all your sensors and gateway running Ver 1.5?
You mind giving me a little more info on your setup eg:
Version,
Hardware,
Radio Distance,
Kind of PSU.This is my setup. I have about 20 relay sensors placed in an area with activated repeater mode. I don't know if it's advisable to set up repeater mode in this manner when these sensors are between 10 and 50 ft apart. From gateway to sensors they range between 30 and 100 ft.
Out of 20 relay sensors, 5 of them take turns to abruptly go offline.
-
Mysensors stopped working on VeraI'm having the same issue too and I don't know what is going on. I tried a few things like rebooting Vera, Gateway & Nodes, it temporarily fixes it, but some nodes go offline a few days later. This has been going on a for months.
Vera Model: Vera Edge Ui7
Vera version: 1.7.1598Gateway: Ver 1.4
Nodes: Ver 1.5 -
Multi Binary Switches@Cowboy1980 Can you post your script...
-
Array Relay Button ActuatorI don't think it matters. You could try flip "gw.send & gw.present" and see how it respond to the change.
-
Array Relay Button Actuator@rainair, I tested it and it works! Thanks!!!
-
Multimeter SensorI have a few chores to accomplish but will keep your thoughts in mind.
-
Multimeter SensorNice all in one! something to look at.
-
Multimeter Sensor@NeverDie , Will check that out. Thank you!
-
Multimeter Sensor@NeverDie , do you have a link? :smiley:
-
Help!!! Binary & Relay Compilation Not WorkingI'm going to try fix it as suggested. But the thing is it complies....