Help Understanding MySensors Coding Syntax
-
If you scroll down on that page , at section 'Starting up the Library' there is a detailed description of gw.begin.
-
So, if I have a relay that I want to control via a button and my vera and I change the state with the button, how would I typically write that change to my Vera. Also, if I changed the state on my Vera, how would I read that change?
Thank you for all your help!
-
Did you check the http://www.mysensors.org/build/relay#relaywithbuttonactuator-example ? It works out-of-the-box exactly like you want...
-
Yes, I've looked at that, and for that example, it would work great. But I guess I am just trying to understand the coding side as much as I can, in case I want to improve/add features for other sensors.
One of my projects that I am trying to do is monitor my garage. I will have a limit switch that is pressed by the door carriage when the garage door is open and another limit switch that will be pressed when the garage door is closed So, based on which button is HIGH or LOW, I can determine if the garage door is open or closed. Then I can trigger a relay connected to the button to open or close the garage door.
Let me know if I am getting in way over my head or not as someone who has very little coding experience.
-
My suggestion is to read carefully that page, from the 'Ok! So, what is happening here?' down ;-)
-
Ok, I will do that!
But, don't be surprised if I'm back here on the forum later! :)
-
I guess one more nooby questions would be, what exactly is a child sensor? I understand that each sensor node is considered a sensor, but is each sensor or relay or whatever connected to that node a child sensor?
So, a node that has 2 buttons and a relay has 3 child sensors?
Thank you.
-
What is the difference between a child sensor and an actuator? I have heard both used, but I am not sure if they mean the same thing or not.
Thanks!