Welcome, Guest
Username: Password: Remember me

TOPIC: Remote switch turns on remote relay

Remote switch turns on remote relay 6 months 3 weeks ago #3466

  • bleo8onhs
  • bleo8onhs's Avatar
  • Offline
  • New Member
  • Posts: 4
  • Karma: 0
Hi! I started using easyiot a while ago and i setup a raspberrypi2 easyiot server, three nodes, all with esp8266 and arduino nano. One checks the temp(N2S0) and humidity(N2S1)(dht22), other has two relays(N3S1) and the other is a switch(N4S0). Everything are driven from the esp8266 driver. I want to use them for an home automation project. I am trying to create an automation so that when i press the switch the remote relay activates.

Can you help me with the code?

EDIT: The relay is set as an digital output and the switch as an digital input
Last Edit: 6 months 3 weeks ago by bleo8onhs. Reason: add info
The administrator has disabled public write access.

Remote switch turns on remote relay 6 months 3 weeks ago #3469

  • piman
  • piman's Avatar
  • Offline
  • Premium Member
  • Posts: 111
  • Thank you received: 12
  • Karma: 2
piman wrote:
:woohoo: Thanks Harry,
That seemed to have done the trick thanks a lot, I have modified the code slightly so that it switches the buzzer off when the door is closed, here is an example just in case someone else was having the same problem I was. I think I've got it now thanks to Harry.

public void Setup()

{

    {

EventHelper.ModuleChangedHandler((o, m, p) =>
    {
    	Console.WriteLine(m.Address + " in program id "+ Program.ProgramId.ToString()+ " property "+ p.Property + " value " + p.Value);
	
      
    if (m.Domain == Domains.MYSENSORS && m.Address == "N11S3" && p.Property == "Sensor.DoorWindow" && p.Value == "1")
      
	 
 	DriverHelper.ProcessCommad(Domains.RPIGPIO, "Pin_P1_07", "ControlOn","");
      
     
   if (m.Domain == Domains.MYSENSORS && m.Address == "N11S3" && p.Property == "Sensor.DoorWindow" && p.Value == "0")

	DriverHelper.ProcessCommad(Domains.RPIGPIO, "Pin_P1_07", "ControlOff","");
      
        return true;
    });
      
    } 
}
Next step email notification.
Try this should help
The administrator has disabled public write access.
Time to create page: 0.117 seconds
Powered by Kunena Forum