Navigation

    Netgate Discussion Forum
    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search

    [QUESTION] Occupancy Presence Checking

    Off-Topic & Non-Support Discussion
    1
    1
    477
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • K
      konradwalsh last edited by

      Is something like this possible?

      The idea is that known MAC addresses are queryable and I can trigger a http call  to set a status bit

      I have searching all day.. trying to find appropriate script commands to do something similar..

      this is what works on DD-WRT

      #!/bin/sh
      # seconds between checks
      WATCHDOG_SLEEP_SEC=2
      # MAC Address 1
      MAC_ADDRESS_1="[XX:XX:XX:XX:XX:XX]"
      # MAC Address 2
      MAC_ADDRESS_2="[YY:YY:YY:YY:YY:YY]"
      # Vera VSwitch 1 Device ID
      VSWITCH_1="[99]"
      # Vera VSwitch 2 Device ID
      VSWITCH_2="[100]"
      
      #This loop will check if a device is registered on the AP and send the on/off command to vera. 
      
      while sleep $WATCHDOG_SLEEP_SEC
      do
      if wl assoclist | grep -Fq $MAC_ADDRESS_1
      then
          #echo Device 1 user is in
          wget -qs "http://[YOUR_VERA_IP_ADDRESS]:3480/data_request?id=lu_action&output_format=xml&DeviceNum=$VSWITCH_1&serviceId=urn:upnp-org:serviceId:VSwitch1&action=SetTarget&newTargetValue=1"
      else
          #echo Device 1 user is out
          wget -qs "http://[YOUR_VERA_IP_ADDRESS]:3480/data_request?id=lu_action&output_format=xml&DeviceNum=$VSWITCH_1&serviceId=urn:upnp-org:serviceId:VSwitch1&action=SetTarget&newTargetValue=0"
      fi
      
      if wl assoclist | grep -Fq $MAC_ADDRESS_2
      then
          wget -qs "http://[YOUR_VERA_IP_ADDRESS]:3480/data_request?id=lu_action&output_format=xml&DeviceNum=$VSWITCH_2&serviceId=urn:upnp-org:serviceId:VSwitch1&action=SetTarget&newTargetValue=1"
      else
          wget -qs "http://[YOUR_VERA_IP_ADDRESS]:3480/data_request?id=lu_action&output_format=xml&DeviceNum=$VSWITCH_2&serviceId=urn:upnp-org:serviceId:VSwitch1&action=SetTarget&newTargetValue=0"
      fi
      
      done
      &
      
      1 Reply Last reply Reply Quote 0
      • First post
        Last post

      Products

      • Platform Overview
      • TNSR
      • pfSense
      • Appliances

      Services

      • Training
      • Professional Services

      Support

      • Subscription Plans
      • Contact Support
      • Product Lifecycle
      • Documentation

      News

      • Media Coverage
      • Press
      • Events

      Resources

      • Blog
      • FAQ
      • Find a Partner
      • Resource Library
      • Security Information

      Company

      • About Us
      • Careers
      • Partners
      • Contact Us
      • Legal
      Our Mission

      We provide leading-edge network security at a fair price - regardless of organizational size or network sophistication. We believe that an open-source security model offers disruptive pricing along with the agility required to quickly address emerging threats.

      Subscribe to our Newsletter

      Product information, software announcements, and special offers. See our newsletter archive to sign up for future newsletters and to read past announcements.

      © 2021 Rubicon Communications, LLC | Privacy Policy