Have you considered creating / buying an RFlink to connect into your Domoticz system? You'd have to look into whether that model is supported by RFlink, but that approach would be a lot quicker and easier.
Posts made by mrwomble
-
RE: Help with hacking a wireless outdoor weather station
-
RE: Solar Powered Soil Moisture Sensor
@NeverDie
Interesting, but would make the project a little pricey. -
RE: HC-SR501 motion sensor
I've heard that these PIR sensors can get very sensitive when the battery level drops, so it's worth checking the status of those batteries or better yet, trying some new ones.
-
RE: What kind of sensor for my mailbox?
I'd suggest a magnetic reed switch. Have a look at the 'Door, window, button' sketch. You can trigger it on interrupt and get the node to sleep in between, so it should work well for battery.
-
RE: Relay and Light Node
Hi Marek,
What I've done in this situation is to introduce a time check instead of sleeping the node, since you need to keep it awake to listen for relay commands. I got my inspiration from Hek's RGB dimmer sketch.My code was for a gas sensor:
unsigned long currentTime = millis(); if (currentTime > lastTime + READ_DELAY_TIME) { lastTime = currentTime; readgassensor(); }
READ_DELAY_TIME is set to 30000 so that it waits 30s between reads (in your case, increase that to get 1min intervals).
This is not a super-precise way of doing it, but it's simple enough for regular sensor reads and seems to work for me.
Hope that helps!
-
RE: 💬 Temperature Sensor
@mfalkvidd said:
@toddsantoro see post 2 and 3 in this thread or read the instructions on the build page, just under the "Example" heading.
^ What he said
-
RE: 💬 Gas Sensor
Just a note for any Domoticz users who may try this sketch - it presents in the log, but is not available under 'Devices' to be added UNTIL it gets a reading > 0. My solution to that was to go put the node over the gas hob and let the gas run (unlit) for a few seconds so that it generated a reading
Remember kids, gas is dangerous, stay safe.
-
Mysensorised front door (doorbell, post-box)
I thought I'd share a recent project to mysensorise my front door by adding a doorbell sensor and postbox sensor. At the moment it just sends me a notification (via Telegram) when someone rings the front door or puts something through the postbox but I plan on getting a camera in the near future so it'll tie into that. I'm also thinking about creating a little node that will play sounds from an SD card when the doorbell is rung, so I can load it up with appropriately seasonal things like Halloween sound effects, Christmas jingles, etc.
So here's the doorbell as it originally was - a simple, old battery-based doorbell. You can see that the contacts had got corroded over the years so it was quite a pain to clean it out every now and then + replace batteries to make it work, so I've got the added benefit of it now being AC powered.
Here's the work in progress in the 'lab' (I use that term extremely loosely).
I used the door/window/switch sketch and extended it for the additional postbox sensor + made it a repeater node since it's AC powered.
Here it is all packed in.
Power is supplied via an old Nokia charger that was repurposed.
What was the hardest part of this little project, I hear you ask? Glueing the wiring up the wall in a neat enough way that my wife would never notice. So far, she hasn't said a thing, so I reckon I'm in the clear - it's all about the WAF with these things.
The code and circuit are nothing to write home about, but if anyone wants them, let me know.
Thanks once more to Hek and all the mods, hardware heros and contributors for this awesome site.
-
RE: Solar Powered Soil Moisture Sensor
I meant to mention that the wires coming out of the bottom are the wires that go to the soil moisture probes.
Here's the code in case anyone else would like it:
// Updated to v2.0 of Mysensors // Enable debug prints #define MY_DEBUG #define MY_RADIO_NRF24 #include <MySensors.h> #include <SPI.h> #define round(x) ((x)>=0?(long)((x)+0.5):(long)((x)-0.5)) #define N_ELEMENTS(array) (sizeof(array)/sizeof((array)[0])) #define CHILD_ID_MOISTURE 0 #define CHILD_ID_BATTERY 1 #define SLEEP_TIME 10000 // Sleep time between reads (in milliseconds), was 10000 #define THRESHOLD 1.1 // Only make a new reading with reverse polarity if the change is larger than 10%. #define STABILIZATION_TIME 1000 // Let the sensor stabilize before reading default BOD settings const int SENSOR_ANALOG_PINS[] = {A4, A5}; // Sensor is connected to these two pins. Avoid A3 if using ATSHA204. A6 and A7 cannot be used because they don't have pullups. // MySensor gw; //removed for v2.0 MyMessage msg(CHILD_ID_MOISTURE, V_HUM); MyMessage voltage_msg(CHILD_ID_BATTERY, V_VOLTAGE); long oldvoltage = 0; byte direction = 0; int oldMoistureLevel = -1; float batteryPcnt; float batteryVolt; int LED = 5; void setup() { pinMode(LED, OUTPUT); digitalWrite(LED, HIGH); delay(200); digitalWrite(LED, LOW); delay(200); digitalWrite(LED, HIGH); delay(200); digitalWrite(LED, LOW); // gw.begin(); //Removed for v2.0 for (int i = 0; i < N_ELEMENTS(SENSOR_ANALOG_PINS); i++) { pinMode(SENSOR_ANALOG_PINS[i], OUTPUT); digitalWrite(SENSOR_ANALOG_PINS[i], LOW); } } void presentation(){ //created for v2.0 sendSketchInfo("Plant moisture w solar", "1.0"); present(CHILD_ID_MOISTURE, S_HUM); delay(250); present(CHILD_ID_BATTERY, S_MULTIMETER); } void loop() { int moistureLevel = readMoisture(); // Send rolling average of 2 samples to get rid of the "ripple" produced by different resistance in the internal pull-up resistors // See http://forum.mysensors.org/topic/2147/office-plant-monitoring/55 for more information if (oldMoistureLevel == -1) { // First reading, save current value as old oldMoistureLevel = moistureLevel; } if (moistureLevel > (oldMoistureLevel * THRESHOLD) || moistureLevel < (oldMoistureLevel / THRESHOLD)) { // The change was large, so it was probably not caused by the difference in internal pull-ups. // Measure again, this time with reversed polarity. moistureLevel = readMoisture(); } send(msg.set((moistureLevel + oldMoistureLevel) / 2.0 / 10.23, 1)); oldMoistureLevel = moistureLevel; int sensorValue = analogRead(A0); Serial.print("--Sensor value:");Serial.println(sensorValue); float voltage=sensorValue*(3.3/1023); Serial.print("--Voltage:");Serial.println(voltage); batteryPcnt = (sensorValue - 248) * 0.72; Serial.print("--Battery %:");Serial.println(batteryPcnt); batteryVolt = voltage; sendBatteryLevel(batteryPcnt); resend((voltage_msg.set(batteryVolt, 3)), 10); //send(voltage_msg.set(batteryVolt), 3); //flash led to indicate send digitalWrite(LED, HIGH); delay(200); digitalWrite(LED, LOW); sleep(SLEEP_TIME); } void resend(MyMessage &msg, int repeats) { int repeat = 1; int repeatdelay = 0; boolean sendOK = false; send(msg); /* while ((sendOK == false) and (repeat < repeats)) { if (send(msg)) { sendOK = true; } else { sendOK = false; Serial.print("Error "); Serial.println(repeat); repeatdelay += 500; } repeat++; delay(repeatdelay); }*/ } int readMoisture() { pinMode(SENSOR_ANALOG_PINS[direction], INPUT_PULLUP); // Power on the sensor analogRead(SENSOR_ANALOG_PINS[direction]);// Read once to let the ADC capacitor start charging sleep(STABILIZATION_TIME); int moistureLevel = (1023 - analogRead(SENSOR_ANALOG_PINS[direction])); // Turn off the sensor to conserve battery and minimize corrosion pinMode(SENSOR_ANALOG_PINS[direction], OUTPUT); digitalWrite(SENSOR_ANALOG_PINS[direction], LOW); direction = (direction + 1) % 2; // Make direction alternate between 0 and 1 to reverse polarity which reduces corrosion return moistureLevel; }
My thanks to flopp for the cool idea and to everyone else on the thread for the contributions.
-
RE: Solar Powered Soil Moisture Sensor
Hi all, I was so impressed by this thread that I decided to build my own. I must have spent maybe £6 or so - I really pushed the boat out.
It's been running successfully for a few weeks now, so I thought I'd share my code and a few pics. I upgraded the original code to v2.0. I've kept the update frequency high and it's running just fine, but we'll see how it goes in winter with less sun.
Pics!
Here you can see the boost converter and the Arduino pro mini.
Here you can see the finished product in its natural environment. The RF radio sits in the plastic area, as I figured the metal collar at the top (where the arduino + battery sits) would have blocked/reduced the RF transmission.Code to follow.
-
RE: "on top" light switches and cheap IOT hardware
A little off topic for this forum perhaps, but I've been eyeing out the Livolo range of switches. They're quite smart looking and can work with Domoticz over 433Mhz using Rflink or equivalent. The only problem is that it is not a mesh system like mysensors or zwave and there is no acknowledgement of command received. But on the plus side, they're much cheaper and seem to be capable of dimming LEDs too.
-
RE: How To - Doorbell Automation Hack
@Samster here's the link to converting code to 2.0:
https://forum.mysensors.org/topic/4276/converting-a-sketch-from-1-5-x-to-2-0-xI followed this recently (different sketch) and it works just fine as long as you take your time and make sure you do each step properly. Post back on how you get on, if you're still stuck I might be able to give a hand next week but I'm pretty new at this myself.
-
RE: HLK-PM01 reliability and experience
Have you seen the thread on here about fake HLK modules? It could be that you had a batch of the dodgy ones.
-
RE: Plant moisture sensor - I give up...
Have you seen this thread?
https://forum.mysensors.org/topic/4045/solar-powered-soil-moisture-sensorJust finished building one of these and it works a treat, going to test it for a while to see how long the battery lasts with the solar power.
-
RE: Hack air refresher
@Lawrence-Helm said:
Methane sensor Aliexpress
LOL
I'm sure you could control the power to itand tie it to a day/night schedule in your controller or something.
-
RE: Node's becoming unreachable
@Sander-Stolk Now that is taking home automation to a whole new level. Nice! Adding that to the list of sensors I want to build. It's a long list and growing all the time...
-
RE: Node's becoming unreachable
I'm too new to all of this to be able to help, unfortunately, but your diagram got me really curious - what does the BBQ node do??
-
RE: Domotiocz + Rain gauge
@sundberg84 Wow, that is impressive! What type of batteries are you using?
I'm waiting for parts to come in to start building some battery powered and external sensors.
-
RE: 💬 Temperature Sensor
Ah, never mind! Managed to resolve it after all. For the benefit of others who may hit the same issue: the code depends on a very particular version of the DallasTemperature library, the versions downloaded via the Arduino IDE don't work and give the errors above. I had to download the library from the examples on github here: https://github.com/mysensors/MySensorsArduinoExamples
-
RE: 💬 Temperature Sensor
Hi there, I'm new to Mysensors and I thought I'd start with a simple DS Temp sensor. However, I'm getting compile errors when I try compile it. Can someone please point me in the right direction?
Arduino: 1.6.11 (Windows 7), Board: "Arduino Nano, ATmega328" WARNING: Category 'Sensor' in library DallasTemperature is not valid. Setting to 'Uncategorized' In file included from C:\Users\Admin\Documents\Arduino\Projects\MS Temp sensor node\DallasTemperatureSensor\DallasTemperatureSensor.ino:37:0: C:\Users\Admin\Documents\Arduino\libraries\DallasTemperature/DallasTemperature.h: In function 'void loop()': C:\Users\Admin\Documents\Arduino\libraries\DallasTemperature/DallasTemperature.h:249:13: error: 'int16_t DallasTemperature::millisToWaitForConversion(uint8_t)' is private int16_t millisToWaitForConversion(uint8_t); ^ DallasTemperatureSensor:85: error: within this context int16_t conversionTime = sensors.millisToWaitForConversion(sensors.getResolution()); ^ Multiple libraries were found for "DallasTemperature.h" Used: C:\Users\Admin\Documents\Arduino\libraries\DallasTemperature Not used: C:\Users\Admin\Documents\Arduino\libraries\Arduino-Temperature-Control-Library-master exit status 1 within this context This report would have more information with "Show verbose output during compilation" option enabled in File -> Preferences.