Navigation

    • Register
    • Login
    • OpenHardware.io
    • Categories
    • Recent
    • Tags
    • Popular
    1. Home
    2. Dick
    3. Topics
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    Topics created by Dick

    • Dick

      Binary button must lock after using
      General Discussion • • Dick  

      4
      0
      Votes
      4
      Posts
      686
      Views

      nagelc

      Duh .. . yeah . ... like @skywatch said.
    • Dick

      IR remote controle
      General Discussion • • Dick  

      5
      0
      Votes
      5
      Posts
      1386
      Views

      Dick

      @nca78 I start experiment this weekend and will give it a try. Thanks for the ideas to make a working solution, in this case the use of an existing IR controle.
    • Dick

      Not all Relais visible in Domoticz
      Development • • Dick  

      9
      0
      Votes
      9
      Posts
      1050
      Views

      nagelc

      Another thing to try. Try changing the button IDs to 6 and 7. You define the button child IDs as 3 and 4. The relays are presented with child ID's 1 through 5 by the loop in Presentation(). So the buttons have the same child IDs as two of the relays. Some sensors can have the same child ID, like temperature and humidity, but I don't know about S_DOOR and S_BINARY. Also, delete this code i suggested. It needs some tweaking and I suspect the issue is really the overlap of the child IDs: static bool startup = true; If (startup) { Send initial value for each switch/relay startup=false; }
    • Dick

      Multi relay with two Binary switches
      Development • • Dick  

      2
      0
      Votes
      2
      Posts
      789
      Views

      Dick

      @dick said in Multi relay with two Binary switches: I created 2 project where I need 5 relays and 2 buttons. If I put the number of relays on 5, I only see 3 in my Domoticz. The switches are visible in Domoticz without problems. How can I fix the relay issue? // Enable debug prints to serial monitor #define MY_DEBUG // 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 <Bounce2.h> #define RELAY_1 A0 // Arduino Digital I/O pin number for first relay (second on pin+1 etc) #define NUMBER_OF_RELAYS 5 // Total number of attached relays #define RELAY_ON 0 // GPIO value to write to turn on attached relay #define RELAY_OFF 1 // GPIO value to write to turn off attached relay #define CHILD_ID_IRBIN 3 #define CHILD_ID_IRBUI 4 #define IRBIN_PIN 3 // Arduino Digital I/O pin for button/reed switch #define IRBUI_PIN 4 Bounce debouncerIRBIN = Bounce(); Bounce debouncerIRBUI = Bounce(); int oldValue_IRBIN = -1; int oldValue_IRBUI = -1; MyMessage msgIRBIN(CHILD_ID_IRBIN, V_TRIPPED); MyMessage msgIRBUI(CHILD_ID_IRBUI, V_TRIPPED); void before() { for (int sensor=1, pin=RELAY_1; sensor<=NUMBER_OF_RELAYS; sensor++, pin++) { // Then set relay pins in output mode pinMode(pin, OUTPUT); // Set relay to last known state (using eeprom storage) digitalWrite(pin, loadState(sensor)?RELAY_ON:RELAY_OFF); } } void setup() { // Setup the button1 pinMode(IRBIN_PIN, INPUT); debouncerIRBIN.attach(IRBIN_PIN); debouncerIRBIN.interval(5); digitalWrite(IRBIN_PIN, HIGH); // Setup the button2 pinMode(IRBUI_PIN, INPUT); debouncerIRBUI.attach(IRBUI_PIN); debouncerIRBUI.interval(5); digitalWrite(IRBUI_PIN, HIGH); } void presentation() { // Register binary input sensor to gw (they will be created as child devices) // You can use S_DOOR, S_MOTION or S_LIGHT here depending on your usage. // If S_LIGHT is used, remember to update variable type you send in. See "msg" above. present(CHILD_ID_IRBIN, S_DOOR); present(CHILD_ID_IRBUI, S_DOOR); for (int sensor=1, pin=RELAY_1; sensor<=NUMBER_OF_RELAYS; sensor++, pin++) { // Register all sensors to gw (they will be created as child devices) present(sensor, S_BINARY); } } void loop() { debouncerIRBIN.update(); // Get the update value int valueIRBIN = debouncerIRBIN.read(); if (valueIRBIN != oldValue_IRBIN) { // Send in the new value send(msgIRBIN.set(valueIRBIN == HIGH ? 1 : 0)); oldValue_IRBIN = valueIRBIN; } debouncerIRBUI.update(); // Get the update value int valueIRBUI = debouncerIRBUI.read(); if (valueIRBUI != oldValue_IRBUI) { // Send in the new value send(msgIRBUI.set(valueIRBUI == HIGH ? 1 : 0)); oldValue_IRBUI = valueIRBUI; } } void receive(const MyMessage &message) { // We only expect one type of message from controller. But we better check anyway. if (message.type==V_STATUS) { // Change relay state digitalWrite(message.sensor-1+RELAY_1, message.getBool()?RELAY_ON:RELAY_OFF); // Store state in eeprom saveState(message.sensor, message.getBool()); // Write some debug info Serial.print("Incoming change for sensor:"); Serial.print(message.sensor); Serial.print(", New status: "); Serial.println(message.getBool()); } } Sorry, add my questions two times
    • Dick

      No matching function for call 'DHT::DHT()'
      Development • • Dick  

      6
      0
      Votes
      6
      Posts
      7896
      Views

      mfalkvidd

      @dick great. Thanks for reporting back.
    • Dick

      Maximum of relais and Binary buttons on Nano?
      General Discussion • • Dick  

      7
      0
      Votes
      7
      Posts
      1348
      Views

      Dick

      @Dick Still try to get it working. What I have untill now, 5 working relais, where 2 can be activated with a button. Only the Binary Button will not work and is not visible in Domoticz, For this Binary Button I used the default script (https://www.mysensors.org/build/binary). If I can get this button work (better is 2 Binary Buttons, my project is finished. Who can help me!
    • Dick

      Upgraded to 2.11 and Domoticz 3.513. On/Off will not switch
      General Discussion • • Dick  

      13
      0
      Votes
      13
      Posts
      2156
      Views

      Dick

      @Dick Still trying to find the problem. What I did in the past hours, fresh install of the Pi and the Mysensors gateway, Connect a Node and activate them in Domoticz.It works good (4 relays wih button). Adding anothe nod, instaling no problem and actiate in Domotic. Tst all the active sensors and nothing works. Deleted all the active sensors and dit the same as befor only i gave the nodes a radio ID. Sme resut, frst node worked goodand addig a second, nothing woks. Beore adding the node I tested them on a test module. Does have anybody an Idea??
    • Dick

      Conversion from 1.5.4 to 2.1.1.
      General Discussion • • Dick  

      10
      0
      Votes
      10
      Posts
      1867
      Views

      Dick

      @korttoma That is easy,Thanks for the solution.
    • Dick

      double RelyWithButonActuator not working
      General Discussion • • Dick  

      3
      0
      Votes
      3
      Posts
      787
      Views

      Dick

      Thanks for the solution, I tested it and works fine now. In Answer to your question why I use the old version of MySensors, at the moment I am re-configurating my ne RP with the latest version of Domoticz. After that I will connect the latest MYsensors Gateway to it. If all the nodes keep on working on the new environment, there is not an immediate need to adjust the code of all my nodes. Is my approach correct? if not please reply.
    • Dick

      Binary button conflicting Relais with button
      General Discussion • • Dick  

      4
      0
      Votes
      4
      Posts
      884
      Views

      Dick

      @mfalkvidd i thought is was ok because I defined 4 binary buttons 2, 8, A0 and A1 and they only work like a button. Beside these Buttons there is a class in use for the 3x relais with extra buttons to control the relais or do I make a mistake?
    • Dick

      pir trigger must start delay
      General Discussion • • Dick  

      16
      0
      Votes
      16
      Posts
      3085
      Views

      Dick

      @BartE What an extended answere. Here I can do something with. Good learning stuff.
    • Dick

      relays do not work using button
      General Discussion • • Dick  

      5
      0
      Votes
      5
      Posts
      1005
      Views

      Dick

      @mfalkvidd you are right, i try to make one relay working.
    • Dick

      Binary switch not working
      Development • • Dick  

      4
      0
      Votes
      4
      Posts
      1176
      Views

      AWI

      enable debug and put some print() statements in to see what happens.
    • Dick

      Send notification/email x-times
      Domoticz • • Dick  

      6
      0
      Votes
      6
      Posts
      2733
      Views

      Dick

      @gus thanks for the info, it looks good. I will try to start with it tomorrow. Hope it can help me.
    • Dick

      temp sensor keep on loging status switch
      General Discussion • • Dick  

      10
      0
      Votes
      10
      Posts
      1772
      Views

      flopp

    • Dick

      bi stable 2 coil relais switch
      General Discussion • • Dick  

      2
      0
      Votes
      2
      Posts
      750
      Views

      Dick

      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.
    • Dick

      error auto restart pi
      Domoticz • • Dick  

      3
      0
      Votes
      3
      Posts
      975
      Views

      Dick

      @mfalkvidd I did not noticed that, I changed it to disabled and will monitor it during the upcomming days. Thanks for the tip!
    • Dick

      one button code lock
      General Discussion • • Dick  

      13
      0
      Votes
      13
      Posts
      2767
      Views

      TheoL

      @Dick I love CNC projects. I want to do my first lamination project as a housing for a MySensors project. And also would love the build the Japanese lamp for which I've created the gesture controlled lamp. I recently purchased a decent table saw from the LIDL. Well it's better than what I have. So I hope to speed up my projects. I've mounted it last Saturday and it works. I've got a new 2000W tool
    • Dick

      gw send, how to do in my combination of sensors
      General Discussion • • Dick  

      9
      0
      Votes
      9
      Posts
      2108
      Views

      Dick

      @TheoL My Domoticz works again, I have to give it a fix ip because the IP was change and for your info, Your solution worked very well. It is now visible in Domoticz. Thanks for the support now I have to wait for other parts, I wait for my last parts for this project, an IR receiver so I can use a remote controle. After that I can use this project as a universal project, a default design in basic. Again thanks!
    • Dick

      dht22 with relay irregular measurement and operation
      Development • • Dick  

      3
      0
      Votes
      3
      Posts
      959
      Views

      gundark2

      So I'm new to all this, however anytime I get funky things going on when I have multiple sensors on a node I found that introducing a delay in between the readings helped smooth things out. Hopefully someone will correct me if I'm wrong, but I have had some luck with delays. Also I built one to control my hot tub and I found noise from the pump messed things up, de-coupling capacitors became my friend after that.
    • Dick

      delay for LDR sensor
      General Discussion • • Dick  

      13
      0
      Votes
      13
      Posts
      2437
      Views

      Dick

      good luck and i advice you to do it wll otherwise you have an issue
    • Dick

      dht22 2x and LDR and RelayWithButtonActuator
      General Discussion • • Dick  

      6
      0
      Votes
      6
      Posts
      1503
      Views

      mfalkvidd

      @Dick easiest way to fix is probably to uncomment #define CHILD_ID_RELAYWITHACTUATOR 5 and change msg[i].sensor = i; gw.present(i, S_LIGHT); to msg[i].sensor = CHILD_ID_RELAYWITHACTUATOR; gw.present(CHILD_ID_RELAYWITHACTUATOR, S_LIGHT); // quick workaround, only works for 1 relay That will break if you start using more than one relay though, so keep that in mind if you expand the sketch in the future
    • Dick

      pir combination with working 4-relay and 4 buttons
      General Discussion • • Dick  

      13
      0
      Votes
      13
      Posts
      3183
      Views

      Dick

      thanks for this change. I read about it. I change it right away.
    • Dick

      combine working 4 relay with buttons with HC-SR501 motion sensor
      Development • • Dick  

      1
      0
      Votes
      1
      Posts
      749
      Views

      No one has replied

    • Dick

      Light level sensor add to Domoticz
      Domoticz • • Dick  

      4
      0
      Votes
      4
      Posts
      3279
      Views

      Dick

      I read about blocky for domoticz. It looks easy but my first steps are not so easy. I opened in "more options" the option "events", in events I select a "Control" (if/Do), also a "Logic" (>-), a "device " (temperature). In this beginning fase I am not able to connect temp device to the Logic. Anybody recognize this?
    • Dick

      devices not in devices list
      Domoticz • • Dick  

      18
      0
      Votes
      18
      Posts
      5465
      Views

      d-smes

      @Dick said: gw.present(CHILD_ID_TEMP1, S_TEMP); gw.present(CHILD_ID_TEMP1, S_TEMP); Try changing the second ID to CHILD_ID_TEMP2 (note the "2") and see if that works better.
    • Dick

      Cobine working DHT22 and LDR with a RelayWithButtonActuator
      Development • dht22 ldr relay • • Dick  

      36
      0
      Votes
      36
      Posts
      5199
      Views

      BartE

      @Dick Not sure what your approach is but normally i start with prototyping using these wires and when all works fine (software and hardware) i solder everything together on a PCB.
    • Dick

      Multiple DHT22 in one sensor for greenhouse (newbee question)
      Troubleshooting • multiple dht22 • • Dick  

      11
      0
      Votes
      11
      Posts
      5194
      Views

      palmerfarmer

      Is there a way i could display the temp and hum for each sensor on an lcd screen? I know how to do this for data that is not using pointers. below is my sketch that flips between 2 sensors on the LCD /* test modified from a v1 basic mutliple multi dht22 sketch Gives correct temp and humidity readings for each dht22 in domoticz (ie not crossed between 1 and 2) Not displaying properly on the LCD yet Domoticz ver 4.11558 beta Gateway 3.2.1 node 3.2.1 09/12/2019 Arduino Mega 1.8 inch TFT LCD Display 128x160 8/16Bit ST7735S x2 DHT22 NRF24 */ #define MY_DEBUG #define MY_RADIO_NRF24 //Mega Pins 49 CE, 53 CSN/CS, 52 SCK, 51 MOSI, 50 MISO #define MY_RF24_CE_PIN 49 #define MY_RF24_CS_PIN 53 #define MY_RF24_PA_LEVEL (RF24_PA_MIN) #define MY_NODE_ID 103 #include <UTFT.h> //LCD 1.8 #include <SPI.h> #include <MySensors.h> #include <DHT.h> #define RELAY1 44 #define RELAY2 45 //static const uint8_t FORCE_UPDATE_N_READS = 10; extern uint8_t BigFont[]; extern uint8_t SmallFont[]; #define NUM_SENSORS 2 unsigned long SLEEP_TIME = 6000; // Sleep time between reads (in milliseconds) //MySensor gw; MyMessage tempMssg(0, V_TEMP); MyMessage humMssg(NUM_SENSORS, V_HUM); byte tempID[NUM_SENSORS] = {0, 1}; byte humID[NUM_SENSORS] = {2, 3}; DHT* dht[NUM_SENSORS]; byte sensorPin[NUM_SENSORS] = {40, 42}; float lastTemp[NUM_SENSORS] = {0.0, 0.0}; float lastHum[NUM_SENSORS] = {0.0, 0.0}; boolean metric = true; //LCD setup UTFT myGLCD(ITDB18SP, 11, 12, 8, 9, 10); // lcd pins 3,2,6,5,4 void setup() { myGLCD.InitLCD(LANDSCAPE);// or PORTRAIT myGLCD.clrScr(); myGLCD.setColor(200, 255, 255); myGLCD.setBackColor(0, 0, 0); myGLCD.setFont(SmallFont); myGLCD.print("Version & Sketch", LEFT, 3); myGLCD.print("V.2 TEST5", LEFT, 16); delay(1000); myGLCD.clrScr(); myGLCD.setFont(SmallFont); myGLCD.setColor(255, 255, 255); myGLCD.print("TH1 OUTSIDE", 2, 2); myGLCD.print("o", 67, 12); myGLCD.print("C", 74, 15); myGLCD.print("%", 150, 15); myGLCD.print("TH2 INSIDE", 2, 36); myGLCD.print("o", 67, 46); myGLCD.print("C", 74, 49); myGLCD.print("%", 150, 49); Serial.begin(9600); // begin(); for (int i = 0; i < NUM_SENSORS; i++) { dht[i] = new DHT; dht[i]->setup(sensorPin[i]); } sendSketchInfo("DHT22 Humidity test5", "2.0"); for (int i = 0; i < NUM_SENSORS; i++) { present(tempID[i], S_TEMP); present(humID[i], S_HUM); } metric = getControllerConfig().isMetric; Serial.println(F("Setup Complete.")); } void loop() { for (int i = 0; i < NUM_SENSORS; i++) { delay(dht[i]->getMinimumSamplingPeriod()); float temperature = dht[i]->getTemperature(); if (isnan(temperature)) { Serial.print(F("Failed reading temperature from DHT")); Serial.println(i); } else if (temperature != lastTemp[i]) { lastTemp[i] = temperature; if (!metric) { temperature = dht[i]->toFahrenheit(temperature); } send(tempMssg.setSensor(i).set(temperature, false)); // no ack Serial.print(F("T")); Serial.print(i); Serial.print(F("= ")); Serial.println(temperature); } myGLCD.setFont(BigFont); myGLCD.setColor(100, 255, 255); myGLCD.printNumF(temperature, 1, 1, 15); // this where something needs to be changed to get it to display each temp separately float humidity = dht[i]->getHumidity(); if (isnan(humidity)) { Serial.print("Failed reading humidity from DHT"); Serial.println(i); } else if (humidity != lastHum[i]) { lastHum[i] = humidity; send(humMssg.setSensor(i).set(humidity, false)); // no ack Serial.print(F("H")); Serial.print(i); Serial.print(F("= ")); Serial.println(humidity); // this where something needs to be changed to get it to display each hum separately myGLCD.setFont(BigFont); myGLCD.setColor(100, 255, 255); myGLCD.printNumF(humidity, 1, 85, 15); } } sleep(SLEEP_TIME); //sleep a bit }```