Command to turn on more that one device at once

12 replies [Last post]
kema01
Offline
MAIDSTONE, United Kingdom
Joined: 8 Jul 2013

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

brett
Offline
Providence, United States
Joined: 9 Jan 2010
A a single target or wild

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

kema01
Offline
MAIDSTONE, United Kingdom
Joined: 8 Jul 2013
bscmsg for Flash / Android.

Brett

Many thanks for getting back to me and your explanation. Hopefully when my software skills get better, I will feel brave enough to tamper with /usr/bin/bscmsg.

I have another problem which I would be very grateful if you or anyone else could help me with.

I am struggling to get the correct syntax for setting the temperature on my central heating using either Flash or Android. Currently I am using the following command via CRON, which works without any problems.

bscmsg -t dbzoo.livebox.kema:Heating.Hthermostat -s on -x 18.3         (ect, etc, etc)

If I could get the above to work via Flash/Android then my wife could change the temperature set point, from her phone.

Ultimately a scaled slider control would be the best option, I may be able to achieve this once I know the basic one line command for Flash or Android.

Many thanks again.

 

Kema…

brett
Offline
Providence, United States
Joined: 9 Jan 2010
You are in luck Slider

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

kema01
Offline
MAIDSTONE, United Kingdom
Joined: 8 Jul 2013
BrettMany thanks for the help

Brett

Many thanks for the help with the slider code, and for putting together the code specific to my requirements.

Before I jump to your slider control, I would like to understand a little better, what is required to have a single button on flash to send a revised temperature to my room stat applet.

I believe it should be along the lines of the following, but have no idea of how the syntax of the code should be in the last few lines. I cannot find any reference to sending text from flash on the forum.

                         <button NAME="Heating Temp">

                                     <label>

                                                 <text>Set 19.9</text>

                                     </label>

                                     <gridX>2</gridX>

                                     <gridY>2</gridY>

                                     <xAP>

                                                 <schema>xAPBSC</schema>

                                                 <uid>FF00D802</uid>

                                                 <source>dbzoo.livebox.kema:Heating.Thermostat</source>

                                     </xAP>

                                     <mode>Text</mode>

                        </button>

I do apologise if I am completely wrong with what I set out above, my software coding is at very low level and I tend to get results by adapting examples I have found, conceptual experimenting and trial and error.

Many thanks

 

kema

brett
Offline
Providence, United States
Joined: 9 Jan 2010
A Button is a boolean thing

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

kema01
Offline
MAIDSTONE, United Kingdom
Joined: 8 Jul 2013
Update

Brett

Apologise for the late reply.

Thanks for the new information.

 I will give the Android slider (2) code ago.

kema

kevin
Offline
Huddersfield, United Kingdom
Joined: 17 May 2010
Slider Control

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

kema01
Offline
MAIDSTONE, United Kingdom
Joined: 8 Jul 2013
Yes please.

Kevin

I think there has been a gradule migration over to Android and IOS app's, as there seems to be little support for Flash on these platforms.I was using Flash on my tablet using an earlier release of android, but cannot now use this as my new version of Android does not support Flash.

I still conrol my HAH from my faithful old Dell laptop, so would much aprechiate if you could produce some code to cover this functionallity.

Many thanks for your offer of help.

kema

brett
Offline
Providence, United States
Joined: 9 Jan 2010
Or you could pick up a

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

kema01
Offline
MAIDSTONE, United Kingdom
Joined: 8 Jul 2013
May get one

Brett

Have pondered about getting a joggler a number of times and still may get one (slightly put off by the 4amp psu). I arrived late on the HAH scene and would definitely have purchased one if I was involved at the beginning. Checked the price on eBay today and the price has risen since I last looked, one was at £60.

 

I have recently purchased a Chinese imported 7” tablet for £30 on eBay; I will probably root this and install an earlier version of Android so I can use Flash.

kevin
Offline
Huddersfield, United Kingdom
Joined: 17 May 2010
Addressing ad hoc combinations of xAP end points in one message

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.

brett
Offline
Providence, United States
Joined: 9 Jan 2010
Kevin,Both the C logic and

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

Hardware Info