@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 ?
rayan
@rayan
Best posts made by rayan
Latest posts made by rayan
-
RE: Multi Button Relay Sketch
-
RE: Multi Button Relay Sketch
@pepson
i dont have a ready sketch! wait to boots answer -
RE: Multi Button Relay Sketch
@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 ? -
RE: Multi Button Relay Sketch
@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
-
RE: Multi Button Relay Sketch
@pepson
i am beginner and i hope some one help to you -
RE: Multi Button Relay Sketch
@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