-
AuthorPosts
-
Anonymous
InactiveJuly 11, 2007 at 9:50 pmPost count: 20Does the Get Sensor Value command 0x4A only pertain to the analog and 1 wire sensors?
Anonymous
InactiveJuly 12, 2007 at 10:08 pmPost count: 256Actually, only to the 1-wire (8-bit value returned)
Anonymous
InactiveAugust 31, 2007 at 7:48 pmPost count: 20So what command do I use to get the analog sensor values? I guess I could use the peek. Is that the only mechanism?
Anonymous
InactiveSeptember 1, 2007 at 5:13 amPost count: 256You must use peek/poke into locations starting at 0x4C (see command set document). Each analog input is 2 bytes. On the other hand, commad 0x4A returnd the value of a sensor in the 1-wire bus as 1 byte.
Anonymous
InactiveSeptember 1, 2007 at 8:11 pmPost count: 35I’ve had success sending 0x49,0x00 to the 2×4. The reply’s CMD2 is a bitmask with the states of the inputs. I haven’t worked with I3 and I4 yet, either analog or digital, so I don’t know if they’re included in the bitmask.
Here’s what my software does at startup to find out the current state of I1 and I2:
Send an Insteon DIRECT message, Cmd1 = 0x49, Cmd2 = 0x00.
Receive an Insteon DIRECT reply, Cmd1 = 0x49, Cmd2 = bitmask.
Examine the bitmask — bit 1 represents I1, bit 2 represents I2 (and, I assume, but haven’t tested, that bits 3 and 4 represent I3 and I4).Another undocumented oddity of the 2×4: broadcasts and DIRECT responses with all ones in the high nibble (i.e., 0xF0 through 0xF2) represent the states of the relays.
So, when I get a message, I check to see if Cmd2 is greater than 0x7f (just to be safe and generic), and if so, mask off the top and use the bottom nibble as a bitmask to obtain the states of the two relays. If none of the high nibble bits are set, I assume it’s a bitmask for the inputs.
So far, this has worked quite reliably. Later today, I plan to use a pull-up resistor and get I3 and I4 working (in digital mode) with dry contacts. If those also report their statsus correctly, I’m done.
Anonymous
InactiveSeptember 4, 2007 at 7:30 pmPost count: 20@simplehome wrote:
You must use peek/poke into locations starting at 0x4C (see command set document). Each analog input is 2 bytes. On the other hand, commad 0x4A returnd the value of a sensor in the 1-wire bus as 1 byte.
Which location contains which value (i.e. which one is the LSB)?
-
AuthorPosts
- You must be logged in to reply to this topic.