Node being digital input and output

9 years 2 months ago #158 by ralleboehm
Awesome project. Best one i have seen so far! Good job.

I am using the mysensors sketch for relay-with-button-actuator, and on the debug console i can see the digital reads submitted by the node on the nrf network when i switch the button.

I assume i could use automation tasks to send back a message to the same node to switch the relay state when this read has been received.

Could someone give me a hand how to syntax this right?

Please Log in or Create an account to join the conversation.

9 years 2 months ago - 9 years 2 months ago #159 by EasyIoT

ralleboehm wrote: Awesome project. Best one i have seen so far! Good job.

I am using the mysensors sketch for relay-with-button-actuator, and on the debug console i can see the digital reads submitted by the node on the nrf network when i switch the button.

I assume i could use automation tasks to send back a message to the same node to switch the relay state when this read has been received.

Could someone give me a hand how to syntax this right?


Thx.
Here is example. Put this code in automation Setup function:
EventHelper.ModuleChangedHandler((o, m, p) =>
    {
    	//Console.WriteLine(m.Address + " in program id "+ Program.ProgramId.ToString()+ " property "+ p.Property + " value " + p.Value);
	
	if ((m.Domain == "MySensors") && (m.Address = "N1S1") && (P.Value == "1"))
	  DriverHelper.ProcessCommad(Domains.MYSENSORS, "N1S3", "ControlOn", "");

        return true;
    });

This code sample sends command ON to MySensors module with address N1S3 when module N1S1 is switched ON. See beta release thread for details.
The following user(s) said Thank You: ralleboehm

Please Log in or Create an account to join the conversation.

9 years 2 months ago #313 by ralleboehm
Thanks.
Finally had some time on my hand to play with my toys again.
a simple crontab setting of * * * * * will not do the trick i suppose ?

Did this work for you?

Please Log in or Create an account to join the conversation.

9 years 2 months ago #317 by EasyIoT

ralleboehm wrote: Thanks.
Finally had some time on my hand to play with my toys again.
a simple crontab setting of * * * * * will not do the trick i suppose ?

Did this work for you?


no, cron is not good solution. It must be event based solution. I'm preparing tutorials about automation, and everything will be described.

Please Log in or Create an account to join the conversation.

Time to create page: 0.348 seconds

Forum latest

  • No posts to display.