Skip to content

General Discussion

A place to talk about whateeeever you want
1.5k Topics 14.2k Posts
  • Laser Christmas Light Control - 433MHZ

    14
    0 Votes
    14 Posts
    6k Views
    T
    I thought I'd report back with my code. The sensor is up and running. I don't like that I just had to present switches but I'm not skilled enough to use the "custom" field and make a control in Vera. (On/Off, Blue, Red, Green, Motion) So this will have to do for now. It's probably OK as I'm just going to use automation to actuate the switches. /** * 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. * ******************************* * * *Power= 010101101010010100000001 *Red= 010101101010010100000010 *Green= 010101101010010100001000 *Blue= 010101101010010100001110 *down = 010101101010010100000100 *up= 010101101010010100010110 Decimal: 5678338 (24Bit) Binary: 010101101010010100000010 Tri-State: not applicable PulseLength: 310 microseconds Protocol: 1 Raw data: 9624,192,1032,808,416,232,988,840,384,256,964,872,360,876,340,288,936,884,336,288,936,888,336,284,936,284,940,884,340,284,936,884,340,284,936,288,936,284,940,284,936,284,940,284,936,884,336,288,936, * * * * * */ // Enable debug prints to serial monitor #define MY_DEBUG #define MY_RF24_PA_LEVEL RF24_PA_LOW // Enable and select radio type attached #define MY_RADIO_NRF24 //#define MY_RADIO_RFM69 // Enable repeater functionality for this node //#define MY_REPEATER_FEATURE #include <SPI.h> #include <MySensors.h> #include <RCSwitch.h> #define POWER_BUTTON 1 #define RED_BUTTON 2 #define GREEN_BUTTON 3 #define BLUE_BUTTON 4 #define NoMotion_BUTTON 5 #define MedMotion_BUTTON 6 #define FastMotion_BUTTON 7 unsigned long delay_time = 500; bool state; MyMessage msg_power(POWER_BUTTON,V_LIGHT); MyMessage msg_red(RED_BUTTON,V_LIGHT); MyMessage msg_green(GREEN_BUTTON,V_LIGHT); MyMessage msg_blue(BLUE_BUTTON,V_LIGHT); MyMessage msg_NoMotion(NoMotion_BUTTON,V_LIGHT); MyMessage msg_MedMotion(MedMotion_BUTTON,V_LIGHT); MyMessage msg_FastMotion(FastMotion_BUTTON,V_LIGHT); RCSwitch mySwitch = RCSwitch(); void before() { } void setup() { mySwitch.enableTransmit(8); mySwitch.setPulseLength(298); mySwitch.setRepeatTransmit(2); } void presentation() { // Send the sketch version information to the gateway and Controller sendSketchInfo("Christmas Laser Control", "1.0"); present (POWER_BUTTON, S_LIGHT); present (RED_BUTTON, S_LIGHT); present (GREEN_BUTTON, S_LIGHT); present (BLUE_BUTTON, S_LIGHT); present (NoMotion_BUTTON, S_LIGHT); present (MedMotion_BUTTON, S_LIGHT); present (FastMotion_BUTTON, S_LIGHT); } void loop() { // if (state) { // Serial.println("State is true"); //send(msg.set(state?false:true), false); // Send new state and request ack back // send(msg.setSensor(RED_CONTROLLER).set(0)); // state = false; // } } 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) { Serial.print("Incoming change for sensor:"); Serial.print(message.sensor); Serial.print(", New status: "); Serial.println(message.getBool()); if (message.getBool()){ if (message.sensor == POWER_BUTTON) { Serial.println ("Sending POWER data"); mySwitch.send("010101101010010100000001"); Serial.println ("Turn POWER_BUTTON off in Vera"); send(msg_power.setSensor(POWER_BUTTON).set(0), true); } else if (message.sensor == RED_BUTTON) { Serial.println ("Sending RED data"); mySwitch.send("010101101010010100000010"); Serial.println ("Turn RED_BUTTON off in Vera"); send(msg_red.setSensor(RED_BUTTON).set(0), true); } else if (message.sensor == GREEN_BUTTON) { Serial.println ("Sending GREEN data"); mySwitch.send("010101101010010100001000"); Serial.println ("Turn GREEN_BUTTON off in Vera"); send(msg_green.setSensor(GREEN_BUTTON).set(0), true); } else if (message.sensor == BLUE_BUTTON) { Serial.println ("Sending BLUE data"); mySwitch.send("010101101010010100001110"); Serial.println ("Turn BLUE_BUTTON in Vera"); send(msg_blue.setSensor(BLUE_BUTTON).set(0), true); } else if (message.sensor == NoMotion_BUTTON) { Serial.println ("Sending No Motion data"); mySwitch.send("010101101010010100000100"); delay(delay_time); mySwitch.send("010101101010010100000100"); delay(delay_time); mySwitch.send("010101101010010100000100"); Serial.println ("Turn No Motion in Vera"); send(msg_blue.setSensor(NoMotion_BUTTON).set(0), true); } else if (message.sensor == MedMotion_BUTTON) { Serial.println ("Sending Medium Motion data"); mySwitch.send("010101101010010100000100");//down delay(delay_time); mySwitch.send("010101101010010100000100");//down delay(delay_time); mySwitch.send("010101101010010100010110");//up Serial.println ("Turn Medium Motion in Vera"); send(msg_blue.setSensor(MedMotion_BUTTON).set(0), true); } else if (message.sensor == FastMotion_BUTTON) { Serial.println ("Sending Fast Motion data"); mySwitch.send("010101101010010100010110"); delay(delay_time); mySwitch.send("010101101010010100010110"); delay(delay_time); mySwitch.send("010101101010010100010110"); Serial.println ("Turn Fast Motion in Vera"); send(msg_blue.setSensor(FastMotion_BUTTON).set(0), true); } } // Store state in eeprom // saveState(message.sensor, message.getBool()); } }
  • [newbie] Using nRF24L0 (2,4Ghz) or RFM69 (433Mhz)?

    4
    0 Votes
    4 Posts
    2k Views
    mikeeM
    +1 for RFM(433Mhz) I´m already running NRF and keeping it (have build many nodes on it). But, for example I have a garage (steel structure with sheet-metal paneling) and its ca.6 meters from NRF gateway - no signal! Same distance RFlink (433Mhz) works just fine.
  • Indoor BLE Location ( or presence detection)

    wifi ble mqtt
    10
    0 Votes
    10 Posts
    12k Views
    T
    Actually, it's not 100% MySensors-related, but I have a working setup consisting of iBeacon (either HM10-based or PI-based) and Beecon app. When Beecon senses the iBeacon it can trigger various actions, eg make http requests or call IFTTT recipes
  • bi stable 2 coil relais switch

    2
    0 Votes
    2 Posts
    825 Views
    DickD
    after reading some documentation , I can use a double 'door, window and push' button. the status is not inportant because the state of the relais is stored in the relais itself.
  • Yet another which controller?

    2
    0 Votes
    2 Posts
    860 Views
    A
    HomeAssistant - perfect one.
  • Dim lights to match sunlight from windows?

    2
    0 Votes
    2 Posts
    818 Views
    sundberg84S
    @Cliff-Karlsson - from my point of view (Domoticz) it wouldnt be hard at all. You need one lux sensor and a dimmer. The code could be written in Lua for example and executed every time the lux sensor gets a new reading.
  • Domoticz + IR RGBW led strip + My Sensors

    1
    0 Votes
    1 Posts
    683 Views
    No one has replied
  • Copy sensor

    3
    0 Votes
    3 Posts
    835 Views
    D
    @mfalkvidd Okey thanks
  • Word Explanation

    2
    0 Votes
    2 Posts
    775 Views
    AWIA
    @qwertz1 Heartbeat support: the sensor can send a "heartbeat" message to the controller to let it know it's alive. The heartbeat message does not update values. Not all controllers can interpret the message. Ack: when you enable ack in a message the receiving node "acknowledges" the message by returning it. It is a way to make sure that the message arrived at it's destination. Some controllers can resend and/or report. This is used mostly for actuators (lights/ motors) to be it is switched on/off. OTA (over the air) means you can update the firmware (sketch) on the MySensors node without wiring it to the computer. Request: the controller supports "requesting" values. i.e. a node/sensor can request a last known value from the controller (or other node). Typical usage is to request a last know switch state from the controller after a node/ sensor powers up. Another usage ( at least for me) is requesting all kinds of information from the controller for remote display (V_TEXT). I hope it clears the sky for you..:sparkles:
  • Share SCL & SDA using arduino Pro mini

    share scl & sda
    2
    0 Votes
    2 Posts
    2k Views
    korttomaK
    The sensors on the I2C buss has an address. As long as there is no address conflict on the buss you can add multiple sensors. You need to check what address your sensors are using and/or the possibility to change the address of your sensor if you find that there might be a conflict.
  • Gas sensor for formic acid in the air

    1
    0 Votes
    1 Posts
    941 Views
    No one has replied
  • Powering mote 24/7 using only a supercap and solar?

    1
    0 Votes
    1 Posts
    533 Views
    No one has replied
  • PIR sensor - Smartest way to disable at daytime? (newbie)

    7
    0 Votes
    7 Posts
    4k Views
    pellusfromtellusP
    :) Lovely. Will be this evenings experiment – if I got the right PIRs.. ;) – to find out... Thanks for answering! /Pelle
  • Gateway ethernet to modules arduino mcu wifi? O_o

    4
    0 Votes
    4 Posts
    1k Views
    mfalkviddM
    @Michel---It Thanks for posting the image. Anything you find on the forum that mentions esp8266 or nodemcu will most likely work with that node, including https://www.mysensors.org/build/esp8266_gateway which is probably the best place to start. There are also several threads on how to connect local sensors to the esp8266. I would give you some pointers but I am on a train with crappy Internet.
  • Get something that´s working

    11
    0 Votes
    11 Posts
    3k Views
    P
    @pettib It´s working now. I got wrong version of Mysensors API Now i use 2.01 The time will tell if it get stable.
  • Choosing the right Controller

    7
    1 Votes
    7 Posts
    2k Views
    dbemowskD
    @sundberg84 said: Im using DomoFence for geofencing and webgui for other. Couldnt get the other app to work with geofence I do have the geofencing in the Domoticz app somewhat working. My test scenario was to have a script that would close my garage door once I left the fence area. The problem I ran into was that when I would come home, it wouldn't register right away that I was inside the fence area, so when I would open my garage door, it would think I was outside the fence area and shut it right away. I think that might be an issue with the phone and not Domoticz.
  • Create fire-effect using ws2812 leds?

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • 0 Votes
    5 Posts
    1k Views
    dbemowskD
    @Sean-Brockest said: not sure what a node or controller is. I don't care how it works, really. A node would be a MySensors device (arduino with a radio module) with one or more of the following attached; sensor, relay, switch, or something like that. The radio module would talk to a gateway node that is attached to a computer running some kind of controller (Home Automation) software. If this one thing is all you are trying to do and you are not trying to set up other home automation stuff, you shouldn't need the whole MySensors setup. You could probably do this with just an arduino board, 2 DS18B20 temp sensors and a relay module. The only problem in that would be that you would have to program it for a certain temp differential and any hysteresis that you would want in play, and it would be static until you re-programmed the arduino with new values. There would be ways to set it up to be programmed as far as the set temps and the switching, but that would take a lot more hardware such as an LCD screen and some switches for programming. It would also make the arduino code quite a bit more complex.
  • repeater feature-How it works ?

    2
    0 Votes
    2 Posts
    2k Views
    mfalkviddM
    Start with https://www.mysensors.org/about/network and https://www.mysensors.org/download/sensor_api_20#create-repeating-nodes If you have further questions, just post them here and we'll try to answer.
  • Realizing a Call Managment System

    1
    0 Votes
    1 Posts
    653 Views
    No one has replied

15

Online

11.8k

Users

11.2k

Topics

113.2k

Posts