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.


  • Contest Winner

    @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...


Log in to reply
 

Suggested Topics

  • 1
  • 6
  • 3
  • 1
  • 2
  • 3

6
Online

11.4k
Users

11.1k
Topics

112.7k
Posts