Author Topic: Reed Switch for Ifttt  (Read 231 times)

Bender999

  • Newbie
  • *
  • Posts: 4
    • View Profile
Reed Switch for Ifttt
« on: August 19, 2016, 10:38:11 pm »
This will be good question i have been through the forum f&q and pdf files looking for a program that will let the green leds work and send a iftt notification to a device all i can find is mqtt programs and programs that just turn on the leds i have tried righting my own programs but had no luck without using the accelometer is it possible by any chance

Share on Facebook Share on Twitter


kristofferis

  • Sr. Member
  • ****
  • Posts: 287
  • Location: Sweden
    • View Profile
Re: Reed Switch for Ifttt
« Reply #1 on: August 20, 2016, 01:47:45 am »
Hello.
I have a few questions before I could help.

What device do you want IFTTT to send a notification? Have you already setup an IFTTT recipe?

When should the green LED turn on and when should it turn off?

What is the code that you have tried with and what was the error?

Bender999

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Reed Switch for Ifttt
« Reply #2 on: August 20, 2016, 03:42:02 am »
Would like to sit it in my meat fridge and kids ice cream and treats fridge and for the mcmodule to send me a spreed sheet temps notify me when when it is above 5 degrees,battery check And when the door is open by the kids by iftt notifications and google drive. I think i may be just missing the program by just a little cause i set up 2 mcmodules and 1 works so good on temp and the works well on the reed switch i had them all working but very very slow on retrieving the data from the mcmodule had to use the reed switch to retrive the data most of the time.

kristofferis

  • Sr. Member
  • ****
  • Posts: 287
  • Location: Sweden
    • View Profile
Re: Reed Switch for Ifttt
« Reply #3 on: August 20, 2016, 04:12:07 pm »
Okey, so you have the function up and running now but you feel that the update is to slow?

Please post your current code and then I could tell what to change to improve it.

Bender999

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Reed Switch for Ifttt
« Reply #4 on: August 23, 2016, 07:50:58 pm »
I do thank you for your time in this matter but i did get it all sorted out using this code i got the reed switch, LEDS Voltage check working temperature and above 5 degrees notification working as well all through ifttt.
 Shared Event CheckTemp() RaiseEvent Every 2 Minutes
       
        Dim Temp As Float = TempSensor.GetTemp()
        Dim tempstring As String = Temp.ToString()
        Do
            Lplan.IFTTT("dkOsWFyzdBCgGu-PUE50KR", "Coldrooms2Temperature", tempstring, "", "")
           
        End Do
       
        If Temp > 5 Then
            Do
               
                Lplan.IFTTT("dkOsWFyzdBCgGu-PUE50KR", "Coldrooms2Tempishigherthan5degrees", tempstring, "", "")
               
            End Do
        End If
    End Event
    Shared Event Boot()
        Lplan.SetMidPowerMode(100)
    End Event
    Shared Event OnOff() RaiseEvent Every 180 Seconds
        LedGreen = True
        LedRed = True
        Thread.Sleep(1000000) // sleep 1 second
        LedGreen = False
        LedRed = False
    End Event
    Shared Event checkvoltage() RaiseEvent Every 5 Minutes
       
        Dim battvolt As Short = Device.BatteryVoltage()
        If battvolt < 2200 Then
            Lplan.IFTTT("dkOsWFyzdBCgGu-PUE50KR", "Coldroom2batteryvoltagegettinglow",)
        Else
           
        End If
       
    End Event
    Shared Event ReedSwitchChanged()
        If ReedSwitch = True Then
            Do
                Lplan.IFTTT("dkOsWFyzdBCgGu-PUE50KR", "DoorOpenColdroom2", "", "")
            End Do
        End If
       
    End Event
End Class
If you think there could be some fine tuning that could be done please feel free to let me know.