Skip to content

My Project

967 Topics 13.5k Posts

Show off and share your great projects here! We love pictures!

  • 6 Votes
    113 Posts
    77k Views
    alx6thsA
    Ok, it works. Looks like the problem was caused by windows sensors that were not connected but initialized, so they were missing. I removed them in the MAX software and then everything was displayed correctly. Thank you for this great project! :+1:
  • coin-cell (CR2032) powered temperature sensor

    39
    3 Votes
    39 Posts
    26k Views
    E
    Hello fleinze, What about this project? Your sensors still working? I'm trying to build the same but I have some problem to change the efuse value: "I changed the efuse value to 0x07 (BOD off)" I' dont know how to edit the boards.txt file and how to install it in the arduino pro mini. Could you explain the procedure step by step or link me a good complete tutorial ? Thank you very much
  • My very first mysensors node!

    3
    1
    2 Votes
    3 Posts
    2k Views
    M
    I have problem now with Home Assistant and this node. It works perfectly reading temperature, humidity and the door status. But with the light switch if HA goes to a state where light status is "on" but brightness is "0" it doesn't respond until I manually set the brightness to "100". I tried this with mysensors library version 2.3.1 and 2.2.0 but the behaviour is the same. My gateway version is 2.1.0 Here is the code for the node. There is nothing special on HA end. I'm running hass.io latest version 0.84.6 and lovelace GUI. Sorry for the comments in the code, they are part english and part finnish :) Just this issue to solve and one package from China and I'll get the power supplys and nodes ready. Then pretty soon I'll have 10 mysensors nodes running! I already started with some Sonoff's in the middle froor, four now installed and one waiting for a suitable application. /* * NODE ID: 2 * Tämä on alasisäeteisen node jossa on: * - DHT22 -> lämpö ja kosteus * - Releohjaus sisäeteisen valoille (kytkin+rele) * - Ovitunnistin (hall-anturi) * Kytkennät: * - 5=DHT22 * - 4=Releohjaus * - 3=Yläkerran valokytkin * - 6=Alakerran valokytkin * - 2=Ovitunnistin */ // Enable debug prints //#define MY_DEBUG // Noden ID (oltava kaikissa eri!!) #define MY_NODE_ID 2 // Enable and select radio type attached #define MY_RADIO_RF24 //#define MY_RADIO_RFM69 #define MY_REPEATER_FEATURE #include <SPI.h> #include <MySensors.h> #include <Bounce2.h> #include <DHT.h> #include <SimpleTimer.h> #define DOOR_PIN 2 // Ovikytkin #define BUTTON_PIN 3 // Yläkerran valokytkin #define BUTTON_PIN_2 6 // Alakerran valokytkin #define RELAY_PIN 4 // Rele (valo) #define DHT_DATA_PIN 5 // Lämpötila-anturi DHT22 #define CHILD_ID_LIGHT 1 #define CHILD_ID_HUM 2 #define CHILD_ID_TEMP 3 #define CHILD_ID_DOOR 4 #define LIGHT_OFF 0 #define LIGHT_ON 1 #define RELAY_ON 0 #define RELAY_OFF 1 #define DOOR_CLOSED 0 #define DOOR_OPEN 1 #define SENSOR_TEMP_OFFSET 0 // DHT22 lämpötilan offsetti #define SN "kellari_sisaeteinen" #define SV "1.2" // Force sending an update of the temperature after n sensor reads, so a controller showing the // timestamp of the last update doesn't show something like 3 hours in the unlikely case, that // the value didn't change since; // i.e. the sensor would force sending an update every UPDATE_INTERVAL*FORCE_UPDATE_N_READS [ms] static const uint8_t FORCE_UPDATE_N_READS = 10; float lastTemp; float lastHum; uint8_t nNoUpdatesTemp; uint8_t nNoUpdatesHum; bool metric = true; int16_t last_state = LIGHT_OFF; int16_t last_dim = 0; // Yläkerran valokytkimen luku Bounce debouncer = Bounce(); // Alakerran valokytkimen luku Bounce debouncer_2 = Bounce(); // Ovikytkimen luku Bounce ovidebouncer = Bounce(); // Lämpötila-anturin oliot DHT dht; SimpleTimer timer; MyMessage light_msg( CHILD_ID_LIGHT, V_STATUS ); MyMessage dimmer_msg( CHILD_ID_LIGHT, V_PERCENTAGE ); MyMessage msgHum(CHILD_ID_HUM, V_HUM); MyMessage msgTemp(CHILD_ID_TEMP, V_TEMP); MyMessage msgOvi(CHILD_ID_DOOR, V_TRIPPED); void setup() { dht.setup(DHT_DATA_PIN); // set data pin of DHT sensor // Sleep for the time of the minimum sampling period to give the sensor time to power up // (otherwise, timeout errors might occure for the first reading) sleep(dht.getMinimumSamplingPeriod()); update_light(); //Serial.println( "Node ready to receive messages..." ); // Setup the buttons pinMode(BUTTON_PIN,INPUT); pinMode(BUTTON_PIN_2,INPUT); // Activate internal pull-up digitalWrite(BUTTON_PIN,HIGH); digitalWrite(BUTTON_PIN_2,HIGH); // Make sure relays are off when starting up digitalWrite(RELAY_PIN, RELAY_OFF); // Then set relay pins in output mode pinMode(RELAY_PIN, OUTPUT); // Yläkerran valokytkin debouncer.attach(BUTTON_PIN, INPUT_PULLUP); debouncer.interval(25); // Alakerran valokytkin debouncer_2.attach(BUTTON_PIN_2, INPUT_PULLUP); debouncer_2.interval(25); // Ovikytkin ovidebouncer.attach(DOOR_PIN, INPUT_PULLUP); ovidebouncer.interval(25); // Timer lämpötila-anturin lukemista varten (millisekunteja) eli luetaan 1min välein timer.setInterval(60000, lampotilaLuku); } void loop() { //In MySensors2.x, first message must come from within loop() static bool first_message_sent = false; if ( first_message_sent == false ) { //Serial.println( "Sending initial state..." ); send_dimmer_message(); send_status_message(); lampotilaLuku(); send(msgOvi.set(DOOR_CLOSED)); first_message_sent = true; } debouncer.update(); // Update the Bounce instance (yläkerran valokytkin) // Laskevan reunan tunnistus (yläkerran valokytkin) if ( debouncer.fell() ) { //Serial.println( "Laskeva reuna" ); nappiPainettu(); // Valon ohjaus } // Nousevan reunan tunnistus (yläkerran valokytkin) if ( debouncer.rose() ) { //Serial.println( "Nouseva reuna" ); nappiPainettu(); // Valon ohjaus } debouncer_2.update(); // Update the Bounce instance (alakerran valokytkin) // Laskevan reunan tunnistus (alakerran valokytkin) if ( debouncer_2.fell() ) { //Serial.println( "Laskeva reuna" ); nappiPainettu(); // Valon ohjaus } // Nousevan reunan tunnistus (alakerran valokytkin) if ( debouncer_2.rose() ) { //Serial.println( "Nouseva reuna" ); nappiPainettu(); // Valon ohjaus } // Ovitunnistimen luku if (ovidebouncer.update()) { // Get the update value. int value = ovidebouncer.read(); // Send in the new value. //Serial.println( "Oven status muuttui" ); send(msgOvi.set(value==HIGH ? 1 : 0)); } // Lämpötila-anturin timer pyörii.. timer.run(); } void presentation() { // Send the sketch version information to the gateway sendSketchInfo( SN, SV ); present( CHILD_ID_LIGHT, S_DIMMER ); present(CHILD_ID_HUM, S_HUM); present(CHILD_ID_TEMP, S_TEMP); present(CHILD_ID_DOOR, S_DOOR); metric = true; // Lämpötila-anturi } // Vastaanotetaan HA:lta komentoja void receive(const MyMessage &message) { //When receiving a V_STATUS command, switch the light between OFF //and the last received dimmer value // Tämä on ON/OFF viesti HA:lta if ( message.type == V_STATUS ) { //Serial.println( "V_STATUS command received..." ); int lstate = message.getInt(); if (( lstate < 0 ) || ( lstate > 1 )) { //Serial.println( "V_STATUS data invalid (should be 0/1)" ); return; } last_state = lstate; //If last dimmer state is zero, set dimmer to 100 if (( last_state == LIGHT_ON ) && ( last_dim == 0 )) { last_dim=100; } //Update constroller status send_status_message(); } // Tämä on himmennys viesti HA:lta else if ( message.type == V_PERCENTAGE ) { //Serial.println( "V_PERCENTAGE command received..." ); int dim_value = constrain( message.getInt(), 0, 100 ); if ( dim_value == 0 ) { last_state = LIGHT_OFF; //Update constroller with dimmer value & status send_dimmer_message(); send_status_message(); } else { last_state = LIGHT_ON; last_dim = dim_value; //Update constroller with dimmer value send_dimmer_message(); } } else { //Serial.println( "Invalid command received..." ); return; } //Here you set the actual light state/level update_light(); } // Releen ohjaus statuksen perusteella void update_light() { if ( last_state == LIGHT_OFF ) { //Serial.println( "Light state: OFF" ); digitalWrite(RELAY_PIN, RELAY_OFF); } else { //Serial.print( "Light state: ON, Level: " ); //Serial.println( last_dim ); digitalWrite(RELAY_PIN, RELAY_ON); } } // Lähetetään HA:lle dimmer arvo void send_dimmer_message() { send( dimmer_msg.set( last_dim ) ); } // Lähetetään HA:lle valon status (ON/OFF) void send_status_message() { if ( last_state == LIGHT_OFF ) { send( light_msg.set( (int16_t)0) ); } else { send( light_msg.set( (int16_t)1) ); } } // Luetaan DHT22 arvot void lampotilaLuku() { // Force reading sensor, so it works also after sleep() dht.readSensor(true); // Get temperature from DHT library float temperature = dht.getTemperature(); if (isnan(temperature)) { //Serial.println("Failed reading temperature from DHT!"); } else if (temperature != lastTemp || nNoUpdatesTemp == FORCE_UPDATE_N_READS) { // Only send temperature if it changed since the last measurement or if we didn't send an update for n times lastTemp = temperature; if (!metric) { temperature = dht.toFahrenheit(temperature); } // Reset no updates counter nNoUpdatesTemp = 0; temperature += SENSOR_TEMP_OFFSET; send(msgTemp.set(temperature, 1)); #ifdef MY_DEBUG //Serial.print("T: "); //Serial.println(temperature); #endif } else { // Increase no update counter if the temperature stayed the same nNoUpdatesTemp++; } // Get humidity from DHT library float humidity = dht.getHumidity(); if (isnan(humidity)) { //Serial.println("Failed reading humidity from DHT"); } else if (humidity != lastHum || nNoUpdatesHum == FORCE_UPDATE_N_READS) { // Only send humidity if it changed since the last measurement or if we didn't send an update for n times lastHum = humidity; // Reset no updates counter nNoUpdatesHum = 0; send(msgHum.set(humidity, 1)); #ifdef MY_DEBUG //Serial.print("H: "); //Serial.println(humidity); #endif } else { // Increase no update counter if the humidity stayed the same nNoUpdatesHum++; } } // Napin painon jälkeen valon ohjaus ja statuksen päivitys void nappiPainettu() { if (last_state == LIGHT_ON) { //Serial.println( "Valo OFF napista" ); last_state = LIGHT_OFF; last_dim=0; update_light(); // Releen toggle } else { //Serial.println( "Valo ON napista" ); last_state = LIGHT_ON; last_dim=100; update_light(); // Releen toggle } //Serial.println( "Lahetetaan HA:lle uusi status" ); send_status_message(); // Lähetä HA:lle uusi status (ON/OFF) send_dimmer_message(); // Lähetä HA:lle uusi dim arvo (0/100) } Here are parts concerning from configuration.yaml file: # Mysensors serial gateway config mysensors: gateways: - device: '/dev/ttyACM0' baud_rate: 115200 persistence_file: '/config/mysensors.json' optimistic: false persistence: true version: 2.0
  • ESP32 based IoT gateway/control hub with TFT, touch, RFM69 and more..

    23
    7 Votes
    23 Posts
    8k Views
    M
    @nca78 said in ESP32 based IoT gateway/control hub with TFT, touch, RFM69 and more..: Bodmer TFT eSPI Bodmer TFT eSPI is just a normal SPI driver, well maybe optimized a bit. The key to speed (IMHO) is to use double frame buffer and DMA for the SPI, that leaves the CPU free to process the next frame while the hardware does the SPI transfer. I am not aware of such TFT library for Arduino.
  • Sensor required to detect PVC insulated COPPER wire

    14
    1
    0 Votes
    14 Posts
    3k Views
    K
    @hard-shovel But mesh is on other direction too - parallel with movement and sure not still at the same position and pure parallel. So digital signal can be generated longer time than you expected. [image: 1546467669008-img_20190102_231437.jpg]
  • 2 Votes
    4 Posts
    2k Views
    N
    @user2684 I forgot to tell you to buy one with a cable. They use a connector with 1.25mm spacing and it is not possible to connect anything else. You can make the cable breadboard friendly by soldering the ends to a 2.54mm header. [image: 1546224745347-img_20181231_095020-2-resized.jpg]
  • Reporting an independent float switch and relay

    7
    0 Votes
    7 Posts
    1k Views
    S
    Success. stole some code from a post a while ago: No concept of how efficient this is, but hey... 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-2018 Sensnology AB Full contributor list: https://github.com/mysensors/MySensors/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 - Henrik Ekblad DESCRIPTION Example sketch showing how to control physical relays. This example will remember relay state after power failure. http://www.mysensors.org/build/relay */ // Enable debug prints to serial monitor #define MY_DEBUG // Enable and select radio type attached #define MY_RADIO_RF24 //#define MY_RADIO_NRF5_ESB //#define MY_RADIO_RFM69 //#define MY_RADIO_RFM95 // Enable repeater functionality for this node //#define MY_REPEATER_FEATURE #include <MyConfig.h> #include <MySensors.h> #include <SPI.h> #define RELAY_PIN 4 // Arduino Digital I/O pin number for first relay (second on pin+1 etc) #define FLOAT_SWITCH_PIN 3 //FLOAT SWITCH PIN #define LED_GRN_PIN 7 #define LED_RED_PIN 8 #define MY_TRANSPORT_WAIT_READY_MS (3000) #define CHILD_ID 4 #define RELAY_ON 1 #define RELAY_OFF 0 boolean lastSensorState; unsigned long lastUpdate; MyMessage msg(CHILD_ID, V_STATUS); void setup() { pinMode(RELAY_PIN, OUTPUT); pinMode(FLOAT_SWITCH_PIN, INPUT); // Define LED pinMode(LED_GRN_PIN, OUTPUT); pinMode(LED_RED_PIN, OUTPUT); } void presentation() { // Send the sketch version information to the gateway and Controller sendSketchInfo("Rollermat", "3.0"); // Register all sensors to gw (they will be created as child devices) present(CHILD_ID, S_BINARY); } void loop() { // LOW corresponds to the float switch being at its highest point (i.e. rollermat is clogged) if(digitalRead(FLOAT_SWITCH_PIN) == LOW) { digitalWrite(RELAY_PIN, RELAY_ON); //turn on the motor digitalWrite(LED_GRN_PIN, LOW); //turns on the Green LED digitalWrite(LED_RED_PIN, HIGH); //turns off the Red LED } //otherwise the float switch is HIGH // HIGH corresponds to the float switch being at its lowest point (i.e. rollermat is clean and water is flowing) else { digitalWrite(RELAY_PIN, RELAY_OFF); //turns off the pump digitalWrite(LED_GRN_PIN, HIGH); //turns off the Green LED digitalWrite(LED_RED_PIN, LOW); //turns on the Red LED } boolean sensorState = digitalRead(FLOAT_SWITCH_PIN); if (sensorState != lastSensorState) { #ifdef DEBUG digitalWrite(FLOAT_SWITCH_PIN,sensorState? HIGH : LOW); Serial.println(sensorState? "Motor On" : "Motor Off"); #endif send(msg.set(sensorState?"1":"0")); // Update gateway on change of state lastSensorState = sensorState; } }
  • 2 Votes
    1 Posts
    1k Views
    No one has replied
  • DHT11 sensor with shield LoRa rfm915

    2
    0 Votes
    2 Posts
    669 Views
    mfalkviddM
    Hi @tahsin_06, welcome to the MySensors community! Did you look at the troubleshooting guide? It shows the most common problems and how to troubleshoot them. Could you post the debug output from your gateway and node?
  • Batt/temp/hum/light/6*dig pcb for grabs

    2
    1 Votes
    2 Posts
    1k Views
    Y
    @jimmy-loyens You can post your (hardware) designs on www.openhardware.io, which is the MySensors hardware site!
  • Looking for a good platform to programm webserver linked to webservices

    4
    0 Votes
    4 Posts
    1k Views
    T
    I'm currently learning react.js as my new front end language. I like it so far. Also with react native you can develop native mobile apps. That's on my bucket list for the next holiday.
  • [Need help] Intercom project

    19
    0 Votes
    19 Posts
    10k Views
    B
    @orri Did you read the manual? if not read below... In-house telephone light button Each in-house telephone has a light button to actuate a joint staircase or entrance light. https://www.siedle.com/App/WebObjects/XSeMIPS.woa/cms/documentdownload/locale.enGB/did.7750/System_Manual_1%2Bn_technology_136442_EN.pdf
  • plant watering node

    8
    3
    2 Votes
    8 Posts
    2k Views
    alowhumA
    @dzjr Yes it is, in theory. it's a three-way valve. I haven't tested it yet though. For now my plant health monitor just monitors 6 plants. It's part of a large project about privacy in the smart home that I will be revealing in the coming year. [image: 1543823744169-plant_health_sensor.png]
  • Humidifier / Essence oil vaporize - anti dry-out monitor (WIP)

    3
    2
    1 Votes
    3 Posts
    1k Views
    alowhumA
    Wow, this is amazing! Also: congratulations!
  • How do I push Notification within Arduino IDE sketch?

    nodemcu sct-013
    2
    0 Votes
    2 Posts
    762 Views
    T
    @goddur I'm sorry my friend. I think this question is not related to MySensors. I've googled it for you. https://www.instructables.com/id/ESP8266-to-IFTTT-Using-Arduino-IDE/
  • AC Mains + Battery powered iOT-Node

    1
    1 Votes
    1 Posts
    703 Views
    No one has replied
  • Old school phone as doorbell and domoitcs interface!

    6
    1
    6 Votes
    6 Posts
    2k Views
    Y
    @superkris well, at least someone did : https://hackaday.com/2018/11/20/retro-wall-phone-becomes-a-doorbell-and-so-much-more/#more-333555 Congrats!
  • Monitor Alarm System state (Jablotron)

    2
    3 Votes
    2 Posts
    3k Views
    Y
    sorry to bump this old thread. Since i have this jablotron alarm system, in this way i can also get the status of all wireless sensors (doors, etc) connected ?
  • PH Probe code

    6
    0 Votes
    6 Posts
    2k Views
    S
    I'm not a programmer, I can not fix it
  • livolo Glass Panel Touch Light Wall Switch + arduino 433Mhz

    135
    0 Votes
    135 Posts
    128k Views
    A
    Hi All, I'm trying a different approach, on how to use just the top (sensor) part of the livolo touch switch, but at the moment, i'm stuck at the PIC16f690 microcontroller functions in order to power up the LED. I'm using a Livolo VL-C601-2 model and based on the wires on the top part, i tried to make a diagram to batter understand the schematics. (Please note that i'm missing some wires and that i have not drawn all the wires from all the pins as i could not see all of them. If something is wrong, please let me know.) What i don't understand from the diagram below, is how does the PIC16F690 controls the two LEDs (red and blue) using only the RB4 (13) pin. From the datasheet link here i can see that the Pin 13 (RB4) has: RB4/AN10/SDI/SDA and supports IOC Can someone please explain to a noob in electronics how does this work and how does the pic switches from one LED to the other ? [image: 48167399-81ec4a00-e2e3-11e8-8301-d3679d37dcc4.png]

36

Online

12.0k

Users

11.2k

Topics

113.4k

Posts