Duh! THANK YOU for such a fast answer. Just restarted a couple of my nodes and they're now appearing. Was banging my head on this for an hour last night because I didn't think of something so obvious.
timropp
@timropp
Best posts made by timropp
-
RE: Ethernet gateway working, but no devices showing up
-
RE: How To - Doorbell Automation Hack
So got my doorbell up and working. Here's the details: I used the mini RBoard and it's working out great.
I soldered the cap directly onto the nrf board. Unfortunately, that board overhangs the A0 connections on the rboard (there's 2 pins there, one is the A0 pin and one is a ground). Thankfully, it only ACTUALLY covered the ground, so it was easy to work around. The brown wire in the photo is the wire I have connected to the A0 pin. The green wire is a temp wire I was connecting to the ground in the serial connections.
In the doorbell, I cut away one of the panels over one of the resonant chambers since I saw that the module would fit in there perfectly. I then wired it up and tucked it away. I did lose a little volume since the chamber is filled rather than resonating, but it's worth it to have the doorbell notifying my Vera system. That can flash lights and so forth to notify us other ways - we couldn't usually hear the doorbell when downstairs anyway.
Code wise, I used the original code above with just a couple minor changes. I set the doorbell_pin to A0, the relay_pin to 4, and the node_ID to auto. I also set it to act as a repeater since it's hardwired to power. Now that I have it working, I wish I'd changed the ringTime to a lower value since 7/10 of a second is way longer than the doorbell normally takes between the two notes, but it's not a big deal. Not worth pulling the board out, disconnecting it, reprogramming it, and reinstalling everything
-
RE: How To - Doorbell Automation Hack
It's definitely the illuminated button. I pulled it out and connecting the wires rings the bell correctly. I hadn't thought about swapping the wires... It is pretty new but I wasn't considering the possibility of it being led. I'll give that a try. Worst case, replace it with a non lit button. Just glad to have finally figured it out!
edit: actually, I'm betting it's not a LED. These buttons are typically on a 16VAC system, so a LED wouldn't work without more components. Whereas a simple incandescent bulb works fine on AC. So I think I probably just need a new button.
Latest posts made by timropp
-
RE: How To - Doorbell Automation Hack
Final update - no local stores carry a non-illuminated doorbell button. Argh. So I ended up taking the button apart on mine, yanking the incandescent bulb out, and putting it back together. Since it's held together with just some bent over tabs, they broke off and I had to glue it back together. Once I did, everything worked perfectly. The sketch I posted above is working great - doorbell rings and the ring appears in my Home Assistant like it should.
-
RE: How To - Doorbell Automation Hack
It's definitely the illuminated button. I pulled it out and connecting the wires rings the bell correctly. I hadn't thought about swapping the wires... It is pretty new but I wasn't considering the possibility of it being led. I'll give that a try. Worst case, replace it with a non lit button. Just glad to have finally figured it out!
edit: actually, I'm betting it's not a LED. These buttons are typically on a 16VAC system, so a LED wouldn't work without more components. Whereas a simple incandescent bulb works fine on AC. So I think I probably just need a new button.
-
RE: How To - Doorbell Automation Hack
Ok, finally worked this again today. Here's the status. I modified the sketch to update it to 2.0, giving me this:
/* * The MySensors Arduino library handles the wireless radio link and protocol * between your home built sensors/actuators and HA controller of choice. * The sensors forms a self healing radio network with optional repeaters. Each * repeater and gateway builds a routing tables in EEPROM which keeps track of the * network topology allowing messages to be routed to nodes. * * Created by Henrik Ekblad <henrik.ekblad@mysensors.org> * Copyright (C) 2013-2015 Sensnology AB * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors * * Documentation: http://www.mysensors.org * Support Forum: http://forum.mysensors.org * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * version 2 as published by the Free Software Foundation. * ******************************* * * REVISION HISTORY * Version 1.0 - PeteWill * Version 2.0 - timropp, updating for MySensors 2.0 * * DESCRIPTION * This sketch is used to control a doorbell ring with a relay as well as send an * alert when the buttons is pressed. Connect the button to ground and digital * pin 3. The relay controlling the doorbell is conntected to pin 4. * * Watch the How To video here: https://youtu.be/nMIcalwpstc */ #define MY_RADIO_NRF24 #define MY_REPEATER_FEATURE #include <MySensors.h> #include <SPI.h> #include <Bounce2.h> #define NODE_ID AUTO // or set to AUTO if you want gw to assign a NODE_ID for you. #define DOORBELL_PIN A0 // Arduino Digital I/O pin number for the doorbell button #define RELAY_PIN 4 // Arduino Digital I/O pin number for the relay #define DOORBELL_CHILD_ID 0 //ID of the doorbell #define SWITCH_CHILD_ID 1 // Id of the switch that will control doorbell sound #define RELAY_ON 1 #define RELAY_OFF 0 Bounce debouncer = Bounce(); MyMessage switchMsg(SWITCH_CHILD_ID, V_LIGHT); MyMessage doorbellMsg(DOORBELL_CHILD_ID, V_TRIPPED); unsigned int doorbellDelay = 1000; // interval at which to keep the doorbell button sensor triggered (milliseconds). This is used to stop people (kids) from pressing it too often unsigned int ringTime = 400; //How long the doorbell relay is on (in milliseconds) unsigned long doorbellMillis; //Used to keep track of the last doorbell button press unsigned long doorbellTimer; //Used to keep track of doorbell ring time byte doorbellPreviousVal; //Used to keep track of doorbell button pressed state boolean ringDoorbell; //Used to initiate the ring doorbell if statement boolean doorbellSound; //Used to keep track if the doorbell should sound or be silent. Value recieved from doorbell on/off switch boolean doorbellOff = true; //Used to keep track of doorbell ring state void setup() { // Setup the button and activate internal pull-up pinMode(DOORBELL_PIN, INPUT_PULLUP); // After setting up the button, setup debouncer debouncer.attach(DOORBELL_PIN); debouncer.interval(5); // Make sure relays are off when starting up digitalWrite(RELAY_PIN, RELAY_OFF); // Then set relay pins in output mode pinMode(RELAY_PIN, OUTPUT); // Set doorbellSound to last known state (using eeprom storage) doorbellSound = loadState(SWITCH_CHILD_ID); } void loop() { unsigned long currentMillis = millis(); //Check to see if doorbell button was pushed. if (currentMillis - doorbellMillis > doorbellDelay) //used to stop doorbell from being pressed too frequently { debouncer.update(); // Read doorbell button value byte doorbellDetect = !debouncer.read();//read, then reverse the value so it will send correct trigger state to controller if (doorbellDetect != doorbellPreviousVal) { //Serial.print("doorbellDetect Value: "); //Serial.println(doorbellDetect); send(doorbellMsg.set(doorbellDetect)); if (doorbellDetect == 1) { ringDoorbell = true; doorbellTimer = currentMillis; } doorbellMillis = currentMillis; doorbellPreviousVal = doorbellDetect; } } if (ringDoorbell) { if (doorbellSound) { if (doorbellOff) { digitalWrite(RELAY_PIN, RELAY_ON); //Serial.println("Doorbell sounded."); doorbellOff = false; } else { if (currentMillis - doorbellTimer > ringTime) { ringDoorbell = false; digitalWrite(RELAY_PIN, RELAY_OFF); //Serial.println("Doorbell off."); doorbellOff = true; } } } } } void receive(const MyMessage &message) { // We only expect one type of message from controller. But we better check anyway. if (message.isAck()) { Serial.println("This is an ack from gateway"); } if (message.type == V_LIGHT) { // Change relay state doorbellSound = message.getBool(); // Store state in eeprom saveState(SWITCH_CHILD_ID, doorbellSound); // Write some debug info Serial.print("Incoming change for sensor:"); Serial.print(message.sensor); Serial.print(", New status: "); Serial.println(message.getBool()); } } void presentation() { // Send the sketch version information to the gateway and Controller sendSketchInfo("Doorbell Monitor", "1.0"); // Register all sensors to gw (they will be created as child devices) present(SWITCH_CHILD_ID, S_LIGHT); present(DOORBELL_CHILD_ID, S_MOTION); }
Sitting on my desk, it works fine. It appears in Home Assistant, clicks the relay when A0 is shorted to ground, and that appears in HASS as a motion event. Seems good, so I installed it in the doorbell. Doesn't work there. I get one ring when I hook up power, and then nothing. I checked again the leads from the physical doorbell button with a multimeter - I get a good continuity buzz when I press the button and silence when not pressed. Then I discovered something - if I physically unhook the wire going to A0 and reconnect it, the doorbell rings and I get that notification in Hass. If I unhook and reconnect the wire again, same thing. So that makes it appear that the A0 is being constantly grounded - is that possible? It acts like my physical doorbell button is stuck in the pressed position, but the multimeter indicates it's fine.
Further testing - If I connect the board to the doorbell system but leave the physical doorbell button disconnected, then attach a spare piece of wire to A0 and ground it, the system works perfectly. So it's definitely something related to the physical button.
On thing I've realized - I THINK the outdoor button is an illuminated one, which isn't illuminated with this system. Could that light be the cause? If so, why doesn't the continuity test show it as continuous? I think I'll go buy a basic non-illuminated button and install it and see if that works. Or just pull the button out of the wall, disconnect the wires, and then short them together. Duh, that'd be easier and cheaper. I'll try that this afternoon - have a wedding to get to first.
-
RE: How To - Doorbell Automation Hack
Yep, both those are on my to do list fo tonight. Thanks for your help troubleshooting!
-
RE: Sensebender Micro
Nope, didn't find the problem. Must be some solder that shorted the batteries out but I don't see it. Oh well... main problem is that was my only 2AA holder on hand, and it melted right through the end of it, so now I have to wait on more before I can try again. Bummer
-
RE: Sensebender Micro
Well that didn't go well... assembling my first micro. Soldered on some pins for the FTDI connection, added power (2xAA holder), and soldered on the radio with cap. Then I put in batteries and brought up my domoticz page to see if it showed up. Started to smell something, looked down, and there's smoke coming from the battery holder. Grabbed the whole thing and yanked the wire free then dropped it in the sink. Not sure where I screwed up, but I sure shorted something!
-
RE: How To - Doorbell Automation Hack
It's an ethernet gateway.
I don't think it's really a Mysensors issue though as I think about it - the doorbell should ring when you press the button whether you have the gateway running or not. And I'm not even getting that. In fact, I AM getting the signal to the gateway, but it's not activating the relay.
Is it possible that the doorbell on/off switch isn't working right in the code? I never used that before. I think I'll try tomorrow (kids in bed now, so can't really play around with a doorbell!) removing that switch for now and have it always set to on.
I looked through comparing the sketch I'm using now (the one drock1985 made that's for domoticz) and the original. The only change is moving the gw.send command and changing it slightly. But again, that shouldn't impact the bell physically working. So there's something else going on.
Is there a way to check if the code uploaded to the arduino correctly? I'm using the rboard and a FTDI to upload. I'm wondering if something isn't going weird there and it's not uploading correctly and that's why I'm getting different issues every time I try something...
-
RE: How To - Doorbell Automation Hack
Tried that sketch (with just changing pin assignments and flipping the relay high/low settings). As soon as I powered it up, the relay started clicking every 4 seconds and it never appeared in Domoticz. I think it's because after the pin is set to input, there's " digitalWrite(FRONT_DOOR_BUTTON, HIGH);" command that's like someone holding the button down.
Went back to the original sketch I used. I changed from an auto NODE_ID to a fixed setting in the defines and re-uploaded it. The device appeared in Domoticz correctly! I've got a "doorbell sketch 1.0" with 3 devices - repeater, the doorbell button as a S_Motion, and the doorbell on/off as a S_Lights.
However, it still doesn't work. My wiring is shown above and it worked great under Vera. Now, I cannot get the doorbell to actually chime. Nor does the outdoor button do anything. I've verified the wiring, but shorting the A0 pin to the ground input doesn't do anything like it should. However, there's ANOTHER ground next to the A0 (under the wireless card), and if I short the A0 to that ground pin, the switch shows on in Domoticz. I can change the wiring since for some reason which ground I use is making a difference.
No matter what, still no relay action though. I tried turning the doorbell on/off switch both ways and it made no difference. In either setting, shorting the two pins turns the switch in Domoticz on.
I was comparing the two sketches (the one I'm using, and the dual-bell one). The single bell sketch sets the button pin with pinmode(Doorbell_pin, input_pullup) where the dual uses input without the pullup. Which should be right?
-
RE: How To - Doorbell Automation Hack
Thanks, I'll give that a try. I don't have any need for the dual bell functionality, but we can see if it works and if so, then comment out the back bell part to simplify things.
-
RE: How To - Doorbell Automation Hack
I had my doorbell working fine on Vera for months, but now I'm switching over to Domoticz. I used the updated domoticz version of the code above (by drock1985) but it's still not working right. My only changes were the pin assignments to match my wiring and setting the repeater to true since it's powered.
My domoticz is version v3.4834. Mysensors ethernet gateway is working fine. When I powered up the doorbell, I got an unknown node with sketch "unknown" show up under mysensors. It has 2 children - a repeater with childID 255, and an unknown with childID 0 and a V_Tripped value.
Any idea what I need to do to make it work?