HOME › Forums › Input/Output › EZIOxx › Get Sensor Value Command 0x4A › Reply To: Get Sensor Value Command 0x4A
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.