Get Sensor Value Command 0x4A 2007-07-11T21:50:07+00:00

HOME Forums Input/Output EZIOxx Get Sensor Value Command 0x4A

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • Anonymous
    Post count: 20
    #39736 |

    Does the Get Sensor Value command 0x4A only pertain to the analog and 1 wire sensors?

    Anonymous
    Post count: 256

    Actually, only to the 1-wire (8-bit value returned)

    Anonymous
    Post count: 20

    So what command do I use to get the analog sensor values? I guess I could use the peek. Is that the only mechanism?

    Anonymous
    Post count: 256

    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.

    Anonymous
    Post count: 35

    I’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
    Post 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)?

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.