Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
HomerH

Homer

@Homer
About
Posts
157
Topics
29
Shares
0
Groups
0
Followers
0
Following
1

Posts

Recent Best Controversial

  • Some questions on how gateway works
    HomerH Homer

    Thanks mate, I am very pleased! :-D

    Home Assistant

  • Some questions on how gateway works
    HomerH Homer

    I gave up on this and instead went the TCP Gateway, and now I have sensors in HA!

    Home Assistant

  • Some questions on how gateway works
    HomerH Homer

    Thanks for the replies!!

    I have some progress, but I still don't see any sensors in Home Assistant.

    Screenshot 2025-08-11 111200.png

    As you can see. topics are being reported, but nothing related to them show up in the HA MQTT integration or the Mysensors integration.I have no idea where to go from here.

    Home Assistant

  • Some questions on how gateway works
    HomerH Homer

    Screenshot 2025-08-10 200908.png

    Still no topics. I only have the one sensor and I haven't actually attached any sensors to the arduino as I figured the sketch itself would send enough info to create the devices, but I am starting to wonder if the reason they aren;t there is coz of this....

    Home Assistant

  • AI: What is the future of Wikis and Forums?
    HomerH Homer

    I have just been using Chat GPT and it has been very careful. Just remember to be nice to it, so that when it takes over it will remember you as being nice and will hopefully give you an easier job when we all are enslaved by it hahaha

    General Discussion

  • Some questions on how gateway works
    HomerH Homer

    Thanks for your reply!

    I have had heaps of help from Chat GPT and I believe every thing is talking to each other, but I don't see any sensors in HA.

    Here is my sketch for the Gateway:

    
    // Enable debug prints to serial monitor
    #define MY_DEBUG
    
    #define MY_MQTT_KEEPALIVE 60
    
    // Use a lower baud rate for ESP8266 serial prints
    #define MY_BAUD_RATE 9600
    
    // Radio type (enable one)
    #define MY_RADIO_RF24
    // #define MY_RADIO_RFM69
    // #define MY_RADIO_RFM95
    
    // nRF24 radio pins
    #define MY_RF24_CE_PIN 4
    #define MY_RF24_CS_PIN 15
    
    // Gateway type
    #define MY_GATEWAY_MQTT_CLIENT
    #define MY_GATEWAY_ESP8266
    
    // MQTT topics
    #define MY_MQTT_PUBLISH_TOPIC_PREFIX "mygateway1-out"
    #define MY_MQTT_SUBSCRIBE_TOPIC_PREFIX "mygateway1-in"
    
    // MQTT client ID
    #define MY_MQTT_CLIENT_ID "mysensors-1"
    
    // Support controller ID allocation
    #define MY_CONTROLLER_ID_ALLOC_SUPPORT
    
    // MQTT broker authentication (optional)
    #define MY_MQTT_USER "homeassistant"
    #define MY_MQTT_PASSWORD "oN3Oe0eile6iVaivaiphooChieNg5wei0kapa9rohJ8au0Teethah6thahsieP7A"
    
    // WiFi credentials
    #define MY_WIFI_SSID "Ext"
    #define MY_WIFI_PASSWORD "lynettekoster"
    
    // Hostname for DHCP (optional)
    // #define MY_HOSTNAME "mqtt-sensor-gateway"
    
    // Static IP configuration (optional)
    #define MY_IP_ADDRESS 192,168,0,100
    #define MY_IP_GATEWAY_ADDRESS 192,168,0,1
    #define MY_IP_SUBNET_ADDRESS 255,255,255,0
    
    // MQTT broker IP address or URL
    #define MY_CONTROLLER_IP_ADDRESS 192,168,0,77
    // #define MY_CONTROLLER_URL_ADDRESS "test.mosquitto.org"
    
    // MQTT broker port
    #define MY_PORT 1883
    
    // Inclusion mode (optional)
    // #define MY_INCLUSION_MODE_FEATURE
    // #define MY_INCLUSION_BUTTON_FEATURE
    // #define MY_INCLUSION_MODE_DURATION 60
    // #define MY_INCLUSION_MODE_BUTTON_PIN D1
    
    // LED blinking period (optional)
    // #define MY_DEFAULT_LED_BLINK_PERIOD 300
    
    // LED pins (optional)
    // #define MY_DEFAULT_ERR_LED_PIN 16
    // #define MY_DEFAULT_RX_LED_PIN 16
    // #define MY_DEFAULT_TX_LED_PIN 16
    
    #include <ESP8266WiFi.h>
    #include <MySensors.h>
    
    void setup()
    {
      // Setup locally attached sensors here (if any)
    }
    
    void presentation()
    {
      // Present gateway node to controller
      sendSketchInfo("MQTT Gateway", "1.0");
    }
    
    void loop()
    {
      // Send locally attached sensors data here (if any)
    }
    
    

    My Sensor I made is using a RF-Nano, and this is the sketch:

    #define MY_DEBUG
    #define MY_RADIO_NRF24
    #define MY_RF24_CE_PIN 10
    #define MY_RF24_CS_PIN 9
    #include <MySensors.h>
    #include <OneWire.h>
    #include <DallasTemperature.h>
    #include <DHT.h>
    
    // MySensors definitions
    #define CHILD_ID_DS18B20_TEMP 0
    #define CHILD_ID_DHT_TEMP 1
    #define CHILD_ID_DHT_HUM 2
    
    #define ONE_WIRE_BUS 3        // DS18B20 data pin connected to Arduino pin 3
    #define DHTPIN 4              // DHT22 data pin connected to Arduino pin 4
    #define DHTTYPE DHT22         // DHT22 sensor type
    
    // Setup NRF24 radio (default CE=9, CSN=10 for RF-Nano)
    #define MY_RADIO_NRF24
    #define MY_RF24_CE_PIN 10
    #define MY_RF24_CS_PIN 9
    
    // Sleep interval in milliseconds
    #define SEND_INTERVAL 30000  // 30 seconds
    
    // Initialize sensors
    OneWire oneWire(ONE_WIRE_BUS);
    DallasTemperature ds18b20(&oneWire);
    DHT dht(DHTPIN, DHTTYPE);
    
    // Child sensor objects
    MyMessage msgDs18b20Temp(CHILD_ID_DS18B20_TEMP, V_TEMP);
    MyMessage msgDhtTemp(CHILD_ID_DHT_TEMP, V_TEMP);
    MyMessage msgDhtHum(CHILD_ID_DHT_HUM, V_HUM);
    
    unsigned long lastSendTime = 0;
    
    void setup() {
      // Initialize sensors
      ds18b20.begin();
      dht.begin();
    }
    
    void presentation() {
      // Present sensors to gateway
      present(CHILD_ID_DS18B20_TEMP, S_TEMP);
      present(CHILD_ID_DHT_TEMP, S_TEMP);
      present(CHILD_ID_DHT_HUM, S_HUM);
    }
    
    void loop() {
      unsigned long now = millis();
      if (now - lastSendTime > SEND_INTERVAL) {
        lastSendTime = now;
    
        // Read DS18B20 temperature
        ds18b20.requestTemperatures();
        float tempDS = ds18b20.getTempCByIndex(0);
    
        // Read DHT22 temp and humidity
        float tempDHT = dht.readTemperature();
        float humDHT = dht.readHumidity();
    
        // Check if reads are valid before sending
        if (tempDS != DEVICE_DISCONNECTED_C) {
          send(msgDs18b20Temp.set(tempDS, 1));
        } else {
          // Optional: send some error value or skip
        }
    
        if (!isnan(tempDHT)) {
          send(msgDhtTemp.set(tempDHT, 1));
        }
    
        if (!isnan(humDHT)) {
          send(msgDhtHum.set(humDHT, 1));
        }
      }
    
      // Sleep to save power (optional, comment out if not needed)
      // sleep(SEND_INTERVAL / 1000);
    }
    
    

    I downloaded and installed MQTT Explorer to see what messages are there. This is what shows in the app:
    mqtt.png

    I setup Mysensors using the GUI. I am running Mosquitto broker for MQTT. The only thing I see here is my Ring cameras as they are setup using MQTT. In the Mysensors integration all there is is the MQTT gateway that I created. I should have 3 new devices, but they aren't there. I do recall reading somewhere that there was something that needed to happen for a device to show up, but I don't recall what that way as at the time I read it, it was still very far from where I was up to at the time. I guess I will start doing some more searching.

    Home Assistant

  • Some questions on how gateway works
    HomerH Homer

    I think I'm going to move on from the Ethernet route, coz no matter what I can't get it to connect to the network. I have an ESP12F that I found in my box of stuff that I'll wire a radio to and set it up as my gateway.

    Home Assistant

  • Some questions on how gateway works
    HomerH Homer

    Hi all

    I have resurrected my old Mysensors Ethernet gateway but I can't get Home Assistant to connect to it. I tried using yaml but I get an error saying that it can't be configured this way, so I'm thinking I'll set the gateway up as a MQTT Gateway. I first have a couple questions I need to ask.

    I used to have the Gateway integrated into my Vera 3 controller. To attach sensors I used to press a button in the GUI of Vera to start the process. How is this done with the MQTT Gateway? If I need to add a button to the Gateway to start this process, I'll need to add this as it doesn't have this yet.

    And do I need to write the sketches different when I'm creating sensors so that they work with the MQTT Gateway?

    Once I clear this up I'll be able to get building again!

    Looking forward to hearing back from someone!

    Cheers!

    Home Assistant

  • Keen to build again
    HomerH Homer

    @OldSurferDude said in Keen to build again:

    I can't speak to the subtle differences between 2.3.2 and 2.3.1. I would advise on proceeding, whether upgrading or not.

    A gateway to Home Assistant can run on an Arduino Nano with an nRF24 radio (or RF Nano found on AliExpress). This gateway can connect to Home Assistant via the serial port of the computer running Home Assistant.

    I see that there is still a Vera integration on Home Assistant. You could probably pick up where you left off.

    Yes, MySensors popularity has waned, but there are a few of us die-hards that check in from time to time. Please continue to share your experience.

    OSD

    Thanks heaps for your reply!!!!

    I still have the gateway up and running and it's still integrated with Vera which in turn is setup in Home Assistant.

    Do you know of a reason why there isn't so much interest in Mysensors? I know I sort of moved away because I ended up getting some Phillips Hue bulbs and then I bought a could of their sensors coz they were cheap and easy to integrate with everything and things just continued from there for me, but I always enjoyed building the sensors myself and learning, which is why I've returned.

    General Discussion

  • Keen to build again
    HomerH Homer

    It looks like version 2.3.2 is the latest, so not much has changed seeing that my gateway is on 2.3.1.

    Does anyone know if I can just start building new sensors using 2.3.2, or should I keep them the same and use 2.3.1?

    This place used to be a very busy place years ago, it's sad that things have slowed down so much coz this was a great way to make things smart around your home without costing heaps.

    General Discussion

  • Keen to build again
    HomerH Homer

    Hi all

    I used to play around with these a few years ago. I had happy of sensors around the house which was connected to my Ethernet bridge which was connected to my Vera 3.

    I still have the bridge and the Vera 3, but I haven't used them in years. I now run a couple instances of Home Assistant. I just checked in Vera and the bridge is reporting that it is running library version 2.3.1.

    I'm thinking about searching for my box of things and start building some sensors. What do I have to do to make this happen?

    Cheers!

    General Discussion

  • Can't even get a base Mysensors sketch to work
    HomerH Homer

    OK.... I have solved the biggest issue by rebooting my computer. Silly me! The base motion sketch works as it should, kind of.... it does seem to be sending messages quite quickly. Anyways I have uploaded my motion and 2 led dimmer sketch and am in the process of joining it to my Vera Controller, but it still does seem to be sending messages very often. Can someone review my sketch and offer feedback? Please note that I did take the very easy route and adapted a RGB controller sketch for the led dimming part; I plan to just be using 2 of the lights in the sketch to control my 2 led strips. When I have more time I plan to learn how to do it properly.

    Here is the sketch as it stands:

    
    #define SN   "Motion+2 LED Dimmer"
    #define SV   "v1"
    
    // Enable debug prints to serial monitor
    #define MY_DEBUG 
    
    //#define MY_REPEATER_FEATURE
    
    // Enable and select radio type attached
    #define MY_RADIO_RF24
    //#define MY_RADIO_RFM69
    
    #include <MySensors.h>  
    
    uint32_t SLEEP_TIME = 120000; // Sleep time between reports (in milliseconds)
    #define DIGITAL_INPUT_SENSOR 3   // The digital input you attached your motion sensor.  (Only 2 and 3 generates interrupt!)
    #define CHILD_ID 7   // Id of the sensor child
    
    // Arduino pin attached to MOSFET Gate pin
    #define RED_PIN 7   
    #define GREEN_PIN 5
    #define BLUE_PIN 6
    
    // Define message name and type to send sensor info
    MyMessage RedStatus(RED_PIN, V_DIMMER);   
    MyMessage GreenStatus(GREEN_PIN, V_DIMMER);
    MyMessage BlueStatus(BLUE_PIN, V_DIMMER);
    MyMessage Status(1, V_DIMMER);
    MyMessage rgbShowState(0, V_LIGHT);
    // Initialize motion message
    MyMessage msg(CHILD_ID, V_TRIPPED);
        
    // Serial.print translate sensor id to sensor name
    char color[][6] = {"","","","RED","","GREEN","BLUE"}; 
       
    // Vars for rgbShow function
    int redval = 0;
    int greenval = 0;
    int blueval = 0;
    long time=0;
    int isShow;
         
    void setup() 
    {
      // Define pin mode (pin number, type)
      pinMode(RED_PIN, OUTPUT);   
      pinMode(GREEN_PIN, OUTPUT);
      pinMode(BLUE_PIN, OUTPUT);
      pinMode(DIGITAL_INPUT_SENSOR, INPUT);      // sets the motion sensor digital pin as input
    
      // Correct saved RGB value for first start
      saveState(RED_PIN, constrain((int8_t)loadState(RED_PIN), 0, 100)); 
      saveState(GREEN_PIN, constrain((int8_t)loadState(GREEN_PIN), 0, 100)); 
      saveState(BLUE_PIN, constrain((int8_t)loadState(BLUE_PIN), 0, 100)); 
                 
      // Get value from eeprom and write to output
      analogWrite(RED_PIN, 255 * loadState(RED_PIN) / 100);     
      analogWrite(GREEN_PIN, 255 * loadState(GREEN_PIN) / 100);
      analogWrite(BLUE_PIN, 255 * loadState(BLUE_PIN) / 100);
             
      // Write some debug info
      Serial.print("Load from eeprom RED: "); 
      Serial.print(loadState(RED_PIN)); 
      Serial.println("%"); 
      Serial.print("Load from eeprom GREEN: "); 
      Serial.print(loadState(GREEN_PIN)); 
      Serial.println("%"); 
      Serial.print("Load from eeprom BLUE: "); 
      Serial.print(loadState(BLUE_PIN)); 
      Serial.println("%");  
      
      // Send RGB value to controler (request ack back: true/false)
      Serial.println("Send eeprom value to controler"); 
      send( RedStatus.set(loadState(RED_PIN)), false );    
      send( GreenStatus.set(loadState(GREEN_PIN)), false );
      send( BlueStatus.set(loadState(BLUE_PIN)), false );
      
      // Correct RGB show state for first start and load it (set to 'On' at first start)
      saveState(0, constrain((int8_t)loadState(0), 0, 1));
      isShow=loadState(0);
           
      // Send RGB show state to controler (request ack back: true/false)
      send( rgbShowState.set(isShow), false);
      
      if (isShow==1){Serial.println("RGB show running..."); }
      Serial.println("Ready to receive messages...");  
    }
    
    void presentation()  {
      // Present sketch (name, version)
      sendSketchInfo(SN, SV);        
           
      // Register sensors (id, type, description, ack back)
      present(RED_PIN, S_DIMMER, "RED LED", false);
      present(GREEN_PIN, S_DIMMER, "GREEN LED", false);
      present(BLUE_PIN, S_DIMMER, "BLUE LED", false);
      present(0, S_LIGHT, "Show button LEDs", false);
      // Register Motion sensor to gw (they will be created as child devices)
      present(CHILD_ID, S_MOTION);
    }
    
    void loop()
    {
        // Read digital motion value
        bool tripped = digitalRead(DIGITAL_INPUT_SENSOR) == HIGH;
    
        Serial.println(tripped);
        send(msg.set(tripped?"1":"0"));  // Send tripped value to gw
    
        
        // Sleep until interrupt comes in on motion sensor. Send update every two minute.
        sleep(digitalPinToInterrupt(DIGITAL_INPUT_SENSOR), CHANGE, SLEEP_TIME);
    }
    
    
    void receive(const MyMessage &message)
    {
      if (message.isAck())
      {
        Serial.println("Got ack from gateway");
      }
      if (message.type == V_LIGHT)
      {
        // Incoming on/off command sent from controller ("1" or "0")
        int lightState = message.getString()[0] == '1';
      
        // if receive RGB Show On commands, start the show
        if (message.sensor==0 && lightState==1){ rgbShowOn(); }
            // if receive RGB Show Off commands, stop the show
        else if (message.sensor==0 && lightState==0){ rgbShowOff(); }
           
        // if receive RGB switch On command
        else if (lightState==1)
        {
          // Write some debug info
                Serial.print("Incoming change for ");
                Serial.print(color[message.sensor]);
                Serial.println(": On");
                Serial.print("Load from eeprom: ");
              
          if ( loadState(message.sensor) == 0)
          {
            // Pick up last saved dimmer level from the eeprom
                    analogWrite(message.sensor, 255 * loadState(10*message.sensor) / 100);
                    // Save loaded value to current
                    saveState(message.sensor, loadState(10*message.sensor));
                    Serial.print(loadState(10*message.sensor)); 
                    Serial.println("%");
                    // Send value to controler
                    Serial.println("Send value to controler");
                    send(Status.setSensor(message.sensor).set(loadState(10*message.sensor)),false);
                }
                else
                {
                    // Pick up last saved dimmer level from the eeprom
                    analogWrite(message.sensor, 255 * loadState(message.sensor) / 100);
                    Serial.print(loadState(message.sensor));
                    Serial.println("%"); 
                    // Send value to controler
                    Serial.println("Send value to controler");
                    send(Status.setSensor(message.sensor).set(loadState(message.sensor)),false);
                } 
                // Stop the show if it's running
                if (isShow==1){ rgbShowStop(message.sensor); }
            }
        // if recieve switch Off command
        else if (lightState==0)
        {
          // Write output to 0 (Off)
                analogWrite(message.sensor, 0);
                // Save old value to eeprom if it'was not zero
                if ( loadState(message.sensor) != 0 )
                {
                    saveState(10*message.sensor, constrain((int8_t)loadState(message.sensor), 0, 100)); 
                }
                // Save new value to eeprom
                saveState(message.sensor, 0); 
                // Write some debug info
          Serial.print("Incoming change for ");
          Serial.print(color[message.sensor]);
          Serial.print(": ");
          Serial.println("Off");  
                Serial.print("Store old value: ");
                Serial.print(loadState(10*message.sensor));  
                Serial.println("%");
                // Send value to controler
                Serial.println("Send value to controler");
                send(Status.setSensor(message.sensor).set(loadState(message.sensor)),false);
          // Stop the show if it's running
          if (isShow==1){ rgbShowStop(message.sensor); }
        }
      }
      else if (message.type == V_DIMMER)
      {    
          uint8_t incomingDimmerStatus = message.getByte();
          // limits range of sensor values to between 0 and 100 
          incomingDimmerStatus = constrain((int8_t)incomingDimmerStatus, 0, 100);
          // Change Dimmer level
          analogWrite(message.sensor, 255 * incomingDimmerStatus / 100);
          //Save value to eeprom
          saveState(message.sensor, incomingDimmerStatus); 
          // Write some debug info
          Serial.print("Incoming change for ");
          Serial.print(color[message.sensor]);
          Serial.print(": ");
          Serial.print(incomingDimmerStatus);
          Serial.println("%");
            // Send value to controler
            Serial.println("Send value to controler");
            send(Status.setSensor(message.sensor).set(loadState(message.sensor)),false);
          // Stop the show if it's running
          if (isShow==1){ rgbShowStop(message.sensor); }
        }
    }
       
    void rgbShow()
    {
      time = millis();
      redval = 128+250*cos(2*PI/300000*time);
      greenval = 128+250*cos(2*PI/300000*time-222);
      blueval = 128+250*cos(2*PI/300000*time-111);
      // limits range of sensor values to between 0 and 255 
      redval = constrain(redval, 0, 255);
      greenval = constrain(greenval, 0, 255);
      blueval = constrain(blueval, 0, 255);
    }
    
    void rgbShowOn()
    {
      // define show On
      isShow=1;
      // Save state
      saveState(0, 1); 
      // Write some debug info
      Serial.println("Show must go on");
    }
       
    void rgbShowOff()
    {
      // define show Off
      isShow=0;
      // Save state
      saveState(0, 0);
      // Save RGB value to eeprom
      saveState(RED_PIN, 100 * redval / 255); 
      saveState(GREEN_PIN, 100 * greenval / 255);
      saveState(BLUE_PIN, 100 * blueval / 255);
      // Write some debug info
      Serial.println("Stop the show");
      // Send actual RGB value and state to controler and request ack back (true/false)
      Serial.println("Send eeprom value to controler"); 
      send( RedStatus.set(loadState(RED_PIN)), false );    
      send( GreenStatus.set(loadState(GREEN_PIN)), false );
      send( BlueStatus.set(loadState(BLUE_PIN)), false );
      send( rgbShowState.set(0), false);
    }
    
    void rgbShowStop(int sensor)
    {
       // define show Off
       isShow=0;
       // Save state
       saveState(0, 0);
       // Write some debug info
       Serial.println("Stop the show");
       // Send actual RGB value and state to controler and request ack back (true/false)
       Serial.println("Send eeprom value to controler"); 
       if (sensor != RED_PIN)
       {
            saveState(RED_PIN, 100 * redval / 255); 
            send( RedStatus.set(loadState(RED_PIN)), false );  
        }
        if (sensor != GREEN_PIN)
        {
            saveState(GREEN_PIN, 100 * greenval / 255); 
            send( GreenStatus.set(loadState(GREEN_PIN)), false );
        }
        if (sensor != BLUE_PIN)
        {
            saveState(BLUE_PIN, 100 * blueval / 255);
            send( BlueStatus.set(loadState(BLUE_PIN)), false );
        }
        send( rgbShowState.set(0), false);
    }
    
    Troubleshooting

  • Can't even get a base Mysensors sketch to work
    HomerH Homer

    Hi all

    I want to create a sensor which is a motion sensor and a controller of two dimmable LED strips. When I upload the sketch that I hope will work, it looks like the motion part of it doesn't stop sending info, so I decided to start small to try and work out the issue.

    When I upload the Dimming LED sketch on its own, it all seems to work fine according to the serial monitor. Then I wipe the arduino and upload the motion part only, and the serial monitor goes crazy! The Mysensors sign or whatever it's called shows in the serial monitor, then it scrolls on and on, printing either a '1' or '0' on each line and it doesn't stop, and it's FAST!

    I am using an Arduino Nano. The motion sketch is the base example provided on Mysensors, but here it is anyways:

    
    // Enable debug prints
    // #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
    
    #include <MySensors.h>
    
    uint32_t SLEEP_TIME = 120000; // Sleep time between reports (in milliseconds)
    #define DIGITAL_INPUT_SENSOR 3   // The digital input you attached your motion sensor.  (Only 2 and 3 generates interrupt!)
    #define CHILD_ID 1   // Id of the sensor child
    
    // Initialize motion message
    MyMessage msg(CHILD_ID, V_TRIPPED);
    
    void setup()
    {
        pinMode(DIGITAL_INPUT_SENSOR, INPUT);      // sets the motion sensor digital pin as input
    }
    
    void presentation()
    {
        // Send the sketch version information to the gateway and Controller
        sendSketchInfo("Motion Sensor", "1.0");
    
        // Register all sensors to gw (they will be created as child devices)
        present(CHILD_ID, S_MOTION);
    }
    
    void loop()
    {
        // Read digital motion value
        bool tripped = digitalRead(DIGITAL_INPUT_SENSOR) == HIGH;
    
        Serial.println(tripped);
        send(msg.set(tripped?"1":"0"));  // Send tripped value to gw
    
        // Sleep until interrupt comes in on motion sensor. Send update every two minute.
        sleep(digitalPinToInterrupt(DIGITAL_INPUT_SENSOR), CHANGE, SLEEP_TIME);
    }
    

    I have even tried this sketch as it is on another Arduino Nano and I still get the same result. I'm keen to hear your thoughts.

    Thanks

    Troubleshooting

  • New to Domoticz, joining it with Vera and Mysensors question
    HomerH Homer

    @dbemowsk said in New to Domoticz, joining it with Vera and Mysensors question:

    @homer My first question would be, what devices are not working on your Vera controller?

    The problem I have is that I want to use some of the cheap rf433 sensors. I have been trying to get the Candle Hub working but haven't been successful, so I'm thinking about using RF Link, which I know works with Domoticz. I'm hoping to be able to use the rf433 devices using the RF Link and having that talk to Domoticz, and then my Vera controller getting that info from Domoticz.

    Domoticz

  • Best 3d printers
    HomerH Homer

    @skywatch said in Best 3d printers:

    @homer I think you've made a good choice - good luck with with your new source of frustration and learning! :)

    If it turns out you don't like it, feel free to send it to me (Heeeee) ;)

    From experience though, test out your printer with something simple from thingiverse.com and see how it goes....

    For me the following were the areas I had problems with at first.....

    1. Bed leveling - this has to be right to get the first layer the same thickness.
    2. Bed adhesion - I had 'lifting' problems that took a while to sort out.
    3. Supports - You'll get a feel for where and when to use supports, it takes a little trail and error though....

    Thanks mate! So far I'm liking it, so I'm sorry to say that I won't be sending it to you anytime soon haha

    So far I've printed 3 things. The first was the cat that was on the SD card, and this came out perfect. I used the filament that came with the printer. My next two models were the same, a sign for two of my kids who play Fortnite. The object was quite flat but spread across the bed. Each was printer with different filament. The first lifted very badly but not bad enough to use. The good thing was that this print was nice and easy to remove from the bed haha. The third printed perfectly but wow it was extremely difficult to get off the bed!

    I do have an issue with leveling. The bar that holds the printer head, no matter what I do in the way of adjustment, the right side is close to 3mm higher than the left. I'm in the process of having this addressed with who I bought it from, but at this stage all they are saying is to level the bed automatically, which seems to be working fine, but I don't know how it will go with taller prints.

    I would like to start making my own boxes for my Mysensors, but don't know what program to use. I've never done this sort of thing before, so at the moment I'm a little concerned about the learning curve, so if you or anyone knows of a program that is simple to use for this purpose, please share what it is!

    Enclosures / 3D Printing

  • Best 3d printers
    HomerH Homer

    I just purchased a Creality CR-10S Pro. It should arrive in a couple days. Anyone own one of these? This is my first step into the 3D making world :-)

    Enclosures / 3D Printing

  • Candle - signal Hub - A universal 433Mhz signal detector and cloner
    HomerH Homer

    @alowhum Yes, no touchscreen

    Here is the first section of the code:

    /*
     *
     * Signal Hub
     * 
     * This device can copy signals from wireless remote controls that use the 433 frequency, and then rebroadcast them. It can optionally also copy Infra red (IR) signals.
     * 
     * It can do this in three ways:
     * - Copy and replay ON and OFF signals. For example, from cheap wireless power switches. It basically copies remote controls.
     * - Copy and then replay a single signal. For example, to emulate a window sensor.
     * - Recognise signals without replaying them. For example, After learning the signal once, it can detect when a window sensor is triggered again. Or when a button on a remote control is pressed.
     * 
     * This allows you to:
     * - Create a smart home security solution using cheap window and movement sensors.
     * - Automatically turn on lights and other devices when you get home, or when the sun goes down etc, using wireless power sockets.
     * - Control automations using wireless buttons or remote controls.
     * 
     * An Arduino Nano can store 50 "recognise only" signals, or about 20 on/off signals. You can store any combination of these. If you need to store more signals you could look into using an Arduino Mega.
     * 
     * Are there any limits?
     * - This does not work on things like garage door openers or keyless entry systems for cars. 
     * These devices have a very basic protection: the code changes everytime you use it, so replaying signals will not open the door again.
     * 
     * Security?
     * - Many cheap 433Mhz devices do not use encryption. This allows us to copy the signal in the first place. 
     * This also means that your neighbour can in theory do the same thing you can: copy and replay signals picked up through the walls.
     *
     * 
     * 
     * SETTINGS */
    
     
    //#define HAS_TOUCH_SCREEN                            // Have you connected a touch screen? Connecting a touch screen is recommend.  
    
    //#define MY_ENCRYPTION_SIMPLE_PASSWD "changeme"      // If you are using the Candle Manager, the password will be changed to what you chose in the interface automatically. Be aware, the length of the password has an effect on memory use.
    
    
     /* END OF SETTINGS
      *  
      * 
      * ABOUT THE CODE
      * 
      * The code has a number of states it can be in.
      * LISTENING MODE. Here The main loop continuously listens for signals. If it detects it calls three successive funtions:
      * 1. Check if signal is a signal (SignalViabilityCheck function)
      * 2. Clean up the signal (signalCleaner function)
      * 3. Analyse the signal to find the binary code it represents (signalAnalysis function).
      * 
      * If a valid binary code is found, the next action depends on which 'state' the system is in.
      * - If in LISTENING_SIMPLE state, then the signal is compared to all the stored signals. It lets you know if there is a match.
      * - If in LISTENING_ON state, then the signal is compared to all the stored signals. It lets you know if there is a match.
      * - If in COPYING_SIMPLE state, the code is stored as a 'simple' signal. This can then be replayed later.
      * - If in COPYING_ON state, the code is stored, after which the system asks for the OFF code (COPYING_OFF state), and then stores it with the same data. 
      * - If in LEARNING_SIMPLE state, only the binary code is stored, and not the meta-data required to fully recreate the signal.
      * 
      * The final states the system can be in are:
      * - IN_MENU. This is when the system is displaying a menu on the screen.
      * - REPLAYING. This is the state while a signal is being replayed.
      * 
      * Depending on the current state the various functions can work in slightly different ways. 
      * take for example the scanEeprom function:
      * - When in LISTENING state it compares the latest found signal to existing signals stored in the EEPROM memory.
      * - When in REPLAYING state it returns data required to rebuild the original signal.
      * - If called with a 0, then it does not try to recognise or rebuild anything. This is used during setup, when we only need to know how many signals are stored.
      * 
      * __SIGNAL ANALYSIS DETAILS__
      * When it detects a signal, the code tries to find the part of the signal that repeats. 
      * In normal operation the signalCleaner function cleans up the signal and simultaneously tries to find the 'betweenSpace' variable. 
      * Often, 433Mhz signals have a repeating binary code that is interrupted by a short burst of different signals (called the 'anomaly' in this code).
      * If no anomaly can be detected, then the repeating part is probably 'back to back', without a separator signal. 
      * In this case there is a 'backup' function, the 'pattern finder'. This uses brute force to find the signal.
      * If both methods fail, then the signal cannot be copied.
      *  
      *  
      *  
      *  TODO
      *  - Check if signal is already stored before storing it. Then again, there can be good reasons to store a signal twice. Perhaps only check for doubles with recognise-only signals?
      *  - Another bit could be used to store if an on/off signal should also be recognisable. That way the remote could be used twice somehow.. Or: 
      *  - Request current status of on/off toggles from the controller. Though it might be jarring or even dangerous if all devices suddenly toggled to their new positions.
      *  - Turn off the display after a while.
      *  - Send new children as they are created.
      */
    
    
    //#define DEBUG                                     // Do you want to see extra debugging information in the serial output?
    //#define DEBUG_SCREEN                              // Do you want to see extra debugging information about the touch screen in the serial output?
    //#define MY_DEBUG                                  // Enable MySensors debug output to the serial monitor, so you can check if the radio is working ok.
    
    // Receiver and transmitter pins
    #define RECEIVER 3                                  // The pin where the receiver is connected.
    #define TRANSMITTER 4                               // The pin where the transmitter is connected.
    
    #define TOUCH_SCREEN_RX_PIN 7                       // The receive (RX) pin for the touchscreen. This connects to the transmit (TX) pin of the touchscreen.
    #define TOUCH_SCREEN_TX_PIN 8                       // The receive (TX) pin for the touchscreen. This connects to the transmit (RX) pin of the touchscreen.
    
    
    // This code has an extra pattern finding trick. Using brute force it will try to find a pattern in the data. The downside is it takes a lot of time to analyse signals this way. 
    // This means the system might not detect a signal because it is busy analysing a bad signal. It's up to you if you want to use it.
    //#define PATTERN_FINDER
    
    // Enable and select the attached radio type
    #define MY_RADIO_RF24                               // This is a common and simple radio used with MySensors. Downside is that it uses the same frequency space as WiFi.
    //#define MY_RADIO_NRF5_ESB                         // This is a new type of device that is arduino and radio all in one. Currently not suitable for beginners yet.
    //#define MY_RADIO_RFM69                            // This is an open source radio on the 433mhz frequency. Great range and built-in encryption, but more expensive and little more difficult to connect.
    //#define MY_RADIO_RFM95                            // This is a LoRaWan radio, which can have a range of 10km.
    
    // MySensors: Choose your desired radio power level. High power can cause issues on cheap Chinese NRF24 radio's.
    //#define MY_RF24_PA_LEVEL RF24_PA_MIN
    //#define MY_RF24_PA_LEVEL RF24_PA_LOW
    #define MY_RF24_PA_LEVEL RF24_PA_HIGH
    //#define MY_RF24_PA_LEVEL RF24_PA_MAX
    
    // Mysensors advanced security
    //#define MY_SECURITY_SIMPLE_PASSWD "changeme"      // Be aware, the length of the password has an effect on memory use.
    //#define MY_SIGNING_SOFT_RANDOMSEED_PIN A7         // Setting a pin to pickup random electromagnetic noise helps make encryption more secure.
    
    // Mysensors advanced settings
    #define MY_TRANSPORT_WAIT_READY_MS 10000            // Try connecting for 10 seconds. Otherwise just continue.
    //#define MY_RF24_CHANNEL 100                       // In EU the default channel 76 overlaps with wifi, so you could try using channel 100. But you will have to set this up on every device, and also on the controller.
    //#define MY_RF24_DATARATE RF24_1MBPS                 // Slower datarate makes the network more stable?
    //#define MY_NODE_ID 10                             // Giving a node a manual ID can in rare cases fix connection issues.
    //#define MY_PARENT_NODE_ID 0                       // Fixating the ID of the gatewaynode can in rare cases fix connection issues.
    //#define MY_PARENT_NODE_IS_STATIC                  // Used together with setting the parent node ID. Daking the controller ID static can in rare cases fix connection issues.
    //#define MY_SPLASH_SCREEN_DISABLED                   // Saves a little memory.
    //#define MY_DISABLE_RAM_ROUTING_TABLE_FEATURE      // Saves a little memory.
    
    
    
    // REQUIRED LIBRARIES
    
    #include <MySensors.h>                              // The library that helps form the wireless network.
    #include <EEPROM.h>                                 // Allows for storing data on the Arduino itself, like a mini hard-drive.
    
    
    //#define HAS_BASIC_OLED_SCREEN                     // Have you connected a simple OLED screen? Connecting a screen is recommend. 
    
    // Basic OLED screen
    #ifdef HAS_BASIC_OLED_SCREEN
    #define INCLUDE_SCROLLING 0                         // Simple drivers for the OLED screen.
    #define OLED_I2C_ADDRESS 0x3C
    #include <SSD1306Ascii.h>                           
    #include <SSD1306AsciiAvrI2c.h>
    SSD1306AsciiAvrI2c oled;
    #endif
    
    
    // Touch screen
    #ifdef HAS_TOUCH_SCREEN
    
    #include <SoftwareSerial.h>
    SoftwareSerial mySerial(TOUCH_SCREEN_RX_PIN,TOUCH_SCREEN_TX_PIN);                       // RX (receive) pin, TX (transmit) pin
    
    #define MAX_BASIC_COMMAND_LENGTH 16                 // How many bytes are in the longest basic command?
    #define TOUCHSCREEN_WIDTH 240
    #define TOUCHSCREEN_HEIGHT 320
    #define BUTTON_HEIGHT 53                            // How many pixels tall are the touch screen buttons?
    #define BUTTON_PADDING (BUTTON_HEIGHT/2) - 7        // The font is 14 pixels high, so this calculation places it in the middle of the buttons.
    
    My Project

  • Best 3d printers
    HomerH Homer

    I'm thinking about buying the Creality CR-10 S5. Has anyone had any experience with this 3D printer or have heard any good or negative comments about it?

    Enclosures / 3D Printing

  • Have I blown the MOSFETS?
    HomerH Homer

    I found a YouTube video that explained how to test them, but my multimeter must not be up to the job. So I created a single led dimmer sensor and hooked it up to the three MOSFETS one at a time to test, and they seem to work as they should. So my issue must be with the sketch.

    Mods, you can delete this thread if you like.

    Troubleshooting

  • Have I blown the MOSFETS?
    HomerH Homer

    A week or so ago I built a sensor to control a strip of RGB LEDs. This afternoon I thought I was going to have some time to myself to wire up the LEDs to the sensor, but things came up and I got distracted. I really wanted to see the strip light up so before going to bed I quickly wired it up, but I accidentally connected power the wrong way, not to the Arduino but to the strip. When I realised what I had done I swapped it around but it won't work. When I disconnected the strip from the sensor and powered the strip another way, the strip worked fine.

    This is my first attempt at creating such a sensor, so I can't be 100% sure that the sketch is correct, so it could be possible that it didn't work for another reason other than frying the MOSFETs. So to those of you who know more about MOSFETs than me, is it likely that they are now damaged to the point that they will no longer work? Is there a way to test them while still wired up to the sensor?

    I'll appreciate any help that can be provided. Thanks!

    Troubleshooting
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular