def message_hash_2
      { activity_today:  binary_sensor_data[3..9].to_i(2),
        activity_yesterday: binary_sensor_data[10..16].to_i(2),
        activity_3_days_ago: binary_sensor_data[17..23].to_i(2)
      }
    end
def message_hash_2
      { activity_today:  binary_sensor_data[3..9].to_i(2),
        activity_yesterday: binary_sensor_data[10..16].to_i(2),
        activity_3_days_ago: binary_sensor_data[17..23].to_i(2)
      }
    end
Message Type 2 (activity counters)
 Binary sensor data, counting from 0 and from left (the most significant bit first):
 * [00..02] = message_type ("010" or 2)
 * [03..09] = activity_today (from 00:00 UTC)
 * [10..16] = activity_yesterday
 * [17..23] = activity_3_days_ago

 Bits 0-2 – The message type
 Bits 3-9 – The total activity for the immediate past day.
 Bits 10-16 – The total activity for the day 2 days ago.
 Bits 17 -23 – The total activity for the day 3 days ago.
 To reduce the overall activity count, the firmware turns on the sensor for 1/4 second every 2 1/2
 seconds (i.e. 10% duty cycle).
 Once per hour, firmware scales the total number of switch transitions to a useable range.
 The hourly activity counts are added together to yield a daily activity total.
 As there are 7 bits, 127 is the maximum value to transmit per day. (0-127).
 No activity = 0. Medium activity= ~50. Maximum activity = 127.
 The 24 hour activity periods are from 0000UTC to the next 0000UTC (the KS303 real-time clock is set
 to UTC).
 The activity measurements are gathered and recorded completely independent of whether or not the tag
 is actually transmitting over Argos. So transmitting (for example) every third day is not an issue.

 Please be aware that there is no error checking done on the transmission of this data, so you will get errors at times due to 'noise' in the Argos transmissions.
 For example you may get a decoded set of values for activity and then on a later transmission (the same day) you may see one of the numbers change, and then next transmission return to the previous values.
 As the activity values are only updated at 0000UTC daily it is therefore obvious that the data with the changed value was in fact erroneous data.