I built a hardware extender for Vera that solves a couple of problems i have with the thing. ( Realtime clock , watchdog , UPS , status display , IP address etc ) ( see my post on ‘SysMon’ in ‘general’ for more info
The hardware and firmware are running. now onto the Lua code.
i am looking for a few simple things. Instead of reinventing the wheel and spending day reading all the documentation i will ‘crowdsource’.
Qustion1 : Clock related
How can i read the current date and timefrom a LUA script and store this in a variable ?
How can i SET the current date and time from within a LUA script?
My hardware extender has a true battery backed RTC with perpetual calender. If Vera reboots and has no NNTP access i want to have a script that can read the RTC and set vera’s time/date. I will make a simple script : retrieve system timedate , retrieve RTC timedate. see who has the most recent timestamp → commit to either vera or NNTP. This script will fire once every 5 minutes or so. that way the RTC is kept up to date with NNTP ( if there is NNTP ) or vera will keep up to date with the RTC.
question2: Network related
How can i read Vera’s IP address. Sysmon has a status line. One of the things i want to do is show vera’s Ip address.
Any idea’s are welcome.