Author Topic: Mailbox Logic  (Read 1210 times)

0 Members and 1 Guest are viewing this topic.

IKROWNI

  • $upporter
  • Sr. Member
  • *****
  • Posts: 146
  • Karma: 2
    • View Profile
Mailbox Logic
« on: September 24, 2016, 03:01:13 PM »
Just bought a zwave tilt sensor and plan to install it onto my mailbox. I want vox to tell me when the box was opened and shut as "delivered" when its the first time that sequence has happened. Then if the box opens and then closes again i want it to tell me that the mail was obtained.

This is what i have put together so far and vox writes the text file for a rainmeter skin to display (open/closed) but this isnt very helpful as to whether the mail was already obtained or not.

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.2.3-->
<command id="625" name="MailBox" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>Vera.Get.Status</cmdType>
    <params>
      <param>99</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <if ifBlockDisabled="False" ifNot="False">
    <ifType>(A)==(B)</ifType>
    <ifParams>{LastResult}&amp;&amp;1</ifParams>
    <then>
      <action>
        <cmdType>Results.Replace</cmdType>
        <params>
          <param>1</param>
          <param>Open</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </then>
    <else>
      <action>
        <cmdType>Results.Replace</cmdType>
        <params>
          <param>0</param>
          <param>Closed</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </else>
  </if>
  <action>
    <cmdType>File.Write</cmdType>
    <params>
      <param>C:\Users\theki\Documents\Rainmeter\Skins\Home Automation\_MISC_\MailBox\MailBox.txt</param>
      <param>BEGIN{LastResult}END</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <event>IKROWNI-VERA.Switch.99.Off</event>
  <event>IKROWNI-VERA.Switch.99.On</event>
</command>

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Mailbox Logic
« Reply #1 on: September 24, 2016, 03:18:59 PM »
While less automatic than your idea it might be more practical to just have rainmeter display the last date and time that the box was opened. From that you should quite easily be able to tell if it was you or the mail service.

Based on this idea, if you have a relatively small window of time each day in which the postal service normally delivers then a bit of logic could be employed to make a guess at who was accessing it.

A purely ping pong solution could also work using a variable but this would probably need user intervention to correct the status on a regular basis.

IKROWNI

  • $upporter
  • Sr. Member
  • *****
  • Posts: 146
  • Karma: 2
    • View Profile
Re: Mailbox Logic
« Reply #2 on: September 24, 2016, 03:40:01 PM »
Ahh didn't think about the whole thing flipflopping and having to reset it over and over. The time idea sounds like it will work just fine. That with phone notifications will work. Thanks.