There are options for threading when creating a plugin.
However, when utilizing the LUA windows for a scene (Either the lua for a trigger or the scene’s main lua window) you are left to define a single threaded block of lua code. If this block of code returns false … subsequent processing stops … if it returns true, or nothing ; subsequent processing continues.
Typical processing involves the following steps (As appropriate)
[ol][li]Trigger or Schedule or Button Click from the UI[/li]
[li]Triggers LUA Code[/li]
[li]Scene’s LUA Code[/li]
This code gets executed as a result of the corresponding trigger being initiated or the scene being activated. It is assumed that this LUA code will not run longer than 10 seconds … otherwise it will reset the Vera unit.
As Brientim has indicated … you can code this as a single block of lua code for a scene and setup a schedule for the scene that runs at a periodic interval. The smallest interval is 1 minute.
I have put together some code to send sms direct from Vera (via a usb /serial cable and old mobile). I am looking at how to run a heart beat check on the Internet to check if it is up. If not, and an event occurs which I want to be informed off, I will send an sms from the mobile rather than using email or sms gateway.
Hi @twostep - what you’re doing sounds vey interesting, are you able to share more? Maybe consider starting up a specific thread that highlights your project "SMS From Vera (via old mobile phone) " - I’m always interested to hear how people have integrated non HA devices into Vera.
BTW - I’m still waiting for the plugin where Vera will call me up and speak to me
The phone I have only accepts sms messages in PDU format (a kind of 7 bit packing of the message text). The code to do this is no doubt unattractive from a Lua perspective as it is the first code I have written in Lua and my first attempt to write something in Vera. I am now waiting for a Wavecom gsm modem (a mobile with no keypad or screen but with a power supply so no battery) to test. Once I have tested with the modem I will post some documentation and the code.
I have not found any FREE gateways … that’s probably why MCV has a limit.
It costs them to send SMS messages.
Some Phone providers provide a gateway to phones connected to their service.
But that’s not universal … and many have a CAPTCHA challenge to make it impossible to use as a web service.
I have now received the Wavecom gsm modem and it works fine. I am in the UK so the MCV alert options are not so attractive. I have also tested with an sms gateway service using the company aql (www.aql.com). It has a pay as you go option so I bought 50 sms for £7.50 (calls to UK mobiles) and had it working from Vera within a couple of hours.
I have ordered another Wavecom for a friend that has a Vera. When I install it I will document the process and inventory all the files involved (the process will remind me what I have used as this is all very new) and post them as an attachment. I guess that is the way to do it?