Page 1 of 1

Subscription Notification List

Posted: Mon May 24, 2010 4:41 pm
by Nightrader_
Where can I find the subscription notification list names for the X10 Devices?

or

Where can I find subscription notification names for all device.

Thanks,
Gene

Re: Subscription Notification List

Posted: Wed Jun 02, 2010 9:56 pm
by ScottBot
Good question. That information is not available anywhere, but it's not a secret. If you want to know what names are used by any particular hardware interface, let me know the interface and I'll make you a list.

Re: Subscription Notification List

Posted: Wed Jun 02, 2010 11:14 pm
by Nightrader_
Thank you,
I would like the info on the x10 devices, in fact if I you would be willing to make it public, I would love to see the source for the X10 devices, I have only recently discovered HouseBot and I am very interested in making a couple interface plugins (starting with the CM15A ) and at least a few devices but I am no good with C++ so the more code I can look at the better I can understand it with the hope of eventually porting the plugins over to Pascal (Delphi) where I feel comfortable.

Thank you sir,
Gene

Re: Subscription Notification List

Posted: Thu Jun 03, 2010 9:05 am
by ScottBot
I don't release the full plugin source code, but I'll provide snippets to help answer questions from time to time.

I'll just list the SubscribeToNotificationList() calls for each device. If you need more info, let me know.

X10 Controller
  • SubscribeToNotificationList( "X10 Reception (ALL)", "" );
  • SubscribeToNotificationList( "X10 Global Reception (ALL)", "" );
Receiver
  • wsprintf( szFilter, "H=%d;U=%d", hc, uc );
    SubscribeToNotificationList( "X10 Reception", szFilter );
  • wsprintf( szGlobalFilter, "H=%d", hc );
    SubscribeToNotificationList( "X10 Global Reception", szGlobalFilter );
Transmitter
  • wsprintf( szFilter, "H=%d;U=%d", hc, uc );
    SubscribeToNotificationList( "X10 Reception", szFilter );
  • wsprintf( szGlobalFilter, "H=%d", hc );
    SubscribeToNotificationList( "X10 Global Reception", szGlobalFilter );

Re: Subscription Notification List

Posted: Thu Jun 03, 2010 9:25 am
by Nightrader_
I understand, It was a shot in the dark :)

Thanks for the info.

BTW, HouseBot is awesome.

Thanks,
Gene

Re: Subscription Notification List

Posted: Sat Jun 12, 2010 5:25 pm
by Nightrader_
So this code should make my "X10 Appliance Module" device (in housebot) change it's "Power State" to "ON", correct?

Code: Select all

      CDataPack   DataPack;
      DataPack.AddData( "HouseCode", "C" );
      DataPack.AddData( "UnitCode", "2" );
      DataPack.AddData( "Command", "ON" );
      DataPack.AddData( "RepeatCount", "1" );

      NotifySubscribedDevices( "X10 Reception", "H=C;U=2", &DataPack );

      NotifySubscribedDevices( "X10 Global Reception", "H=C", &DataPack );
      
      return (TRUE);
I am not sure what I am doing wrong.

Thanks,
Gene

Re: Subscription Notification List

Posted: Sat Jun 19, 2010 10:24 am
by ScottBot
Pretty close.

Code: Select all

CDataPack   DataPack;
DataPack.AddData( "Command", "On" );  // On, not ON
DataPack.AddData( "HouseCode", "C" );
DataPack.AddData( "UnitCode", "2" );
DataPack.AddData( "RepeatCount", "1" );  // Not sure what this is for, unless you have your own device plugin looking at repeatcount

NotifySubscribedDevices( "X10 Reception", "H=3;U=2", &DataPack );  // Uses X10 numeric values for filter, not characters.  Odd... I know.
NotifySubscribedDevices( "X10 Reception (ALL)", "", &DataPack );
I don't think the X10 numeric values for HC and UC are references anywhere in the SDK, but I think they're standard X10 protocol values. Here's an enum that I use for them:

Code: Select all

enum X10HouseCode
{
	hcUnknown,
	hcA,
	hcB,
	hcC,
	hcD,
	hcE,
	hcF,
	hcG,
	hcH,
	hcI,
	hcJ,
	hcK,
	hcL,
	hcM,
	hcN,
	hcO,
	hcP,
	hcLastHouseCode
};

enum X10UnitCode
{
	ucUnknown,
	uc1,
	uc2,
	uc3,
	uc4,
	uc5,
	uc6,
	uc7,
	uc8,
	uc9,
	uc10,
	uc11,
	uc12,
	uc13,
	uc14,
	uc15,
	uc16,
	ucAllUnitsOff,
	ucAllLightsOn,
	ucOn,
	ucOff,
	ucDim,
	ucBright,
	ucAllLightsOff,
	ucExtendedCode,
	ucHailRequest,
	ucHailAck,
	ucPresetDim0,
	ucExtendedData,
	ucStatusOn,
	ucStatusOff,
	ucStatusRequest,
	ucPresetDim1,
};

Re: Subscription Notification List

Posted: Thu Jun 24, 2010 9:30 am
by Nightrader_
Thank you sir

RepeatCount was a guess based on the parameters for the SendX10 command.

Gene