iphone HAH voice control - SIRI + IOS6??
Just been reading through the IOS6 features which launches on 19th Sept and noticed that SIRI will now send tweets via voice command.
Assuming this works OK then this feature easily opens the door to voice control on the HAH.
Simply speaking "tweet House lamps on" or "tweet house thermostat 19" should in theory produce an alias message that can be interpreted by a modified alias lua script.
I'm gonna make it my next project when IOS6 ships. I'll keep you posted!.
Garry
Definitely works. A minor problem is that when constructing the tweet it capitalises the first letter of the first word. This can be overcome by adding another function to the alias handler applet to deal with it.
Cool trick though!
wife would love this-iphone 5 and ipad 3, i get all her cast offs so only have ipad 1 and ipad 1 :(
It's definitely working; saying "tweet thermostat 18.7" to SIRI produces an alias message which resets my CH thermostat. "tweet boost on" sets the boost setting to on, I've even set up a "tweet coffee on" which switches on RF 3 which has the coffee machine attached!
One of the limitations of twitter is that you can't tweet the same message over and over again, so the thermostat is not a problem because you can just change it in .1 of a degree increments. coffee machines and boost functions are slightly different. I'm not sure what the interval parameters are for repeating the same tweet but it is certainly hours and possibly more than a day. So lights on and lights off could probably only be done once a day each. But I'm sure people can come up with novel names for the same thing in the alias handler.
I'm really new to twitter (just set it up to do this) but the tweet which was sent this morning is still there on my twitter page. Perhaps there's something I've missed in the set up. I'll have a look.
Sounds likely, I'll experiment in the next few days.
Allan
Totally new to twitter-set up for just HAH control for wife, so she can overide heating and turn lights on/off remotely.
have set House as command prefix authorized with twitter but no tweets are actioned?
if i tweet "House conservatory on" nothing happens but it should switch conservatory lights on?
all tweets stay in my twitter bit?
how do i debug?
Dean
And it is picking up twitter
xap-header
{
v=12
hop=1
uid=FF00D900
class=alias
source=dbzoo.livebox.Twitter
}
command
{
text=printers off
}
Butit does nowt here is an rf command send from Joggler:-
xap-header
{
v=12
hop=1
uid=FF00DBA0
class=xAPBSC.event
source=dbzoo.livebox.Controller:rf.1
}
output.state
{
state=on
displaytext=printers on
}
is there some sort of aliasing i am missing?
Dean
Dean
Your alias handler needs to convert the command to the appropriate message to target the device.
I assume that what you are saying is that using "printer off" as an alias message works OK?
If you type aliasmsg "printers on" at the command prompt does it work correctly?
Allan
This is my AliasApplet.lua (lokks gibberish to me :) )
--[[
Alias interpreter
Use to perform actions based on xAP alias class messages emitted by
both xap-twitter and xap-googlecal
--]]
module(...,package.seeall)
require("xap")
require("string")
rex = require("rex_posix")
info={
version="1.0", description="Alias Interpreter"
}
pat={
[rex.new("(relay|rf) ([1-9]) (on|off)")]=function(m) rfRelayCmd(m) end,
[rex.new("tweet (.*)")]=function(m) tweet(unpack(m)) end
}
function sendBscCmd(target,body)
xap.sendShort(string.format([[xap-header
{
target=%s
class=xAPBSC.cmd
}
output.state.1
{
id=*
%s
}]], target, body))
end
function tweet(msg)
sendBscCmd("dbzoo.livebox.Twitter","text="..msg)
end
function rfRelayCmd(t)
local addr1,addr2,state = unpack(t)
sendBscCmd(string.format("dbzoo.livebox.Controller:%s.%s",addr1,addr2),"state="..state)
end
function aliasEngine(frame)
local alias = frame:getValue("command","text")
for r,f in pairs(pat) do
if type(r) == "string" then
if r == alias then
f()
end
else
p={r:match(alias)}
if #p > 0 then
f(p)
end
end
end
end
function init()
local f = xap.Filter()
f:add("xap-header","class","alias")
f:add("command","text",xap.FILTER_ANY)
f:callback(aliasEngine)
end
OK your alias handler doesn't handle a command called conservatory or whatever.
You need a handler routine and an setup expression to make it work
[rex.new("conservatory (.*)")]=function(m) conservatory(unpack(m)) end,
in your setup and
function conservatory(msg)
sendBscCmd("dbzoo.livebox.Controller:rf.3","state="..msg)
end
in the body
Then when you issue a
aliasmsg "conservatory on" at the command line it should switch rf 3 on or off
Allan
That sorted it :)
now to train wife :)
Phew! Good luck mate. Afraid I can't help you with that!
sounds interesting, keep us posted :)