Cron guidance
Firstly, excellent work on the new scheduler Brett. Coupled with the google cal option this really does make this the perfect home heating controller(amongst a million other things!) As you know I found googlecal a bit twitchy and was always concerned about events not being carried out if my Internet drops out as it sometimes does. This fixes that but still allows scheduling on line if required. That said I am struggling to set up the cron correctly. Firstly I didn't have a /etc/cron folder so I created one. I then put the bsc file (as described in another script) in there and chmod a+x'd it. I altered my cron file to switch the rf.1 on but am not seeing any action. Xfx viewer also shows no xap from chron. Am I right in thinking that I should be able to test the bsc script by simply putting the following command into the command line? /etc/cron/bsc -t dbzoo.livebox.controller:rf.1 -s on If so this just returns file not found. I am on 296.4 firmware, any ideas Am I missing something obvious? Thanks As always Garry
Of course you can mod the script yourself just copy it out of /usr/bin to somewhere that has write access and get your crontab to run that script instead. This is the whole idea of have a script based scheduling engine. For example:
0 7 * * * /root/aliasmsg "rf 1 on"
I would not add a "-a" option to /usr/bin/bscmsg as what you want to send out is not actually a xAPBSC.cmd class so it's a bit of a bastardisation of this script. You can however create your own scripts to do what every you like.
I can add an aliasmsg script that emits an ALIAS class message as a helper this might be useful. It would work something like this.
aliasmsg "rf 1 on"
You would need quotes so that the contents is all processed as a single argument.
The entire aliasmsg script is reproduced here. I'll add this into my next beta drop.
#!/usr/bin/lua
lapp = require("pl.lapp")
local args = lapp
[[
Various flags and option types
<alias> (string) Alias command
]]
require("xap")
local cmd = string.format([[
xap-header
{
class=alias
}
command
{
text=%s
}]],args.alias)
xap.init("dbzoo.lua.aliasmsg","FF00DF00")
xap.sendShort(cmd)
Well I just pushed up 296.5 - as this is a beta things will change rapidily as you try to catch up and figure out what I'm up to. What I say in old beta may not always apply to new ones. It will be like this until I stabilize and release 297 :)
You will now need to enable cron via the ADMIN>Services TAB its not on automatically as of 296.5
Creating /etc/cron/bsc is not necessary as its now built in as /usr/bin/bscmsg. Did you create /etc/cron/bsc btw?
A sample crontab might look like. On at 7:00am and Off an 7:01am
0 7 * * * bscmsg -t dbzoo.livebox.controller:rf.1 -s on
1 7 * * * bscmsg -t dbzoo.livebox.controller:rf.1 -s off
ALSO as bscmsg is a built-in command you can run it from the command line to test that you have got the correct syntax before putting this same command line string into a crontab.
# bscmsg
bscmsg:missing required parameter: t
Various flags and option types
-t (string) xAPBSC Target
-s (onoff) xAPBSC State
-x xAPBSC Text
-l xAPBSC Level
#
Brett