W3C home > Mailing lists > Public > public-wot-ig@w3.org > January 2016

Re: [T2TRG] 2. WoT Thing needs to have istate/ostate Bands

From: David Janes <davidjanes@davidjanes.com>
Date: Wed, 27 Jan 2016 15:25:57 -0500
Message-ID: <CACp1KyN=_fEQx-XZjBA-ykaiNGgMww30qOi4yrkBdmWtG8SW3g@mail.gmail.com>
To: Kerry Lynn <kerlyn@ieee.org>
Cc: "t2trg@irtf.org" <t2TRG@irtf.org>, public-wot-ig@w3.org

There could be a more general concept under istate/ostate, but in all my
experience with Things I haven't seen it. So it easily makes the 80/20 cut,
and probably even the 99.9/0.1 cut.

If there's need for really more detailed analytics on what's happening, I
suggest other approaches be taken altogether, e.g. Actions. But as written
about elsewhere, I don't believe this is necessary


I do use timestamps to coordinate what's happening with istate / ostate.
You can see this here



I don't believe necessarily "unreliable" is the right word. For example,
the light could be reported as on and the light could actually be on: the
command just hasn't executed yet, for whatever reason. Once again I will
note that this is not a theoretical concern: it happens all the time and
IoT UX people talk about dealing with it.

Let's say it's in a "transitional" state.


I don't think polling is necessary on modern devices. I do do it on some
legacy devices, but only at the 30s level.

Notifications that the state has changed can be sent via MQTT or CoAP. For
example, on my reference server you can do

$ mqtt subscribe --host --port 20001 --topic '#' --verbose
$ curl --location '
' -H 'Content-Type: application/json' -X PUT -d '{ "on": true }'

And watch the transitions happen (assuming the light is off).


MQTT is quite reliable. If you have a couple of computers running nearby,
play with the interface here. All the interfaces (dynamically made via
introspection!) will update as you transition state.


It's not quite as exciting as it could because the device simulators I
wrote were written before I really got a good sense how real world things
work, and the state transitions immediately.


Now that I've played with CoAP I'm quite excited by the possibilities of a
technology that will do this "all in one"


On Wed, Jan 27, 2016 at 11:56 AM, Kerry Lynn <kerlyn@ieee.org> wrote:

> David,
> I think you're hitting on something important with the notion of
> "interstitial state",
> but I wonder if it's a special case of a more general concept - the
> freshness
> (or fidelity?) of istate?
> I've seen systems that assign timestamps to istate and ostate.  If a
> command
> is issued through the API then ostate timestamp is modified.  Reading
> istate
> through the API returns ostate and istate timestamps.  If the relation
> istate_ts
> < ostate_ts is true then the returned istate is unreliable.
> There is also the problem of devices that can be manually as well as
> program-
> matically controlled.  To detect an out-of-band state change, the device
> either
> needs to push the new state to the authoritative data store, be observed by
> the data store, or be polled by the data store.
> Observation exists in some transports but not others and push requires
> additional configuration, therefore polling seems like the lowest common
> denominator.  Polling raises the question "how frequently should I poll?"
> These questions seem to touch on the philosophy of state transfer in REST.
> The "real" state resides in the device and any representation of that state
> that resides elsewhere would seem to be stale within some epsilon.
> Kerry
Received on Wednesday, 27 January 2016 20:26:46 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:26:54 UTC