Basic Home Automation via xAP BSC enabled devices (updated 9-01-2008) (3 Viewers)

Kaoh

Portal Pro
September 11, 2006
244
28
Home Country
Netherlands Netherlands
I understand. I hope you do, it would be a excellent feature.
 

Kaoh

Portal Pro
September 11, 2006
244
28
Home Country
Netherlands Netherlands
I decided to work on an implementation myself.
I created a process plugin that just listens and then uses your BHA core to fire commands. So your stuff does not get more dependencies on MP, its now a seperate module.
I have a fully working beta at this moment, will finish it up and give it the release touch and attach it here.

It waits for a special command (specify yourself) then you enter a two digit device numer and an action numer and the plugin then tells BHA to apply the action to the device. It works no matter where you are in MP.
 

Kaoh

Portal Pro
September 11, 2006
244
28
Home Country
Netherlands Netherlands
Here is a first version.
Features:
- Tells devices a xAP command without interface requirements
- Directly tell you light to turn on without using the computer, no matter what MP is doing
- Fully configrable
- It uses the Devices list from the BHA plugin to match the IR commands.

How does it work:
The plugin listens all the time to commands issued by MP, when the trigger command is noticed it starts to listen to the following commands, if within the given time a series of 3 numbers (REMOTE_#) codes is recieved, it handles those as device and command numbers.
For example: pressing ACTION_MOVE_UP followed by REMOTE_0, REMOTE_2, REMOTE_3 it will find the given alias for device 2 and search the device within BHA matching the alias and issue command 3 (Dim+10).

Rather simpel plugin, but it enables my IR remote to control the devices without using the screen and interface. (Yes I have a Pronto, so I have very need buttons per device ;)).

Installation, place it in the plugin\process folder
Luanch MP once, and then close.
Now alter the IR2xAPExtender section to your liking.

Fill the DeviceAliases section like this:
0#BHADeviceAliasA;1#BHADEviceAliasB;2#BHADeviceAliasC;3#;4#BHADeviceAliasD etc

The numbers in this list are the command numers so the REMOTE_0 and REMOTE_2 part combine to 02 which returns device alias BHADeviceAliasC.
All numbers MSUT be present, so you can add up to 99 but the all empty onces must be filled also, see in the example item 3, no device is setup. but since you want one to listen to 4 you need it anyway.

Next version WILL have a setup screen to manage this ;)

Values mean:
SequenceStepTime how many second the plugin will wait for following number commands before resetting waiting for a new sequence trigger.
LevelStep The percenta increase or decrease when command 3 (increase) and 4 (decrease) are given
SequenceTriggerCommand What MP command should trigger the listener. See you IR setup for commands you can use.

The device sequence from you remote should consist from two numbers, so 00, 01, 02 etc
The third numbers tells the device what to do; possibilities are:
0: On
1: Off
2: Toggle
3: Level increase
4: Level decrease

So one final thought: Your remote should always! send 4 codes to get this working per device Trigger, device#part1, device#part2, action
If you set these up as a macro in your remote it feels a bit like long wait, but for example the marmitex remotes work the same (home button, device number, action) but then you manually press them, so your not waiting, feels faster somehow ;)
 

Kaoh

Portal Pro
September 11, 2006
244
28
Home Country
Netherlands Netherlands
And YES you do need BHA plugin fully working and setup before you can use this one ;)

One more thing, I only use g version, the i version doesnt work for me.
Can someone test and report of it works with that version also?
Same goes for MP, I wait to migrate when its final, so still one some 2.2 build.
 

Kaoh

Portal Pro
September 11, 2006
244
28
Home Country
Netherlands Netherlands
Your code is very nice, compared to other plugins I worked on or with, its very clean ;)
Did not cost reall trouble to find the stuff, even though your plugin is not like MP a framework to code against, so no complaints from me (and lead a team of 8 developers for a living so...)
 

migube

Portal Pro
November 9, 2007
51
1
Hi guys,

new to mediaportal, I was thinking the X10 integration would be great for my Home automation.

Now I see that Xap is needed, but my X10 is not connected to a XAP Hub on a windows machine, but the CM11 is connected on a WRT54G with openwrt & unslung Heyu software ...
I don't know if there are ways to control heyu remotely other then Rsh or Cgi on webpages, so I guess I'll try to install either perl or php iin order to be able to launch the Heyu commands via the WEB.
If I have an URL with the House codes & some commands, will it be possible to integrate this into your plugin, to have every "button" , just going to a URL ?

If not I'l lhave to install web plugins, make a web page... I 'd loose all the nice mediaportal feeling ;(

Thanks !
 

patrick

Portal Pro
April 20, 2005
608
45
Southeast
Home Country
United States of America United States of America
If I have an URL with the House codes & some commands, will it be possible to integrate this into your plugin, to have every "button" , just going to a URL ?

Do you have any documentation on the URLs?
Is it possible to get the device status via a URL (i.e. is the light On/Off current Dim %)?

If it is like this then maybe.

patrick

Your code is very nice, compared to other plugins I worked on or with, its very clean ;)
Did not cost reall trouble to find the stuff, even though your plugin is not like MP a framework to code against, so no complaints from me (and lead a team of 8 developers for a living so...)

Thank you! :)

patrick
 

migube

Portal Pro
November 9, 2007
51
1
HI Patrick,

thx for the answers.

still thinking how I'll do it :).
As I'll also have One-Wire temperature on the wrt54G with owfs, I must find a way to do things like http://ip?get=T1 which would then be parsed on the webserver, get the temperature of T1 and Answers in text. (like 25 °C or just 25).

On the X10 part, my devices do not support reading their status :(
Unless they have been modified by X10 commands on the net, the CM11 won't know (like AD10 being pushed by buttons).
Heyu accomodates different commands (cfr below)
Example:
# heyu dimlevel m1
100
# heyu onstate F2
1
# heyu onstate F3
0

etc...


heyu commands
[Administrative commands (H = Housecode)]
heyu info Display CM11A registers, clock, and upload status
heyu date Return date in date(1) input format
heyu erase Zero CM11A EEPROM, erasing all events and macros
heyu help [command] This screen, or specific command help
heyu syn Display built-in synonyms for direct commands
heyu <label> Execute a scene or usersyn defined in the config file
heyu show <option> (Enter 'heyu show' to see options)
heyu monitor Monitor X10 activity (end with <BREAK>)
heyu engine Start or restart the Heyu state engine
heyu initstate [H] Zero entire state table or just housecode H
heyu initothers Zero cumulative address table
heyu reset [H] Reset interface to housecode H or default
heyu setclock Set CM11A clock to system clock (per schedule)
heyu readclock Display CM11A and system clocks (per schedule)
heyu newbattery Reset CM11A battery timer to zero
heyu purge Cancel pending delayed macros
heyu clear Clear CM11A registers
heyu list Display Lock and Spool directory names
heyu stop Stop the current relay and state engine daemons
heyu upload [check|croncheck] Upload schedule to CM11A or check schedule file
heyu upload status|cronstatus Display status of uploaded schedule
heyu catchup Emulate uploaded Timers from 0:00 to current time today
heyu trigger Hu on|off Emulate Trigger in uploaded schedule
heyu macro <label> Emulate Macro in uploaded schedule
heyu utility <option> (Enter 'heyu utility' to see options)
heyu logmsg <"text"> Display text message in log file and/or monitor
heyu wait [timeout] Wait until macro execution is completed
heyu cm10a_init Initialize CM10A interface. (For CM10A only!)
heyu version Display the Heyu version and exit

[State commands (H = Housecode, u = Single unit) - require heyu engine]
heyu enginestate Display 1 if state engine is running, else 0
heyu flagstate n Boolian state of flag n
heyu statusstate H Status-pending bitmap of H or boolian Hu
heyu onstate H On-state bitmap of H or boolian Hu
heyu dimstate H Dim-state bitmap of H or boolian Hu
heyu chgstate H Changed-state bitmap of H or boolian Hu
heyu addrstate H Addressed-state bitmap of H or boolian Hu
heyu statestr H State mini-bitmaps of all units as ASCII string
heyu dimlevel Hu Brighness level of module Hu as 0-100%
heyu rawlevel Hu Native level (0-210, 1-32, or 0-63) of module Hu
heyu memlevel Hu Stored level 0-100% for module Hu with memory
heyu rawmemlevel Hu Stored native level for module Hu with memory
heyu heyu_state Hu Heyu script environment state bitmap (as integer)
heyu heyu_rawstate Hu Heyu script raw environment state bitmap (as integer)
heyu xtend_state Hu Xtend script environment state bitmap (as integer)
heyu fetchstate See man page heyu(1)

[Direct commands (H = Housecode, U = Units list)]
heyu on HU Turn units ON
heyu off HU Turn units OFF
heyu bright HU <level> Brighten units by <level> (1-22)
heyu brightb HU <level> Brighten units by <level> (1-22) after full bright
heyu dim HU <level> Dim units by <level> (1-22)
heyu dimb HU <level> Dim units by <level> (1-22) after full bright
heyu lightson H Turn All Lights ON
heyu lightsoff H Turn All Lights OFF (**)
heyu allon H Turn Units 1-16 ON
heyu alloff H Turn All Units OFF
heyu turn HU <command> Change state on|off|up|down [vv]
heyu _turn HU <command> Legacy turn command as above (*)
heyu preset HU <level> Preset units to <level> (1-32) (*)
heyu mpreset HU <linked> Limited Preset for macros - see manpage
heyu _preset HU <level> Legacy preset command as above (*)
heyu preset_level <level> Preset to <level> (1-32) (function only)
heyu status HU Request ON/OFF status (two-way modules)
heyu _status HU Legacy status command as above (*)
heyu status_on HU Status Acknowledge ON
heyu status_off HU Status Acknowledge OFF
heyu hail [H] Hail other devices
heyu hailw [H] Hail other devices, await ack (*)
heyu hail_ack [H] Hail Acknowledge
heyu data_xfer H Data Transfer (function code 0xC)
heyu xon HU Extended Turn Units Full ON (LM14A)
heyu xoff HU Extended Turn Units Full OFF (LM14A)
heyu xpreset HU <level> Extended Preset <level> (0-63) (LM14A)
heyu xallon H Extended All Units ON (LM14A)
heyu xalloff H Extended All Units OFF (LM14A)
heyu xstatus HU Extended Status Request (LM14A)
heyu xconfig HU <mode 0-3> Extended config auto status mode (LM14A)
heyu xpowerup HU Extended module power-up signal (LM14A)
heyu xfunc <T/F> HU <Data> Extended command - general
heyu xfuncw <T/F> HU <Data> Extended command - general, await ack (*)
heyu address HU [HU [...]] Send Housecode|Units addresses only (*)
heyu function <command ...> Send command function only
heyu kill_all_hc Send All_Units_Off to All Housecodes
heyu pause N.NNN Pause for N.NNN seconds (*)
heyu rcs_req <query_command> Request RCS compatible status (*)
heyu temp_req <query_command> Request temperature (RCS compatible) (*)
heyu setflag n[,n...] Set one or more flags (n = 1-16) (@) (*)
heyu clrflag n[,n...] Clear one or more flags (n = 1-16) (@) (*)
heyu clrstatus H Clear status-pending flags (@) (*)



heyu show options:
a[liases] Aliases defined in config file
s[cenes] Scenes defined in config file
u[sersyns] Usersyns defined in config file
m[odules] H Module attributes, housecode H
l[aunchers] [H] Launchers, all or only housecode H or -p
h[ousemap] [H] Overall system state, or details housecode H (*)
d[imlevels] Dim levels of modules as percent (*)
r[awlevels] Native levels of modules (*)
f[lags] Flag states (*)
o[thers] Cumulative received address map (*) - clear with
'heyu initothers' or 'heyu initstate'
(*) Require the heyu state engine to be running

thx
 

TritonT

Portal Pro
October 23, 2006
103
62
Home Country
United Kingdom United Kingdom
@ migube

Hi,

We've got similar devices but have gone about things a VERY different way! To use this plugin you need your devices to be producing and receiving xAP specifically xAP BSC. heyu for X10 and owfs for 1-wire are a bit of a dead end. But you could have a look at One-Wire xAP Connector for owfs and the domus.Link frontend for heyu (this might give you a way of coding the sending and receiving of xAP BSC messages).

If you go the xAP route you have a few options:


For X10 you have the following choices for connector:

CM12U Connector (Patrick Lidstone)

CM10/CM11 Connector (Edward Pearson)

xapmcsCM11A (Michael McSharry)

For 1-wire you have the following choice for connector (assuming you're using a DS9097 type adaptor):

xapmcsOneWire (Michael McSharry)


I ended up building a setup using a Epia motherboard, with CF flash harddrive, running a stripped down Windows XP. It has connectors for 1-wire and X10 amongst other things. The only control application I use is xAP Floorplan, which lets me script anything I need, my requirements are not that complex.
 

Users who are viewing this thread

Top Bottom