X10 Community Forum

🖥️ActiveHome Pro => ActiveHome Pro General => Topic started by: raym on April 14, 2005, 08:51:48 AM

Title: Reading TempLinc temperature codes?
Post by: raym on April 14, 2005, 08:51:48 AM
I have a temperature sensor that will
report  the temperature, for example 72
=  'B15'  + 'preset dim level 13%'.

My Cm15A ActiveHome Pro software
reports 'B15' + 'Extended House Code'. Not
the dim level. I tried setting it up as a
two way lamp module.

Anyone have any ideas on how to read
the 'raw' CM15A data associated with dim
levels and ActiveHome?

Anyone Using the SmartHome TempLinc with
ActiveHome Pro?

Help?

Thanks

Ken
Title: Re: Reading TempLinc temperature codes?
Post by: willgloy on April 14, 2005, 11:01:45 AM
The only way to do this is use it in
thermosate mode.  I've done this with mine
with a preset for P1 on at 80 and P1 off at
75 with a macro that controls my ceiling
fans.  Wish X10 would include the preset
dim levels for triggers - this would be
cool and work for many other applications.
Such as dim on light and the others dim in
the room as well.
Title: Re: Reading TempLinc temperature codes?
Post by: raym on April 14, 2005, 08:38:26 PM
Thanks,

That is sort of what I figured. It is good
but I will be wasting a lot of features of
the TempLinc module.

If the X10 software troops are listening,
this might be something to think about as a
new module or mode or something. SmartHome
has some things I like and X10 has most of
the things I like. I do realize that the
AHPro is relatively new. Please try to
integrate the custom module commands from
SmartHome into AHP.

I have the smart macro plug in. Just in case
X10 is interested in something like above. A
macro condition will need to be created to
read, and handle, dim levels.

Thanks to all,

Ken
Title: Re: Reading TempLinc temperature codes?
Post by: roger1818 on April 15, 2005, 10:53:38 AM
Hmm.  I thought I published this response
yesterday.  Fortunately I compose most of
my responses in Word so I was able to
recover it.

Ken:  If you use the SDK, you should be
able to read the temperature.
Unfortunately this will require the
computer be connected to the CM15A and
turned on.  Other than by using the SDK,
the CM15A does not support the
obsolete “preset dim” that SmartHome
modules (including the TempLinc) use at
this time.  It has been promised, but not
for several months.
Title: Re: Reading TempLinc temperature codes?
Post by: raym on April 15, 2005, 11:10:13 AM
Hi,

I guess I am a little reading impaired,
sorry about that.

I thought about the SDK but my last VB
version is VB5 and my last C++ is the old
Borland Builder 4. They work fine for me so
I do not feel like making Bill Gates any
richer by buying more of his VB stuff.

I may play with the C++ Builder to see if I
can get something to work there.

Thanks for the info,

Ken
Title: Re: Reading TempLinc temperature codes?
Post by: jonk on November 22, 2005, 08:30:12 AM
How would you use the sdk to read the
templinc? I see that the sdk supports the
sendplc presetdim1 and presetdim2 commands
but am not sure of the syntax to retrieve the
current preset dim level of a device. Thanks
in advance.
Title: Re: Reading TempLinc temperature codes?
Post by: roger1818 on November 22, 2005, 10:11:30 AM
Jon:  You would have to setup the RecvAction
notification and then send a statusrequest
command.  If I remember correctly the
TempLinc will then send a presetdim command
to indicate the current temperature, which
RecvAction will tell you about.
Title: Re: Reading TempLinc temperature codes?
Post by: jonk on November 22, 2005, 12:35:13 PM
I have discovered that the "queryplc" command
for the recvaction is not working. Do you
know the syntax for the statusrequest
function. Is it "sendplc a1(or whatever
house/unitcode the templinc is on)
statusrequest".......Thanks again!
Title: Re: Reading TempLinc temperature codes?
Post by: roger1818 on November 22, 2005, 01:35:39 PM
You are correct and the queryplc command does
not currently work.  It wouldn't have helped
you much anyway as even when it did work, it
didn't send a status request command but
instead used the status that it last heard.

I haven't tried it (I don't have any 2-way
modules) but "sendplc a1 statusrequest"
should work.  For it to do anything useful
though you must first setup the RecvAction
notification so that you can read the response.
Title: Re: Reading TempLinc temperature codes?
Post by: jonk on November 22, 2005, 04:37:12 PM
I am currently using this sub in a vb.net app:

Public Sub ActiveHome_RecvAction(ByVal
bszRecv As Object _
, ByVal vParm1
As Object _
, ByVal vParm2
As Object _
, ByVal vParm3
As Object _
, ByVal vParm4
As Object _
, ByVal vParm5
As Object _
, ByVal
vReserved As Object) Handles
ActiveHomeObj.RecvAction

If Not vParm1 Is Nothing Then
str = "Status: " & vParm1 & " " &
vParm2
Else
str = "Status Unknown"
End If
End Sub

Do you know by chance which "vparm" object
would contain the dim %?
Title: Re: Reading TempLinc temperature codes?
Post by: roger1818 on November 24, 2005, 10:12:38 AM
The old presetdim works in a funny way in
that the house code is used to determine the
dim %.  Here is a table indicating the dim
levels used by SmartHome switches (X10 never
used the old presetdim so the levels were
never standardized).  You will notice that
the presetdim1 command indicates a level less
than 50% and the presetdim2 command indicates
a level greater than 50%
 
House
Code  PresetDim1  PresetDim2
----- ----------  ----------
M        0%         52%
N        3%         55%
O        6%         58%
P       10%         61%
C       13%         65%
D       16%         68%
A       19%         71%
B       23%         74%
E       26%         77%
F       29%         81%
G       32%         84%
H       35%         87%
K       39%         90%
L       42%         94%
I       45%         97%
J       48%        100%
Title: Re: Reading TempLinc temperature codes?
Post by: jonk on November 24, 2005, 01:32:07 PM
Thanks Roger. That is very valuable
information. It is weird how the house code
is not in any logical order here?? Might I
inquire as to where you obtained this info? I
went ahead and ordered the Templinc so, I
should have it in a couple of days. I am
anxious to give it a go in vb.net. Thanks
again....
Title: Re: Reading TempLinc temperature codes?
Post by: roger1818 on November 24, 2005, 04:01:40 PM
It is part of a table I built from bits and
pieces of information from here and there.
You can find most of the explanation on it at
http://www.act-solutions.com/kingery18.htm
Title: Re: Reading TempLinc temperature codes?
Post by: Charles Sullivan on November 25, 2005, 12:16:02 PM
The old Preset Dim commands are a weird
kluge.  The byte sent over the over the power
line by all other X10 commands combines a
housecode with the particular function, with
the housecode occupying the upper 4 bits and
the function the lower 4 bits.  The Preset
Dim commands replace the 4 housecode bits
with a dim level (0-15) with the bits in
reverse order.

All in all, this kluge makes a terrible mess
of what otherwise is a relatively carefully
designed protocol.  (My suspicion is that X10
never intended the Preset Dim commands to be
implemented that way but it was forced on
them by some third party design, but I could
be wrong.)
Title: Re: Reading TempLinc temperature codes?
Post by: roger1818 on November 25, 2005, 01:39:47 PM
Charles:  The link I provided to Phil
Kingery's "Which One Should I Use" tutorial
provides a pretty good history of the
presetdim command and why it seems so weird.
It has to do with the way X10 converted from
little-endian to big-endian notation.  You
also have to realize that although X10
specified the presetdim command in their
protocol, they never actually implemented it
in any of their modules.  Newer publications
of the X10 protocol (in about 1993) actually
say that the presetdim command is now
obsolete (it has been replaced by an extended
command) but some third party manufacturers
(such as SmartHome) have decided to use it
anyway.
Title: Re: Reading TempLinc temperature codes?
Post by: Charles Sullivan on November 25, 2005, 04:16:38 PM
Roger:
I have no problem with the reversed-bits in
the preset dim level any more than I have
with the hodge-podge encoding of the
housecode and unit codes, and that's a non-
problem.  What causes the mess is the
substitution of the dim level in the location
where a non-preset-enabled module expects to
see the housecode, so the normal module
addressing/unaddressing rules can get screwed
up if preset commands become intermixed with
other X10 addresses and functions on the
power line.

Due to the way X10 is normally used, most
people won't experience a problem, but it's
there.
Title: Re: Reading TempLinc temperature codes?
Post by: roger1818 on November 27, 2005, 01:09:38 AM
Charles:  That is why X10 never used the
presetdim command and replaced it with
the "extended dim" command.  Initially they
were trying to keep a consistant 9 bit
message length and considering that 4 bits
were used for the house code, 4 bits were
used for the function and 1 bit was used to
identify that it was a function and not an
address, something had to give to specify
the brigthness.
Title: Re: Reading TempLinc temperature codes?
Post by: Charles Sullivan on November 27, 2005, 08:28:01 AM
Roger:
I understand that. But they left a gap that
third parties like ACT and Smarthome rushed
to fill, and now there's no going back.
Title: Re: Reading TempLinc temperature codes?
Post by: roger1818 on November 27, 2005, 11:29:59 PM
ACT has been using extended dim for about a
decade now.  They may have previously used
the preset dim command though (I am not
sure).

SmartHome apperently developed their
modules about 5 years after the preset dim
was labled obsolete by X10.
Title: Re: Reading TempLinc temperature codes?
Post by: jonk on November 29, 2005, 02:36:36 PM
Got the templinc yesterday and have it
reporting temps per the sdk thanks to the
invaluable information provided in this
forum. The statusrequest actually fires two
recvactions. The first recvaction in vparm1
gives the house/unit code per the owners
manual (unit 11-16) and vparm2 gives the
request type. (StatusRequest in this case.)
The second recvaction returns the dim level
as house/unit code in vparm1.(the unit code
is not relevant to anything here as far as I
can tell.) vparm2 gives the presetdim1 or
presetdim2 result. After a little string
parsing and thread sleeping....voila! Thanks
again for all of the helpful info. I learned
a lot from this thread.
Title: Re: Reading TempLinc temperature codes?
Post by: roger1818 on November 29, 2005, 03:21:16 PM
Jon:  Thanks for the update.  I am glad you
got things working.
Title: Re: Reading TempLinc temperature codes?
Post by: jonk on December 01, 2005, 04:19:37 PM
May have spoke too soon. The templinc is very
intermittently reporting both recvactions. I
am receiving the first part as I mentioned
below about 95% of the time and am only
getting the second (presetdim portion) about
1% of the time. I do notice that the status
report in activehome itself shows

d1 statusrequest
d15
statusrequest
extended data transfer

...almost always when i send the status
request. It's almost as if the sdk is not
able to receive the extended data transfer
portion. I've gone the usual x10
troubleshooting route of unplugging
everything I can think of and nothing is
helping. I went ahead and ordered two
filterlincs anyway though. Any other thoughts
would be greatly appreciated.
Title: Re: Reading TempLinc temperature codes?
Post by: roger1818 on December 05, 2005, 01:56:22 PM
Jon:  I have been thinking about this, and I
am not sure what the cause of your problem
is.  Let us know if you resolve it.
Title: Re: Reading TempLinc temperature codes?
Post by: jonk on December 06, 2005, 04:52:47 PM
Just a quick note to say that i am still
working on this. Got the filterlinc's and
installed them to no avail. There is
something different about the way the sdk
handles the presetdim responses than the way
activehome handles them. Activehome always
responds with the "extended data transfer"
while the sdk recvaction doesn't seem to
respond to the actual extended data transfer
with any degree of reliability.
Title: Re: Reading TempLinc temperature codes?
Post by: roger1818 on December 06, 2005, 05:30:29 PM
Sounds like both AHP and the SDK are buggy
when it comes to receiving “Pre-set Dim”
commands.  In the original standard
(http://www.x10.com/support/technology1.htm)
the following commands were specified (among
others):

Extended Code           0111
Pre-set Dim             101x
Extended Data Transfer  1100

(x represents the Most Significant Bit of the
level)

As you can see, “Extended Data Transfer” is
unrelated to “Pre-set Dim” so neither AHP or
the SDK should report a “Pre-set Dim” command
as “Extended Data Transfer.”

FYI, in the early 90s, X10 revised the
standard
(ftp://ftp.x10.com/pub/manuals/xtc798.doc)
and the following commands were specified
instead which could explain why they aren’t
supporting “Pre-set Dim” properly:

EXTENDED CODE 1    0111 FOR DATA/CONTROL
EXTENDED CODE 3    1010 FOR SECURITY MESSAGES
UNUSED             1011
EXTENDED CODE 2    1100 FOR METER READ & DSM
Title: Re: Reading TempLinc temperature codes?
Post by: jonk on December 06, 2005, 06:35:39 PM
My concern is that at least AHP is consistent
in receiving the extended data transfer
message   from the templinc and that the sdk
is so sporadic. The sdk seems to almost
always receive the first portion (j15 status
request)  of the message and rarely the
preset dim portion.
When the sdk does work, it is also
consistent for about an hour or so. Then it
just quits. It may take hours before it
starts working again. This leads me to
believe that the message is somehow
encapsulated in the extended data transfer
but that message is somehow garbled enough
that the sdk can't interpret it. Thats why i
got the filterlinc's to try and eliminate as
much powerline noise as possible.
Title: Re: Reading TempLinc temperature codes?
Post by: jonk on December 06, 2005, 06:44:41 PM
BTW Here's a screenshot of the web app i have
been working
on...http://12.160.70.148/JONK/ACTHM.BMP
Title: Re: Reading TempLinc temperature codes?
Post by: jonk on December 07, 2005, 08:45:30 AM
I noticed this in my event log:

12/7/2005 8:31:23 AM :recvplc b5 PresetDim1
12/7/2005 8:31:23 AM :recvplc j15 StatusRequest

Notice the times! It seems that the response
may only differ by milliseconds. It may be
that the sdk doesn't quite keep up with the
recvaction and therefore doesn't update the
eventlog in time for anything to read it.
Title: Re: Reading TempLinc temperature codes?
Post by: roger1818 on December 07, 2005, 09:33:51 AM
Jon:  That is very strange.  X10
communication is very slow and only one
address/function can be transmitted at a
time.  It takes 0.83 seconds for an address
and a command to be transmitted so it is
unlikely that you would receive two unrelated
commands on the same second.  One other
thing, J StatusRequest is the most probable
command to be “received” inadvertently.

I think I might know what the problem may be.
Most commands use the house code in the
function part of the command to ensure that
the function is valid.  Since PresetDim uses
the house code to set the dim level, AHP and
the SDK may be ignoring PresetDim commands
with a house code that has never been
addressed.  Try sending A16, B16, C16, D16 …
P16 (assuming none of those addresses are
used) at the beginning of your program to
make sure that every house code has been
addressed.  I hope this helps.
Title: Re: Reading TempLinc temperature codes?
Post by: jonk on December 07, 2005, 07:51:29 PM
Roger: That definitely improved the receiving
of the preset dim commands. It rarely misses.
However, (there' s always a "however") now
the first portion is rarely received. i.e.
the "j15 statusrequest" part. I am getting
j16 status request most of the time which
seems to somehow be tied to addressing the
J16 that i send per your suggestion. I tried
sending j1-j16 along with the rest but that
always returns "j1 statusrequest-j16
statusrequest". I also tried omitting the j
housecode all together. Thanks for all of
your help on this. Once again you have taught
me a great deal about x10. I have a long way
to go..........
Title: Re: Reading TempLinc temperature codes?
Post by: roger1818 on December 08, 2005, 10:03:21 AM
Jon:  Your welcome.  I am glad things are
working better.

The thing that puzzles me is why you are
getting a J StatusRequest in the first place.
I am assuming that you aren’t using house
code J.  You are correct in that it changed
to J16 StatusRequest because of you
addressing J16.  X10 commands are divided
into two separate messages an address and a
function.  One of the features of X10 is that
a module that has been addressed will
continue respond to functions (on its house
code) until another address has been received
(on its house code).  Likely what is
happening is something (maybe the CM15A?) is
generating an un-addressed J StatusRequest
after receiving a PresetDim command.

As I said earlier, J StatusRequest is the
most probable command to be “received”
inadvertently.  This is because the raw data
for the command is:

1110101010101010101010

As you can see, with the exception of the
second digit, it is a pattern of alternating
1s and 0s (in X10, each data bit is always
followed by its compliment as a form of error
checking).

Regardless, I would not rely on the reception
of this StatusRequest command, as it may be a
bug that will be fixed in the future.
Title: Re: Reading TempLinc temperature codes?
Post by: jonk on December 08, 2005, 01:29:58 PM
Roger:
"The thing that puzzles me is why you are
getting a J StatusRequest in the first
place." Unless I'm calculating the temp
incorrectly, I need to receive the "J
StatusRequest" portion in order to derive the
temp from the Templinc's chart. The unit code
which arrives with the "J StatusRequest"
message gives me the column (Unit Code) I
need to compare with the dimlevel.In this
case j11-j16....thanks
Title: Re: Reading TempLinc temperature codes?
Post by: roger1818 on December 08, 2005, 02:06:46 PM
Jon: No, it should be the House Code on the
PresetDim command, not the StatusRequest that
you use to calculate the temperature.
Title: Re: Reading TempLinc temperature codes?
Post by: scott on December 09, 2005, 12:06:41 AM
Jon - I'm in a spot similar to where you
started, just bought the X-10 starter kit
with AHP, and a TempLinc, niavely thinking
X-10 was as standard which would allow them
to communicate.

Is what you're working on
portable/explainable, or would I need to
brush up on coding and write my own app just
to connect the two?
Title: Re: Reading TempLinc temperature codes?
Post by: jonk on December 09, 2005, 06:02:31 AM
12/7/2005 8:31:23 AM :recvplc j15 StatusRequest
12/7/2005 8:31:23 AM :recvplc b5 PresetDim1


These two messages are examples of what is
returned each time i submit "j1
statusrequest" to AHP using the sdk. The
first message gives me something i need in
order to use Templinc's chart.....the
house/unit code for the column.......and the
second message gives me the dimlevel
information for the row to use in Templinc's
chart. I derive the dimlevel portion from the
above presetdim message per the chart you
supplied for me earlier in the thread. i.e.
If i don't receive the "j15 StatusRequest"(or
at least just the "j15" part) portion I have
no way of finding the proper column in
Templinc's chart.
Title: Re: Reading TempLinc temperature codes?
Post by: jonk on December 09, 2005, 06:25:12 AM
Scott:
If you are using AHP with the TempLinc, as
far as i know, you will have to brush up on
your coding skills. The TempLinc and AHP
together don't reliably report the necessary
information as of yet for me to offer an app
that would be of much help to you. With
Rogers help, I have been able to get
temperature readings about 50% of the time. I
suppose you could modify the samples in the
sdk with minimal effort and manually look up
the temperature based on the info returned in
AHP's activity monitor. But, a thermometer
would be easier.....
Title: Re: Reading TempLinc temperature codes?
Post by: roger1818 on December 09, 2005, 10:53:03 AM
Jon:  It had been a while since I last looked
at the TempLincs documentation so I had
another look at it.  I am assuming you are
trying to perform a “Report on Request” and
not a “Report on Change.”  If you are trying
to do a “Report on Change” it is doable, but
it might be a bit more of a challenge.  I am
assuming from one of your posts that you have
your TempLinc on address J1.

I now know why you are receiving this extra
status request.  It is not the address being
sent by the preset dim, but the result of two
addresses being grouped with one
StatusRequest command.

The problem is similar to the problem you had
with not receiving the PresetDim command
except from the opposite end.  You have to
realize that X10 sends separate address and
function commands.  When you send the
following command:

J1
J StatusRequest

The tempLinc will respond with the following
command:

Jx
y PresetDim

(where x and y are used to determine the
temperature).

But the SDK will report only the following
command since the address transmitted is not
on the same house code as PresetDim (unless y
is J):

yz PresetDim

(where z is the last unit addressed on house
code y)

What I think you need to do is transmit an
unaddressed command (StatusOn might be a good
choice) on house code J to retrieve the unit
code that the TempLinc transmitted.  Even if
y is J, the unaddressed command should still
cause you to receive the correct unit code.

This is all caused by the SDK trying to be
too smart and combine address and command
messages into one message.  When an address
doesn’t have a command or a command doesn’t
have an address, the SDK doesn’t report anything.

I hope this helps.
Title: Re: Reading TempLinc temperature codes?
Post by: jonk on December 09, 2005, 11:28:42 AM
Roger:
So if i understand you correctly, I would send :

A16, B16, C16, D16 …  P16 followed by the
statuson command for housecode J and then
J1-J StatusRequest and i would then receive
the xy presetdim message where x is the dim
level and y is the unit code (11-16). I don't
know the syntax for the statuson command.
Would it be J StatusOn....?
Title: Re: Reading TempLinc temperature codes?
Post by: jonk on December 09, 2005, 11:40:30 AM
Roger
Ooops..... I reread your post and i guess i
should send
A16-P16
J1-J statusrequest
J statuson
and then i would receive the xy presetdim
where x is the dim level and y is irrelevant
to my needs. I would also receive a Jz
message as a response to the statuson command
where z is the unit code of interest. Thanks
again.
Title: Re: Reading TempLinc temperature codes?
Post by: roger1818 on December 09, 2005, 11:50:22 AM
Jon:  You are close, but that is not quite
correct.  You want to do the following:

A16, B16, C16, D16 …  P16 (this only needs to
be done once and you can skip J)
J1 StatusRequest
receive PresetDim house code
J StatusOn
receive StatusOn unit code

You can then look up the temperature using
the received PresetDim’s house code and the
received StatusOn’s unit code.

As for the syntax for StatusOn, “J statuson”
should be correct.
Title: Re: Reading TempLinc temperature codes?
Post by: roger1818 on December 09, 2005, 01:15:23 PM
Jon:  Just to make sure I am clear, you have
to send the StatusOn command after you
receive the PresetDim command.  This will
ensure that the command is sent after the
address the TempLinc sends.
Title: Re: Reading TempLinc temperature codes?
Post by: jonk on December 09, 2005, 02:07:45 PM
Roger:
O.K. I'll give that a shot this evening when
i get home from work. Thanks again....
Title: Re: Reading TempLinc temperature codes?
Post by: Human250 on November 01, 2008, 09:53:22 AM
Jon and Roger:  Did you ever get this to work reliably?  If so, how about posting the SDK program to the SDK site?  This could be a God send to other TempLinc hackers. >!
Title: Re: Reading TempLinc temperature codes?
Post by: comit6554 on November 14, 2008, 05:40:22 PM
>! I'll drink to that!  ;D
I too am a novice at vb and have the vb20008 express edition running and I am looking for temps in the well house(several yards away). I am able to monitor the on/offs and I then count the on time and compare
that to preset periods....with that knowledge I know if an element is burnt out or not on the heater. I set an alarm (light on, email, etc) at this point.
I am new to programming, but have messed with vb for a long time.. what I have now is working even though I am not too sure why.... ;D. I am wondering if someone could post some code for me to see/copy that would help me do the things I want. And I have the activehome pro too. I am using Templinc unit.
Title: Re: Reading TempLinc temperature codes?
Post by: roger1818 on January 29, 2009, 03:31:50 PM
Jon and Roger:  Did you ever get this to work reliably?  If so, how about posting the SDK program to the SDK site?  This could be a God send to other TempLinc hackers. >!

I don't have a TempLinc, and I never did hear the final results from Jon.  I can only assume he got it to work though.
Title: Re: Reading TempLinc temperature codes?
Post by: Dan Lawrence on January 29, 2009, 05:39:40 PM
The TempLinc is listed as discontinued on the Smarthome site.