diff --git a/src/sa/model/index.md b/src/sa/model/index.md index 405efe0..c7dc653 100644 --- a/src/sa/model/index.md +++ b/src/sa/model/index.md @@ -692,11 +692,11 @@ skinparam defaultFontName Courier @enduml ``` -Use case: a user alters manually the state of a device in the UI, and the device updates accordingly. +Use case: a user alters manually the state of device 'D' in the UI, and the device updates accordingly. Device 'D' is not part of any defined trigger. ```puml @startuml -title Process View: Sensor triggers trigger and scene application +title Process View: UI updates state of device participant "Smart device 'D'" as D participant "Smart sensor 'S'" as S @@ -708,7 +708,48 @@ participant "Trigger and Automation DB" as TDB participant "Scene Engine" as SC participant "Scene DB" as SCDB +UI -> DI: request state update +DI -> D: apply new state +D -> DI: report successful application +DI -> DIDB: store new state +DI -> UI: display new state +DI -> T: report latest device state +skinparam monochrome true +skinparam shadowing false +skinparam defaultFontName Courier +@enduml +``` + +Use case: a user through the UI defines a new automation, defining a matching new trigger and a new scene for it. + +```puml +@startuml +title Process View: UI defines new scene, trigger and automation + +participant "Smart device 'D'" as D +participant "Smart sensor 'S'" as S +participant "User Interface" as UI +participant "Device Engine" as DI +participant "User and Device DB" as DIDB +participant "Trigger and Automation Engine" as T +participant "Trigger and Automation DB" as TDB +participant "Scene Engine" as SC +participant "Scene DB" as SCDB + +UI -> DI: fetch device registrations +UI -> T: fetch defined automations +T -> TDB: query automations +UI -> T: fetch defined triggers +T -> TDB: query triggers +UI -> SC: fetch defined scenes +SC -> SCDB: query scenes +UI -> SC: store new scene +SC -> SCDB: store new scene +UI -> T: store new trigger +T -> TDB: insert new trigger +UI -> T: store new automation +T -> TDB: insert new automation skinparam monochrome true skinparam shadowing false