Command to turn on more that one device at once
Is there a command for turning on or off, 2 or 3 devices at once? Along the lines of my examples below, that do not work.
aliasmsg “rf.2 on”, “rf.3 on”
bscmsg -t dbzoo.livebox.controller:rf.2 -s on, rf.3 –s on
The wild card command below to turn off all rf devices does work
bscmsg -t dbzoo.livebox.controller:rf.* -s off
Many thanks
kema
You are in luck Slider control with Android has come up before and there is even sample code:
http://www.homeautomationhub.com/content/slider-widget
As you are not using a bsc LEVEL endpoint but a STREAM based one (ie text) you'd need to modify the code slightly. I've done this for you and its called http://livebox-hah.googlecode.com/svn/trunk/userapps/HAHCorona/sliderCon...
It will allow you to create a slider to set a temperature between a range of values you specify.
Brett
A Button is a boolean thing its designed to send ON/OFF.
I was thinking a workaround might be to make a BSC adapter that allowed the FLASH app to control its LEVEL endpoint and have that lock-step with some TEXT endpoint. FLASH sliders work with BSC level types for read/write and read-only for BSC text endpoint.
module(...,package.seeall)
require "xap"
require "xap.bsc"
info={version="1.0", description="level to text adapter"}
-- A table of mappings
-- dbzoo.livebox.Plugboard:<mockHeater> -> target
map={
{source="mockHeater", target="dbzoo.livebox.kema:Heating.Thermostat"},
}
function init()
for _,v in pairs(map) do
bsc.Endpoint{name=v.source,
direction=bsc.OUTPUT,
type=bsc.LEVEL,
cmdCB=function(e)
bsc.sendText(v.target, e.text)
end,
}
end
end
This code will create a MOCK level endpoint and relay events to another it works when I interact with it manually. The problem I had was making the damn flash application work with my level endpoint. The documentation that I wrote up is pretty thin around this area and I have no idea why the flash app won't talk to it. The slider moves up and down but no event is sent :(
Once I start getting out of things that I wrote I'm stuck too. An android app is more in our control.
Brett
It's a long time since I wrote that slider control in xAPFlash. It should however work for control of a remote xAPBSC level endpoint by sending xAPBSC.cmd messages targeted at the remote endpoint when it is moved (rather than events). If people are still wanting me to take a look I will do.
K
Or you could pick up a joggler pretty cheap these days and continue to run the flash app there. I love my joggler xAPFlash is the only reason for its existance these days.
Brett
Was just reading through some past posts and saw the original one asking about controlling two or more end points in one xAPBSC.cmd message. The xAP spec does support this using multiple bodies in one message but it may not be supported by all BSC devices and I haven't tried HAH specifically. It's used to create a single message for coincident output changes. It also means that either all, or none of the changes happen, in the highly unlikely event the xAP message was lost.
The way to do it is wildcard the target address parameter to something that will match all the end points, matching more won't matter. Then you add multiple output.state bodies to that message and in each one you change the ID= parameter so that it matches only the endpoint you wish to control. Within each body section you can include any BSC parameter like state=, level= etc. and it will only effect the one endpoint whose sub address matches the id. NB all your body headers should be unique names and so you should index them to output.state.1 output.state.2 etc. It's a bit of an untidy kludge as part of the target addressing now sits in the body rather than the header.
......
class=xapbsc.cmd
target=dbzoo.livebox.controller:rf.*
}
output.state.1
{
id=01
state=on
}
output.state.2
{
id=02
state=on
}
output.state.3
{
id=05
state=off
}
PS I haven't checked those id values are correct for HAH, or even that HAH supports this.
Kevin,
Both the C logic and the LUA both support this extended form of addressing as per the specification.
I've not used it for a while, but I know I coded for it. The only caveat is that it only handles up to 9 additional sections and I think the spec allows more.
Brett
A a single target or wild target works as you described.
bscmsg -t 'dbzoo.livebox.controller:rf.*' -s on
Make sure you put quotes around any usage of the * and > characters that form the target wildcard addressing so the shell does not glob this into a filename, or at least attempt to.
There is no support for multiple named targets. That should not be too hard to write thou, just copy /usr/bin/bscmsg and start coding...
Brett