As a template for inserting states (tags), it is recommended to use
the output of mc_info_states()
, which will return the table with all necessary
columns correctly named. The sensor_name
and value
columns are optional and do not
need to be filled in.
When locality_id
is provided but sensor_name
is NA in the states (tags) table,
states are inserted for all sensors within the locality.
The states (tags) are associated with the sensor time-series, specifically to
the defined part of the time-series identified by start and end date times. A
single time series can contain multiple states (tags) of identical or different types, and these
states (tags) can overlap. Start and end date times are adjusted to fit within
the range of logger/locality datetime and are rounded according to the logger's step. For instance,
if a user attempts to insert a tag beyond the sensor time-series range, mc_states_insert
will adjust the start and end times to fit the available measurements. If a user defines a start time as
'2020-01-01 10:23:00' on a logger with a 15-minute step, it will be rounded to '2020-01-01 10:30:00'.