petter.wichman:
Is it possible to have the webthing wrap a “power switch device”
so that the isOn=true can:
The power switch device is just semantics for the API consumer,
so they know this is the property to toggle the power state. Other
functionality should either be done inside your webthing (and you
can do anything there) or may be a rule (like triggering a pulse
when turning on power that then executes the ecations to send those
serial commands).
petter.wichman:
If so, what kind of events?
Afaik it uses the WebSocket part of the WoT protocol. If you’re
using the webthing
crate that should be implemented for you. The relevant messages
are then sent to the gateway whenever you update a property, for
example.
After that the gateway has a rules system that would let you set
up a rule that does the action you describe (if prop 1 has state A,
set prop 2 to state I).