Help needed to extend binary sensor to multiple switches
-
Hey guys. What a wonderful project you've got going on. I've managed to build a temp/humidity/pressure sensor and have been toying with the binary sensor. I was able to create the binary sensor just fine, but now I'd like to extend it to multiple switches on the same node.
I am not a programmer so I really am just playing around with things and trying to get it to work. I have eight switches that I would like to monitor and am afraid that it would be pretty inefficient to test each switch individually. Is there an easy way to test all switches as a binary number, compare it to the previous value read and then trigger whatever switches have changed. I'm not sure if that even makes sense but would love to see any suggestions and/or code to accomplish something like this.
Any help is greatly appreciated. Thanks again.
-
Hey guys. What a wonderful project you've got going on. I've managed to build a temp/humidity/pressure sensor and have been toying with the binary sensor. I was able to create the binary sensor just fine, but now I'd like to extend it to multiple switches on the same node.
I am not a programmer so I really am just playing around with things and trying to get it to work. I have eight switches that I would like to monitor and am afraid that it would be pretty inefficient to test each switch individually. Is there an easy way to test all switches as a binary number, compare it to the previous value read and then trigger whatever switches have changed. I'm not sure if that even makes sense but would love to see any suggestions and/or code to accomplish something like this.
Any help is greatly appreciated. Thanks again.
@chuckconnors said:
is there an easy way to test all switches as a binary number
yes, with direct port manipulation you can do this.
Polling Port Registers (you should be able to use 0-7 (PORTD), with the standard MySensors radio attachment)
play with that and let us know if you need help...
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login