Skip to content
  • 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
rayanR

rayan

@rayan
  • Getting Started
  • Controller
  • Build
  • Hardware
  • Download/API
  • Forum
  • Store
About
Posts
25
Topics
3
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Multi Button Relay Sketch
    rayanR rayan

    @Boots33
    hi my friend.
    i use your sketch and thank you.but there is a problem.
    sketchs in site , when relay is fail , when i send command , so show to me "Error sending switch command, check device/hardware !" but your sketch dont show this error. so i dont understand relay is fail or no , when we are out home. can you fix this ?

    Development

  • Multi Button Relay Sketch
    rayanR rayan

    @pepson
    i dont have a ready sketch! wait to boots answer

    Development

  • Multi Button Relay Sketch
    rayanR rayan

    @pepson

    @Boots33 can solve this maybe because i dont work with Bounce2 lib.

    Development

  • Multi Button Relay Sketch
    rayanR rayan

    @Boots33
    ack is a feedback . is this true ? so when i am out of home and i want turn on light , so ack show me that light is on or no ! also when there is a problem in connection and ack dont receive, so node search and found a new way for connection.
    now i dont have a arduino and radio for test :) but do you think this code will be ok ?without else.

    void loop()
    {
     if (!isTransportOK())
    {
    if (...)            //if change switch to up or down
    ...                 //change state of relay
    if(isTransportOK())
    send(msg.set(state ? true : false), true);  // (last state)
    }
      
      debouncer.update();
      // Get the update value
      int value = debouncer.read();
      if (value != oldValue && value == 0) {
        send(msg.set(state ? false : true), true); // Send new state and request ack back
      }
      oldValue = value;
    }
    

    (i can not work with Bounce2 library :) ) please help to fill lines
    in loop we add a "if (!isTransportOK())" and write when change switch (on/off) state of relay change and this is repeat until connection will be ok ! so send a ack and for continue follow your code...
    is this right ? can you do this change ?

    Development

  • Multi Button Relay Sketch
    rayanR rayan

    @Boots33
    ack is important , so we can not found any solution for this ? for exapmle add a code to this sketch , that when radio is disconnect so without ack work and when radio is ok this way stop and with ack work again.
    this idea is for when a radio have problem or fail or other reason... so this light or other divece dont stop working and work handy when radio go to correct or change radio....

    if you can change your code and add this option , so your sketch is best code for light control

    Development

  • Multi Button Relay Sketch
    rayanR rayan

    @pepson
    i am beginner and i hope some one help to you

    Development

  • Multi Button Relay Sketch
    rayanR rayan

    @Boots33 this your code is good, but there is a small issue .button work just when the connection is ok (radio with gateway) ! and when radio is disconnect or controller is off, so button dont work handy . do you have any idea for this ? that when controller is off the button work handy

    Development

  • Multi Button Relay Sketch
    rayanR rayan

    @pepson
    go to : file > examples > mysensors > clear eeprom config
    and select arduino pro mini from : tools > board > arduino pro or pro mini

    Development

  • Multi Button Relay Sketch
    rayanR rayan

    @Boots33
    thank you very much

    Development

  • Multi Button Relay Sketch
    rayanR rayan

    @Boots33
    oh , after added this device , happen a Event ! node id of motion sensor and this device is 1 ! and after sense of motion light on in dashborad ! why both Catch node id 1 .
    i dont add #define node id for motion and for this. but both take id 1 and Interference

    0_1475589467935_mdmddmdmd.jpg

    Development

  • Multi Button Relay Sketch
    rayanR rayan

    @Boots33
    great.
    so this is best sketch :)
    thank you

    Development

  • Multi Button Relay Sketch
    rayanR rayan

    @Boots33 said:

    i test your code and this is excellent . but there is another tiny problem :)
    when relay is ON then loses power so in app relay is ON (icon) , when power is restored and relay go to OFF in app icon is ON and dont Ack for go to show Off .
    you are best in programming :)

    Development

  • Multi Button Relay Sketch
    rayanR rayan

    @Boots33 said:

    @rayan yes it was meant to be used with push buttons not toggle switches. It will need a few tweaks to make it work. I am at work now so will take a look when I get home.

    ok thank you

    Development

  • Multi Button Relay Sketch
    rayanR rayan

    but this app , every time after the restored power and startup, relay ( related to state of up/down switch) have different state

    Development

  • Multi Button Relay Sketch
    rayanR rayan

    @Boots33
    yes, all of lights are on or off (some on some off) so when looses power and power is restored , i want all of lights be off also in web and app light = off , so with key in app or change state of switch turn on again ...

    Development

  • Multi Button Relay Sketch
    rayanR rayan

    @Boots33
    i want if power of home be off and after time on again , so all of relay ( with switch up/down with each state) to be off. now in this code after startup relay is unstable for 1s and my light is on and aff quickly :)
    also if lights are off , if power off/on , so some of relay go to ON in startup !

    Development

  • Multi Button Relay Sketch
    rayanR rayan

    you are set value for relay in code

      digitalWrite(relayPinA, RELAY_OFF);
      digitalWrite(relayPinB, RELAY_OFF);
    

    but i dont know why after start up . . .

    Development
  • Login

  • Don't have an account? Register

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