DTXr doc » History » Version 98
David Fredriksson, 12/09/2025 08:32 PM
| 1 | 20 | Torbjorn Carlqvist Admin | {{>toc}} |
|---|---|---|---|
| 2 | |||
| 3 | h1. DTXr documentation |
||
| 4 | 1 | Torbjorn Carlqvist Admin | |
| 5 | 5 | Torbjorn Carlqvist Admin | h3. Installation |
| 6 | 2 | Torbjorn Carlqvist Admin | |
| 7 | 6 | Torbjorn Carlqvist Admin | * System Requirements |
| 8 | 74 | David Fredriksson | DTXr can run on any machine that can run +Java 17+ and has sufficient with RAM and disk capacity. |
| 9 | 1 | Torbjorn Carlqvist Admin | |
| 10 | 21 | Torbjorn Carlqvist Admin | |Requirement|System RAM|System DISK|Example| |
| 11 | |Minimal|512Mbyte|512Mbyte|Raspberry 1, Raspberry Zero| |
||
| 12 | 31 | Torbjorn Carlqvist Admin | |Better|512Mbyte|512Mbyte|Rasberry Zero 2| |
| 13 | |Avarage|1GByte|1Gbyte|Raspberry 2-4| |
||
| 14 | 21 | Torbjorn Carlqvist Admin | |Top|2GByte|8Gbyte|Raspberry 4, Raspberry CM4, Server, PC| |
| 15 | |||
| 16 | 6 | Torbjorn Carlqvist Admin | * Network Requirements |
| 17 | DTXr can run stand alone without any active network connection. In that case the management pages is accessible via localhost interface. But for DTXr to be a fully functional BACnet/IP device it must be connected to an IP network that offers IP address via DHCP and where broadcast traffic is allowed. |
||
| 18 | 10 | Torbjorn Carlqvist Admin | |
| 19 | 1 | Torbjorn Carlqvist Admin | * Download DTXr software packages |
| 20 | 10 | Torbjorn Carlqvist Admin | Currently only customers to DAVITOR can download DTXr. Contact info@davitor.com for purchase information. |
| 21 | |||
| 22 | 15 | Torbjorn Carlqvist Admin | * Install on Linux |
| 23 | 60 | Torbjorn Carlqvist Admin | ** There is special install scripts, please follow these steps: |
| 24 | 22 | Torbjorn Carlqvist Admin | ### Download latest DTXr _base_ image and copy to a SD-card that has 16Gbyte capacity or more |
| 25 | 64 | David Fredriksson | |
| 26 | Or install a new image and install java |
||
| 27 | <pre>sudo apt install default-jdk </pre> |
||
| 28 | |||
| 29 | 22 | Torbjorn Carlqvist Admin | ### Insert the SD card, attach keyboard and screen via cable and start the device |
| 30 | 41 | David Fredriksson | ### When you get prompt login as **admin/davitor** |
| 31 | 72 | Torbjorn Carlqvist Admin | ### Download the installation script from davitor repository |
| 32 | *(note dtx.sh has an update since Jan 17th, 2024 see new parameter 'installfolder' below)* |
||
| 33 | *(note dtx.sh has an update since Nov 6th, 2025 see new parameter 'type' below)* |
||
| 34 | 59 | Torbjorn Carlqvist Admin | <pre>wget --user=**** --password=**** https://artifacts.davitor.com/repository/dtx-raw/scripts/dtx.sh</pre> |
| 35 | 56 | Torbjorn Carlqvist Admin | There is also a utillity script that can set the host name and MAC adress. Note, optional and only applicable on LION product appliances. |
| 36 | 59 | Torbjorn Carlqvist Admin | <pre>wget --user=**** --password=**** https://artifacts.davitor.com/repository/dtx-raw/scripts/system.sh</pre> |
| 37 | 56 | Torbjorn Carlqvist Admin | Make the scripts exec |
| 38 | <pre>sudo chmod 770 *.sh</pre> |
||
| 39 | 1 | Torbjorn Carlqvist Admin | ### Run installation as below where you first alter: |
| 40 | 72 | Torbjorn Carlqvist Admin | *** Required type (-t type) where type can be "scriptengine" for small platforms like RpiZ with 32-bit OS or "polyglot" for any 64-bits OS like servers or PC. |
| 41 | 1 | Torbjorn Carlqvist Admin | *** Required version (-v x.y.z) |
| 42 | 69 | Torbjorn Carlqvist Admin | *** The the install folder (-f myfolder) Note: Still relative to /usr/local so (-f myfolder) results in /usr/local/myfolder/dtx... |
| 43 | 57 | Torbjorn Carlqvist Admin | *** Partner user name (-u ****) |
| 44 | *** Partner password (-p ****) |
||
| 45 | *** Application password for the HTTP interface login on port 9090 (-app-password xxxxxxx) |
||
| 46 | 58 | Torbjorn Carlqvist Admin | *** BACnet Decvice Id (bac-device-id=nnnnn) |
| 47 | 57 | Torbjorn Carlqvist Admin | *** BACnet password which you will use to control the BACnet device DCC (bacnet-password=xxxxxx) |
| 48 | 67 | Torbjorn Carlqvist Admin | *** BACnet Device Name (bac-device-name=yyyy) |
| 49 | 1 | Torbjorn Carlqvist Admin | *** DAVITOR Reference Key (drk=xxxx) is used to mange and maintain this device from the DAVITOR PLM (Product Lifecycle Management) service. (drk=xxxx) The sequence of drk:s is in PLM instance database. |
| 50 | *** Hardware Platform Type (platform=xx) is used to control and switch on/off special features that is hardware dependent. |
||
| 51 | For LION products use: |
||
| 52 | 73 | David Fredriksson | <pre>sudo ./dtx.sh -t scriptengine|polyglot -v 3.2.2 -f myfolder -u **** -p **** -s "bac-device-id=nnnnn bac-device-name=yyyy app-password=xxxxxx bac-password=xxxxxx lion-enabled=true drk=xxxx platform=XX"</pre> |
| 53 | 71 | David Fredriksson | For other installations like PC, Servers etc. use: |
| 54 | 72 | Torbjorn Carlqvist Admin | <pre>sudo ./dtx.sh -t scriptengine|polyglot -v 3.1.23 -f myfolder -u **** -p **** -s "bac-device-id=nnnnn bac-device-name=yyyy app-password=xxxxxx bac-password=xxxxxx drk=xxxx platform=XX"</pre> |
| 55 | 1 | Torbjorn Carlqvist Admin | ### Utillity script to set MAC and host name |
| 56 | 54 | Torbjorn Carlqvist Admin | <pre>sudo ./system.sh -mac 70:B3:D5:16:E8:99 -hn DTX-L1-8R8DI</pre> |
| 57 | 62 | Torbjorn Carlqvist Admin | * Upgrade on linux |
| 58 | 69 | Torbjorn Carlqvist Admin | If you already have DTX installed and should upgrade to a new version *(Don't forget to set correct installfolder with -f)* |
| 59 | 72 | Torbjorn Carlqvist Admin | <pre>sudo ./dtx.sh -t scriptengine|polyglot -v 3.1.23 -f myfolder -u **** -p ****</pre> |
| 60 | 69 | Torbjorn Carlqvist Admin | * Manage the DTX service *(Note, since 17th Jan, 2024 of dtx.sh the names of the services are appended with the instsall folder in order to install multiple instances of DTX in same machine.)* |
| 61 | 70 | Torbjorn Carlqvist Admin | Stop<pre>sudo systemctl stop dtx_{myfolder}</pre> |
| 62 | Start<pre>sudo systemctl start dtx_{myfolder}</pre> |
||
| 63 | Check status<pre>systemctl status dtx_{myfolder}</pre> |
||
| 64 | Disable service, wont start at reboot<pre>sudo systemctl disable dtx_{myfolder}</pre> |
||
| 65 | Enable service, will start automatically at reboot<pre>sudo systemctl enable dtx_{myfolder}</pre> |
||
| 66 | 15 | Torbjorn Carlqvist Admin | |
| 67 | 55 | Torbjorn Carlqvist Admin | * For other Linux distributions follow this steps |
| 68 | 15 | Torbjorn Carlqvist Admin | ### _TBD..._ |
| 69 | |||
| 70 | 1 | Torbjorn Carlqvist Admin | * Install on Windows |
| 71 | ** Follow these steps: |
||
| 72 | 32 | David Fredriksson | ### _TBD..._ |
| 73 | 38 | Torbjorn Carlqvist Admin | |
| 74 | 32 | David Fredriksson | h3. LION Fieldbus |
| 75 | 38 | Torbjorn Carlqvist Admin | |
| 76 | 15 | Torbjorn Carlqvist Admin | * See LION [[LION:Wiki]] for howto in installataion, channel assigmnets and testing. |
| 77 | 1 | Torbjorn Carlqvist Admin | |
| 78 | |||
| 79 | |||
| 80 | 78 | David Fredriksson | --- |
| 81 | 97 | David Fredriksson | |
| 82 | 88 | David Fredriksson | h1. User's Guide |
| 83 | 1 | Torbjorn Carlqvist Admin | |
| 84 | 88 | David Fredriksson | h2. DTXr Web Interface – End User Documentation |
| 85 | |||
| 86 | 84 | David Fredriksson | h2. 1. Overview |
| 87 | 86 | David Fredriksson | |
| 88 | h4. The DTXr web interface allows users to: |
||
| 89 | 79 | David Fredriksson | * View BACnet objects and their properties |
| 90 | * Modify writable properties (e.g., Present Value) |
||
| 91 | * Edit weekly schedules |
||
| 92 | * Switch between local and remote devices |
||
| 93 | * Monitor alarms, events, and notifications |
||
| 94 | * Use real-time updates through WebSocket (local device only) |
||
| 95 | |||
| 96 | 88 | David Fredriksson | |
| 97 | *Important:* |
||
| 98 | When selecting a *remote BACnet device*, the object list and notifications *do not update automatically*. |
||
| 99 | You must press *@Objects → Refresh@* to reload the data. |
||
| 100 | |||
| 101 | For the *local device that hosts the web page*, all updates (property changes, events, alarms) are received *in real time*. |
||
| 102 | |||
| 103 | 79 | David Fredriksson | --- |
| 104 | |||
| 105 | h3. 2. Navigation Bar |
||
| 106 | |||
| 107 | h4. 2.1 Objects Menu |
||
| 108 | * *Refresh* reloads all object data and events. |
||
| 109 | |||
| 110 | _Note: Refresh is required when a remote device is selected._ |
||
| 111 | |||
| 112 | h4. 2.2 Devices Menu |
||
| 113 | * Displays local device and all discovered BACnet devices. |
||
| 114 | * Devices are grouped by network. |
||
| 115 | * Selecting a device loads its object list. |
||
| 116 | |||
| 117 | h4. 2.3 Priority Menu |
||
| 118 | Controls the *BACnet write priority* used when writing Present Value. |
||
| 119 | |||
| 120 | Examples: |
||
| 121 | * Priority 1 – Manual Life Safety |
||
| 122 | * Priority 8 – Default |
||
| 123 | * Priority 16 – Lowest |
||
| 124 | |||
| 125 | h4. 2.4 Notifications Menu |
||
| 126 | Shows: |
||
| 127 | * Alarms |
||
| 128 | * Events |
||
| 129 | * Return-to-normal |
||
| 130 | |||
| 131 | The menu uses badge counters: |
||
| 132 | * Yellow = events |
||
| 133 | * Red = alarms |
||
| 134 | * Green = normal transitions |
||
| 135 | |||
| 136 | --- |
||
| 137 | |||
| 138 | 84 | David Fredriksson | h3. 3. Objects View |
| 139 | 79 | David Fredriksson | |
| 140 | The main view lists all BACnet objects. |
||
| 141 | |||
| 142 | Features: |
||
| 143 | * Collapsible categories (accordions) |
||
| 144 | * Lazy loading of properties when expanded |
||
| 145 | * Editable Present Value fields where supported |
||
| 146 | * Real-time updates on the *local* device |
||
| 147 | * Manual refresh required for *remote* devices |
||
| 148 | |||
| 149 | h4. 3.1 Expanding an Object |
||
| 150 | Expanding an object loads: |
||
| 151 | * Properties |
||
| 152 | * Values |
||
| 153 | * Writable fields |
||
| 154 | * Schedule editor button (if applicable) |
||
| 155 | |||
| 156 | h4. 3.2 Writing Property Values |
||
| 157 | Steps: |
||
| 158 | # Edit a value in the input field. |
||
| 159 | # Press the Write/Save button. |
||
| 160 | # DTXr sends a BACnet WriteProperty with the selected priority. |
||
| 161 | # A popup shows success or error. |
||
| 162 | |||
| 163 | --- |
||
| 164 | |||
| 165 | h3. 4. Device Discovery |
||
| 166 | |||
| 167 | h4. 4.1 Discovering Devices |
||
| 168 | Opening the *Devices* dropdown sends a Who-Is request and populates the list. |
||
| 169 | |||
| 170 | h4. 4.2 Selecting a Device |
||
| 171 | When switching devices: |
||
| 172 | * Properties reload |
||
| 173 | * Notification list reloads |
||
| 174 | * The selected device name appears in the navbar |
||
| 175 | |||
| 176 | h4. 4.3 Refreshing Content |
||
| 177 | *Mandatory* when using remote devices. |
||
| 178 | |||
| 179 | Use: |
||
| 180 | @Objects → Refresh@ |
||
| 181 | |||
| 182 | This reloads: |
||
| 183 | * Object list |
||
| 184 | * Property values |
||
| 185 | * Notifications |
||
| 186 | |||
| 187 | --- |
||
| 188 | |||
| 189 | h3. 5. Notifications and Events |
||
| 190 | |||
| 191 | Notifications include: |
||
| 192 | * Alarm |
||
| 193 | * Event |
||
| 194 | * Normal |
||
| 195 | |||
| 196 | Real-time updates: |
||
| 197 | * Enabled for local device |
||
| 198 | * Disabled for remote devices — manual refresh required |
||
| 199 | |||
| 200 | h4. 5.1 Acknowledgment |
||
| 201 | If a notification supports acknowledgment: |
||
| 202 | * Press _Acknowledge_ |
||
| 203 | * DTXr sends BACnet AcknowledgeAlarm |
||
| 204 | * Notification updates when completed |
||
| 205 | |||
| 206 | --- |
||
| 207 | |||
| 208 | h3. 6. Weekly Schedule Editor |
||
| 209 | |||
| 210 | h4. 6.1 Opening the Editor |
||
| 211 | Click the schedule property to open the weekly calendar modal. |
||
| 212 | |||
| 213 | h4. 6.2 Creating Events |
||
| 214 | Select a time in the calendar to create a new event. |
||
| 215 | |||
| 216 | h4. 6.3 Editing Events |
||
| 217 | Click an event to modify: |
||
| 218 | * Binary schedule → Active / Inactive |
||
| 219 | * Analog schedule → numeric value |
||
| 220 | |||
| 221 | h4. 6.4 Saving the Schedule |
||
| 222 | Click *@Save changes@* to store the weekly schedule. |
||
| 223 | |||
| 224 | The data is: |
||
| 225 | * Compiled into BACnet dailySchedule structures |
||
| 226 | * Sorted chronologically |
||
| 227 | * Sent to the device as JSON |
||
| 228 | |||
| 229 | --- |
||
| 230 | |||
| 231 | h3. 7. Popups and Feedback |
||
| 232 | |||
| 233 | Popups indicate: |
||
| 234 | * Success |
||
| 235 | * Errors |
||
| 236 | * Info |
||
| 237 | * Warnings |
||
| 238 | |||
| 239 | --- |
||
| 240 | |||
| 241 | h3. 8. Troubleshooting |
||
| 242 | |||
| 243 | h4. 8.1 Objects Not Updating |
||
| 244 | * Remote device selected → press Refresh |
||
| 245 | * Network or device may be unreachable |
||
| 246 | |||
| 247 | h4. 8.2 Write Errors |
||
| 248 | Possible reasons: |
||
| 249 | * Incorrect priority |
||
| 250 | * Object out of service |
||
| 251 | * Invalid value |
||
| 252 | 1 | Torbjorn Carlqvist Admin | |
| 253 | 79 | David Fredriksson | h4. 8.3 Schedule Issues |
| 254 | 1 | Torbjorn Carlqvist Admin | * No events created |
| 255 | * Missing object ID |
||
| 256 | * Remote device requires manual refresh |
||
| 257 | |||
| 258 | |||
| 259 | --- |
||
| 260 | 81 | David Fredriksson | |
| 261 | 83 | David Fredriksson | h2. Setup |
| 262 | 79 | David Fredriksson | |
| 263 | 80 | David Fredriksson | DTXr is configured through the *Menu → Setup* page. |
| 264 | All configuration settings are grouped into logical sections. Each section below provides a functional overview of what the user can configure. |
||
| 265 | Values are stored in *settings.json* and applied system-wide after pressing *Save*. |
||
| 266 | |||
| 267 | *Important:* |
||
| 268 | When a *remote device* is selected from the HUB interface, *a manual page refresh is required* to update configuration data. |
||
| 269 | Local device information updates in real time. |
||
| 270 | 78 | David Fredriksson | h4. System |
| 271 | 1 | Torbjorn Carlqvist Admin | |
| 272 | 78 | David Fredriksson | Contains all fundamental system-level access and identity configuration. |
| 273 | 1 | Torbjorn Carlqvist Admin | |
| 274 | 78 | David Fredriksson | * Administrator Account |
| 275 | - Configure the password of the fixed “admin” user. |
||
| 276 | * Operator Account |
||
| 277 | - Optional user with limited access for HMIs or machine operation. |
||
| 278 | - Username, password and start page can be assigned. |
||
| 279 | * Developer Account |
||
| 280 | - Optional higher-level user with configurable module permissions |
||
| 281 | (code, objects, API, blocks, diagram, setup). |
||
| 282 | * Logging |
||
| 283 | - Set the system-wide log level (Debug, Info, Warning, Error). |
||
| 284 | * Hardware Platform |
||
| 285 | - Select hardware profile (PC/server, Mira/Mesh, LION, etc.). |
||
| 286 | - This controls the enable/disable state of platform-specific modules. |
||
| 287 | |||
| 288 | 1 | Torbjorn Carlqvist Admin | --- |
| 289 | 77 | David Fredriksson | |
| 290 | 78 | David Fredriksson | h4. BACnet |
| 291 | 1 | Torbjorn Carlqvist Admin | |
| 292 | 78 | David Fredriksson | Defines all BACnet/IP protocol parameters for the device. |
| 293 | 1 | Torbjorn Carlqvist Admin | |
| 294 | 78 | David Fredriksson | * Device Identity |
| 295 | - Device ID, Device Name. |
||
| 296 | * Security |
||
| 297 | - BACnet password (used for Device Communication Control). |
||
| 298 | * Protocol Settings |
||
| 299 | - Segmentation, Max APDU, Vendor ID and other low-level options. |
||
| 300 | * Network Mode |
||
| 301 | - Basic IP communication behaviour (broadcast, BBMD usage when applicable). |
||
| 302 | 1 | Torbjorn Carlqvist Admin | |
| 303 | 78 | David Fredriksson | This section is essential when integrating DTXr into a BACnet building automation network. |
| 304 | 1 | Torbjorn Carlqvist Admin | |
| 305 | --- |
||
| 306 | 77 | David Fredriksson | |
| 307 | 78 | David Fredriksson | h4. Wireless Mesh |
| 308 | 1 | Torbjorn Carlqvist Admin | |
| 309 | 78 | David Fredriksson | Provides access to the mesh radio configuration on supported hardware. |
| 310 | 1 | Torbjorn Carlqvist Admin | |
| 311 | 78 | David Fredriksson | * Enable/Disable Mesh |
| 312 | * Mesh Credentials |
||
| 313 | - Security keys, network key and authentication key. |
||
| 314 | * Node Role |
||
| 315 | - Coordinator / Router / End Device. |
||
| 316 | * Provisioning QR Code |
||
| 317 | - Device can generate a QR code containing mesh network credentials. |
||
| 318 | 77 | David Fredriksson | |
| 319 | 78 | David Fredriksson | Note: Mesh options are disabled on platform types that do not support radio. |
| 320 | 77 | David Fredriksson | |
| 321 | --- |
||
| 322 | |||
| 323 | 1 | Torbjorn Carlqvist Admin | h4. Bluetooth |
| 324 | 76 | David Fredriksson | |
| 325 | 1 | Torbjorn Carlqvist Admin | Configuration for onboard Bluetooth LE services (if supported by the platform). |
| 326 | 76 | David Fredriksson | |
| 327 | * Bluetooth Console |
||
| 328 | 1 | Torbjorn Carlqvist Admin | - Enables BLE-based console output. |
| 329 | 76 | David Fredriksson | * Beacon Mode |
| 330 | 1 | Torbjorn Carlqvist Admin | - Enables BLE advertisement and optional custom beacon name. |
| 331 | 76 | David Fredriksson | * Address Visibility and Power Settings |
| 332 | - Controls how the device broadcasts itself to the environment. |
||
| 333 | |||
| 334 | These options are automatically enabled or disabled depending on the selected platform type. |
||
| 335 | 1 | Torbjorn Carlqvist Admin | |
| 336 | 76 | David Fredriksson | --- |
| 337 | |||
| 338 | 1 | Torbjorn Carlqvist Admin | h4. LION Interface |
| 339 | 76 | David Fredriksson | |
| 340 | Shown only on LION-enabled platforms. |
||
| 341 | |||
| 342 | * Enable/Disable LION module support. |
||
| 343 | 1 | Torbjorn Carlqvist Admin | * Hardware Extensions |
| 344 | 76 | David Fredriksson | - Configures behaviour of LION-specific IO hardware. |
| 345 | * Channel Behavior |
||
| 346 | - Digital/analog features depending on LION product family. |
||
| 347 | |||
| 348 | --- |
||
| 349 | 75 | David Fredriksson | |
| 350 | 76 | David Fredriksson | h4. Davitor Advantage |
| 351 | |||
| 352 | Configuration for optional DAVITOR cloud lifecycle management. |
||
| 353 | |||
| 354 | 75 | David Fredriksson | * DRK (Davitor Reference Key) |
| 355 | 76 | David Fredriksson | - Used for remote maintenance and PLM link. |
| 356 | 75 | David Fredriksson | * PLM Connectivity |
| 357 | 76 | David Fredriksson | - Service URL and communication settings when using cloud management. |
| 358 | 75 | David Fredriksson | |
| 359 | 76 | David Fredriksson | --- |
| 360 | 75 | David Fredriksson | |
| 361 | h4. External Database Access |
||
| 362 | 76 | David Fredriksson | |
| 363 | Lets the DTXr device communicate with an external SQL/NoSQL database. |
||
| 364 | |||
| 365 | * Connection |
||
| 366 | - Host, port and protocol information. |
||
| 367 | 75 | David Fredriksson | * Credentials |
| 368 | 76 | David Fredriksson | - Username/password for authenticated connections. |
| 369 | * Sync/Logging Options |
||
| 370 | - Defines how data is written externally (trend logs, events, custom data). |
||
| 371 | |||
| 372 | --- |
||
| 373 | |||
| 374 | 75 | David Fredriksson | h4. File Integration |
| 375 | 76 | David Fredriksson | |
| 376 | Tools for importing/exporting system content. |
||
| 377 | |||
| 378 | * Backup / Restore |
||
| 379 | - Download the current configuration or upload a saved configuration. |
||
| 380 | * Project File Upload |
||
| 381 | 1 | Torbjorn Carlqvist Admin | - Add or replace project assets (HMIs, scripts, diagrams). |
| 382 | 76 | David Fredriksson | * Logs |
| 383 | 42 | David Fredriksson | - Download generated logs for troubleshooting. |
| 384 | 76 | David Fredriksson | |
| 385 | 13 | Torbjorn Carlqvist Admin | --- |
| 386 | 76 | David Fredriksson | |
| 387 | h4. HTTP Server |
||
| 388 | 11 | Torbjorn Carlqvist Admin | |
| 389 | 76 | David Fredriksson | Controls how the embedded DTXr HTTP(S) service behaves. |
| 390 | |||
| 391 | * Port Configuration |
||
| 392 | - Default HTTP port is 9090. |
||
| 393 | * HTTPS / TLS |
||
| 394 | 14 | Torbjorn Carlqvist Admin | - Optional encrypted access. |
| 395 | 76 | David Fredriksson | * Session Timeout |
| 396 | - Auto-logout delay for inactive users. |
||
| 397 | 14 | Torbjorn Carlqvist Admin | * Allowed Hosts |
| 398 | 11 | Torbjorn Carlqvist Admin | - Restrict network clients that can access the interface. |
| 399 | 76 | David Fredriksson | |
| 400 | 14 | Torbjorn Carlqvist Admin | --- |
| 401 | 76 | David Fredriksson | |
| 402 | h4. Email |
||
| 403 | |||
| 404 | Allows the device to send or receive email for automation events. |
||
| 405 | 11 | Torbjorn Carlqvist Admin | |
| 406 | 76 | David Fredriksson | * SMTP Server |
| 407 | 11 | Torbjorn Carlqvist Admin | - Address, port, TLS/STARTTLS. |
| 408 | 76 | David Fredriksson | * Authentication |
| 409 | 14 | Torbjorn Carlqvist Admin | - Optional username/password. |
| 410 | 76 | David Fredriksson | * Attachments Folder |
| 411 | - Path where incoming email attachments are stored. |
||
| 412 | |||
| 413 | --- |
||
| 414 | 11 | Torbjorn Carlqvist Admin | |
| 415 | 76 | David Fredriksson | h4. Location Services |
| 416 | |||
| 417 | The device can determine its location automatically. |
||
| 418 | 1 | Torbjorn Carlqvist Admin | |
| 419 | 76 | David Fredriksson | * Automatic Geolocation |
| 420 | - Queries an external geolocation service to populate latitude/longitude. |
||
| 421 | * Manual Input |
||
| 422 | - User can override location if browser access is restricted. |
||
| 423 | |||
| 424 | 19 | Torbjorn Carlqvist Admin | --- |
| 425 | 76 | David Fredriksson | |
| 426 | 19 | Torbjorn Carlqvist Admin | h4. IoT HUB (BETA) |
| 427 | 76 | David Fredriksson | |
| 428 | 1 | Torbjorn Carlqvist Admin | Early-stage experimental cloud integration. |
| 429 | 76 | David Fredriksson | |
| 430 | * Backend URL |
||
| 431 | 1 | Torbjorn Carlqvist Admin | - IoT gateway endpoint. |
| 432 | 76 | David Fredriksson | * Device Token |
| 433 | - Authentication token for cloud usage. |
||
| 434 | 1 | Torbjorn Carlqvist Admin | * Upload Options |
| 435 | 76 | David Fredriksson | - Define what data the device forwards (events, logs, telemetry). |
| 436 | |||
| 437 | --- |
||
| 438 | |||
| 439 | 1 | Torbjorn Carlqvist Admin | h4. Save & Refresh |
| 440 | 76 | David Fredriksson | |
| 441 | * Save |
||
| 442 | 1 | Torbjorn Carlqvist Admin | - Commits all modified settings to settings.json. |
| 443 | 76 | David Fredriksson | * Refresh |
| 444 | - Reloads settings from device memory. |
||
| 445 | - Required after switching to a remote device. |
||
| 446 | |||
| 447 | 1 | Torbjorn Carlqvist Admin | |
| 448 | 76 | David Fredriksson | --- |
| 449 | 1 | Torbjorn Carlqvist Admin | |
| 450 | 83 | David Fredriksson | h2. Blocks Editor (Blockly) |
| 451 | 82 | David Fredriksson | |
| 452 | The *Blocks* page provides a visual programming environment based on Google Blockly. |
||
| 453 | Users can build automation logic using drag-and-drop blocks instead of traditional code. |
||
| 454 | All logic created here is converted into JavaScript and executed by the DTXr runtime. |
||
| 455 | |||
| 456 | The Blocks Editor is divided into four main areas: |
||
| 457 | * The *toolbox* (left side) containing categorized blocks |
||
| 458 | * The *Blockly workspace* (center) |
||
| 459 | * The *log and activity panels* (bottom) |
||
| 460 | * Editor actions available in the top navigation bar |
||
| 461 | |||
| 462 | --- |
||
| 463 | |||
| 464 | 95 | David Fredriksson | h4. Navigation Bar Features |
| 465 | 82 | David Fredriksson | |
| 466 | * Blocks → *Refresh* |
||
| 467 | - Re-parses the block code displayed in the workspace. |
||
| 468 | * Blocks → *Clear logs* |
||
| 469 | - Clears the log console in the footer area. |
||
| 470 | * Test |
||
| 471 | - Executes the currently visible block code once, without saving. |
||
| 472 | * Save |
||
| 473 | - Saves the current block workspace into the device configuration. |
||
| 474 | * Activate |
||
| 475 | - Saves and also activates the block program so it runs continuously. |
||
| 476 | * Notifications |
||
| 477 | - Shows system events, alarms, and normal transitions in real time. |
||
| 478 | |||
| 479 | --- |
||
| 480 | |||
| 481 | 95 | David Fredriksson | h4. Blockly Workspace |
| 482 | 82 | David Fredriksson | |
| 483 | The main canvas where blocks are placed and connected. |
||
| 484 | |||
| 485 | * Drag blocks from the toolbox onto the workspace. |
||
| 486 | * Connect blocks to form logic chains. |
||
| 487 | * Right-click a block to duplicate, delete, or collapse it. |
||
| 488 | * Zoom and pan with the mouse wheel or gestures. |
||
| 489 | |||
| 490 | All changes in the workspace are local until *Save* or *Activate* is pressed. |
||
| 491 | |||
| 492 | --- |
||
| 493 | |||
| 494 | 95 | David Fredriksson | h4. Toolbox Categories |
| 495 | 82 | David Fredriksson | |
| 496 | The toolbox is organized into logical categories: |
||
| 497 | |||
| 498 | * JSON |
||
| 499 | - Blocks for constructing and parsing JSON objects. |
||
| 500 | * Logic |
||
| 501 | - If/else, comparison, boolean operations. |
||
| 502 | * Loops |
||
| 503 | - Repeat operations. |
||
| 504 | * Math |
||
| 505 | - Arithmetic and numeric values. |
||
| 506 | * Text |
||
| 507 | - String operations and concatenation. |
||
| 508 | * Variables |
||
| 509 | - Create and manage global/local variables. |
||
| 510 | |||
| 511 | *Events (DTX-specific)* |
||
| 512 | - Triggers for analog or binary input changes |
||
| 513 | - Astro events |
||
| 514 | - Timers |
||
| 515 | - Incoming text messages |
||
| 516 | - Diagram object push events |
||
| 517 | |||
| 518 | *Set value / Read value (DTX BACnet extensions)* |
||
| 519 | - Write analog, binary, lighting outputs |
||
| 520 | - Read analog or binary values |
||
| 521 | - Compare input states |
||
| 522 | |||
| 523 | *Timed tasks* |
||
| 524 | - Cron-like scheduling |
||
| 525 | - Start, cancel, pause, resume timers |
||
| 526 | |||
| 527 | *HMI* |
||
| 528 | - Update graphical objects or maps in diagrams/HMI pages |
||
| 529 | |||
| 530 | *Code* |
||
| 531 | - Insert raw JavaScript statements |
||
| 532 | - Create custom return statements |
||
| 533 | - Handle function call events |
||
| 534 | |||
| 535 | *Misc* |
||
| 536 | - Print to log |
||
| 537 | - Date/time |
||
| 538 | |||
| 539 | *Notifications* |
||
| 540 | - Send email from block logic |
||
| 541 | |||
| 542 | These categories combine to cover automation, BACnet control, HMI interaction and notifications. |
||
| 543 | |||
| 544 | --- |
||
| 545 | |||
| 546 | 95 | David Fredriksson | h4. Running and Activating Code |
| 547 | 82 | David Fredriksson | |
| 548 | *Test* |
||
| 549 | Executes the block logic one time, useful for debugging. |
||
| 550 | |||
| 551 | *Save* |
||
| 552 | Stores the block script but does not run it automatically. |
||
| 553 | |||
| 554 | *Activate* |
||
| 555 | Saves and deploys the block logic to the DTXr runtime engine. |
||
| 556 | Activated logic will: |
||
| 557 | * Run automatically on device startup |
||
| 558 | * Respond to events immediately |
||
| 559 | * Allow scheduled logic to trigger without manual execution |
||
| 560 | |||
| 561 | --- |
||
| 562 | |||
| 563 | 95 | David Fredriksson | h4. Sidebars and Console |
| 564 | 82 | David Fredriksson | |
| 565 | *Left Sidebar* |
||
| 566 | May contain the workspace tree or additional contextual tools. |
||
| 567 | |||
| 568 | *Right Sidebar* |
||
| 569 | Displays block metadata, help text or generated JavaScript depending on configuration. |
||
| 570 | |||
| 571 | *Footer Console* |
||
| 572 | Two areas are available: |
||
| 573 | * *Log* — printed output from print blocks or runtime |
||
| 574 | * *Activity* — messages about system behavior, activation, parsing, etc. |
||
| 575 | |||
| 576 | Both areas support resizing using draggable split panes. |
||
| 577 | |||
| 578 | --- |
||
| 579 | |||
| 580 | 95 | David Fredriksson | h4. Working With Devices in Blocks Mode |
| 581 | 82 | David Fredriksson | |
| 582 | The device selector is present but indicates: |
||
| 583 | |||
| 584 | *“Not applicable in Blocks mode”* |
||
| 585 | |||
| 586 | This is because Blockly logic always runs locally on the device that hosts DTXr. |
||
| 587 | Remote devices cannot be programmed using the Blocks Editor. |
||
| 588 | |||
| 589 | --- |
||
| 590 | |||
| 591 | 95 | David Fredriksson | h4. Saving Your Work |
| 592 | 82 | David Fredriksson | |
| 593 | The block workspace is saved in the device’s internal configuration. |
||
| 594 | A backup is included when exporting system configuration via the File Integration tools. |
||
| 595 | |||
| 596 | *Important:* |
||
| 597 | If block logic interacts with remote devices (reading/writing values), |
||
| 598 | use *Refresh* in Objects view to ensure the remote values have been updated recently. |
||
| 599 | |||
| 600 | --- |
||
| 601 | |||
| 602 | 95 | David Fredriksson | h4. Error Handling |
| 603 | 82 | David Fredriksson | |
| 604 | When errors occur: |
||
| 605 | * The error message appears in the log console |
||
| 606 | * Pop-up notifications show parsing or execution issues |
||
| 607 | * Common issues include: |
||
| 608 | - Missing block connections |
||
| 609 | - Undefined variables |
||
| 610 | - Writing to unavailable BACnet objects |
||
| 611 | |||
| 612 | --- |
||
| 613 | |||
| 614 | 95 | David Fredriksson | h4. Best Practices |
| 615 | 82 | David Fredriksson | |
| 616 | * Keep block structures grouped and well-organized |
||
| 617 | * Name variables clearly |
||
| 618 | * Use print statements during development |
||
| 619 | * Test frequently before activation |
||
| 620 | * Avoid long chains inside event triggers |
||
| 621 | * Use timers for repeated actions, not loops |
||
| 622 | |||
| 623 | 93 | David Fredriksson | --- |
| 624 | 92 | David Fredriksson | |
| 625 | 93 | David Fredriksson | h2. Code Editor (DTXr) |
| 626 | 1 | Torbjorn Carlqvist Admin | |
| 627 | 93 | David Fredriksson | The Code Editor in DTXr provides a complete development environment for automation scripting, BACnet integration, file management, debugging, and interacting with both local and remote devices. |
| 628 | The page is divided into several functional areas, each designed to support efficient automation development and system diagnostics. |
||
| 629 | 1 | Torbjorn Carlqvist Admin | |
| 630 | 93 | David Fredriksson | --- |
| 631 | 92 | David Fredriksson | |
| 632 | 93 | David Fredriksson | h3. Overview of the Page Layout |
| 633 | 1 | Torbjorn Carlqvist Admin | |
| 634 | 93 | David Fredriksson | DTXr Code Editor consists of four main UI regions: |
| 635 | 1 | Torbjorn Carlqvist Admin | |
| 636 | 93 | David Fredriksson | * **Left Pane – File Browser** |
| 637 | Shows project files stored on the device, such as automation.js, HTML pages, CSS, JSON, XML, HMI/Diagram files, logs, and configuration files. |
||
| 638 | 92 | David Fredriksson | |
| 639 | 93 | David Fredriksson | * **Center Pane – Code Editor (ACE Editor)** |
| 640 | A full-featured code editor with syntax highlighting, autocomplete, evaluation tools, and integration with the BACnet browser. |
||
| 641 | 1 | Torbjorn Carlqvist Admin | |
| 642 | 93 | David Fredriksson | * **Right Pane – BACnet Browser** |
| 643 | Displays the connected BACnet networks, devices, objects, and properties with support for read, write, and object creation. |
||
| 644 | 92 | David Fredriksson | |
| 645 | 93 | David Fredriksson | * **Bottom Area – Console & Activity Log** |
| 646 | Used for debugging JavaScript, viewing print output, receiving notifications, and tracking internal DTX events. |
||
| 647 | 92 | David Fredriksson | |
| 648 | 93 | David Fredriksson | A **top navigation menu** provides commands such as Save, Activate, Evaluate, Reinitialize and Clear Log. |
| 649 | 92 | David Fredriksson | |
| 650 | --- |
||
| 651 | |||
| 652 | 93 | David Fredriksson | h3. Left Pane: File Browser |
| 653 | 1 | Torbjorn Carlqvist Admin | |
| 654 | 93 | David Fredriksson | The file browser shows all project and system-related files available in the device’s storage. |
| 655 | 92 | David Fredriksson | |
| 656 | 93 | David Fredriksson | Functions include: |
| 657 | 92 | David Fredriksson | |
| 658 | 93 | David Fredriksson | * Navigating directories |
| 659 | * Opening files in the center code pane |
||
| 660 | * Creating new files (JS, HTML, JSON, XML, CSS, HMI/Diagram) |
||
| 661 | * Uploading multiple files at once |
||
| 662 | * Downloading files |
||
| 663 | * Cloning or renaming files |
||
| 664 | * Deleting files |
||
| 665 | * Choosing "Open With" (Diagram Editor, HMI Editor, Markdown Viewer, Raw Mode) |
||
| 666 | * Previewing HTML files in a new browser tab |
||
| 667 | 1 | Torbjorn Carlqvist Admin | |
| 668 | 93 | David Fredriksson | Restrictions: |
| 669 | 92 | David Fredriksson | |
| 670 | 93 | David Fredriksson | * Some protected system directories cannot be renamed or removed |
| 671 | * When connected to a *remote device*, execution of JavaScript is not supported (only storing/editing files) |
||
| 672 | 1 | Torbjorn Carlqvist Admin | |
| 673 | 93 | David Fredriksson | DTXr warns before navigating away if unsaved edits exist. |
| 674 | 92 | David Fredriksson | |
| 675 | 1 | Torbjorn Carlqvist Admin | --- |
| 676 | |||
| 677 | 93 | David Fredriksson | h3. Right Pane: BACnet Browser |
| 678 | 1 | Torbjorn Carlqvist Admin | |
| 679 | 93 | David Fredriksson | The BACnet browser displays: |
| 680 | 1 | Torbjorn Carlqvist Admin | |
| 681 | 93 | David Fredriksson | * Networks |
| 682 | * Devices |
||
| 683 | * Object Types |
||
| 684 | * Individual Objects |
||
| 685 | * Properties (including writable flags and enumeration values) |
||
| 686 | 1 | Torbjorn Carlqvist Admin | |
| 687 | 93 | David Fredriksson | Each node can be expanded independently and refreshed individually to minimize network traffic. |
| 688 | 1 | Torbjorn Carlqvist Admin | |
| 689 | --- |
||
| 690 | |||
| 691 | 93 | David Fredriksson | h4. Reading & Writing Properties |
| 692 | 92 | David Fredriksson | |
| 693 | 93 | David Fredriksson | From any BACnet property node, you may: |
| 694 | 1 | Torbjorn Carlqvist Admin | |
| 695 | 93 | David Fredriksson | * Read the value |
| 696 | * Write to writable properties |
||
| 697 | * Refresh only that property |
||
| 698 | * Inspect metadata such as engineering units, status flags, and enumeration states |
||
| 699 | 1 | Torbjorn Carlqvist Admin | |
| 700 | 92 | David Fredriksson | --- |
| 701 | 1 | Torbjorn Carlqvist Admin | |
| 702 | 93 | David Fredriksson | h4. Device-Level Actions |
| 703 | 1 | Torbjorn Carlqvist Admin | |
| 704 | 93 | David Fredriksson | Available actions: |
| 705 | 92 | David Fredriksson | |
| 706 | 93 | David Fredriksson | * *Who-Is* – Discover local devices |
| 707 | * *Who-Is Global* – Discover devices across all accessible networks |
||
| 708 | * *Reinitialize Device* – Warm start, cold start (requires password) |
||
| 709 | * *Restart Device* – Full reboot (requires password) |
||
| 710 | * *Read All Properties* – Retrieve a complete BACnet property set |
||
| 711 | 1 | Torbjorn Carlqvist Admin | |
| 712 | --- |
||
| 713 | |||
| 714 | 93 | David Fredriksson | h4. Adding BACnet Objects (Virtual Objects) |
| 715 | 1 | Torbjorn Carlqvist Admin | |
| 716 | 93 | David Fredriksson | DTXr allows creation of **virtual BACnet objects**, which exist entirely in software and not in physical hardware. |
| 717 | 1 | Torbjorn Carlqvist Admin | |
| 718 | 93 | David Fredriksson | Supported types include: |
| 719 | 1 | Torbjorn Carlqvist Admin | |
| 720 | 93 | David Fredriksson | * Analog Value (AV) |
| 721 | * Binary Value (BV) |
||
| 722 | * Multi-State Value (MSV) |
||
| 723 | * Trend Logs |
||
| 724 | * Schedules & Calendars |
||
| 725 | * Notification Classes |
||
| 726 | * File objects |
||
| 727 | * Many additional standard object types |
||
| 728 | 92 | David Fredriksson | |
| 729 | 93 | David Fredriksson | Virtual objects behave exactly like real BACnet objects: |
| 730 | 92 | David Fredriksson | |
| 731 | 93 | David Fredriksson | * They support ReadProperty and WriteProperty |
| 732 | * They support COV subscriptions |
||
| 733 | * They can be logged, alarmed and trended |
||
| 734 | * They appear to all BACnet clients on the network |
||
| 735 | |||
| 736 | These objects enable advanced automation without requiring hardware wiring. |
||
| 737 | |||
| 738 | 92 | David Fredriksson | --- |
| 739 | |||
| 740 | 93 | David Fredriksson | h4. Benefits of Virtual BACnet Objects |
| 741 | 92 | David Fredriksson | |
| 742 | 93 | David Fredriksson | Virtual objects make DTX highly flexible: |
| 743 | 92 | David Fredriksson | |
| 744 | 93 | David Fredriksson | * Easily combine sensor inputs into new BACnet values |
| 745 | * Represent logic states (HeatingDemand, OccupancyStatus, etc.) |
||
| 746 | * Create synthetic points (averages, maximums, deltas, differences) |
||
| 747 | * Produce outputs used by other BACnet controllers |
||
| 748 | * Build complex automation logic without extra I/O modules |
||
| 749 | * Use TrendLogs for computed metrics |
||
| 750 | 92 | David Fredriksson | |
| 751 | --- |
||
| 752 | |||
| 753 | 93 | David Fredriksson | h3. Drag & Drop Integration (BACnet Browser → Code) |
| 754 | 92 | David Fredriksson | |
| 755 | 93 | David Fredriksson | When dragging a device, object or property into the code pane, DTX automatically generates a usable JavaScript snippet. |
| 756 | 92 | David Fredriksson | |
| 757 | 93 | David Fredriksson | Examples: |
| 758 | 92 | David Fredriksson | |
| 759 | 93 | David Fredriksson | <pre>read("1234", "analogInput", 1, "presentValue")</pre> |
| 760 | 92 | David Fredriksson | |
| 761 | 93 | David Fredriksson | <pre>write("1234", "binaryValue", 5, "presentValue", 1)</pre> |
| 762 | 92 | David Fredriksson | |
| 763 | 93 | David Fredriksson | <pre>subscribeCOV("1234", "analogValue", 10, (value) => { |
| 764 | print("COV update: " + value) |
||
| 765 | })</pre> |
||
| 766 | 92 | David Fredriksson | |
| 767 | 93 | David Fredriksson | --- |
| 768 | 92 | David Fredriksson | |
| 769 | 93 | David Fredriksson | h3. Top Navigation Commands |
| 770 | 92 | David Fredriksson | |
| 771 | 93 | David Fredriksson | * **Save** – Saves the current file |
| 772 | * **Activate** – Activates JavaScript files on local device |
||
| 773 | * **Evaluate** – Runs selected code |
||
| 774 | * **Evaluate and Print** – Runs and prints output |
||
| 775 | * **Reinitialize** – Reloads automation system |
||
| 776 | * **Clear Log** – Clears console |
||
| 777 | 92 | David Fredriksson | |
| 778 | 93 | David Fredriksson | Remote nodes allow saving but cannot execute code from this page. |
| 779 | |||
| 780 | 92 | David Fredriksson | --- |
| 781 | |||
| 782 | 93 | David Fredriksson | h3. Bottom Area: Console & Activity Log |
| 783 | 92 | David Fredriksson | |
| 784 | 93 | David Fredriksson | The **Console Log** shows: |
| 785 | 92 | David Fredriksson | |
| 786 | 93 | David Fredriksson | * print() output |
| 787 | * JavaScript evaluation results |
||
| 788 | * Errors and system warnings |
||
| 789 | * WebSocket logs |
||
| 790 | |||
| 791 | The **Activity Log** shows internal BACnet and automation notifications. |
||
| 792 | |||
| 793 | 92 | David Fredriksson | --- |
| 794 | |||
| 795 | 93 | David Fredriksson | h3. JavaScript Automation in DTX |
| 796 | 92 | David Fredriksson | |
| 797 | 93 | David Fredriksson | DTX includes a full ECMAScript engine: |
| 798 | 92 | David Fredriksson | |
| 799 | 93 | David Fredriksson | * **Any JavaScript can be used** |
| 800 | * Arrays, JSON, classes, functions, loops, math, state machines—all supported |
||
| 801 | * DTX adds automation libraries on top of standard JavaScript |
||
| 802 | |||
| 803 | 92 | David Fredriksson | --- |
| 804 | |||
| 805 | 93 | David Fredriksson | h4. BACnet Communication Functions |
| 806 | 92 | David Fredriksson | |
| 807 | 93 | David Fredriksson | <pre>read(deviceId, type, instance, property)</pre> |
| 808 | <pre>write(deviceId, type, instance, property, value)</pre> |
||
| 809 | <pre>subscribeCOV(deviceId, type, instance, callback)</pre> |
||
| 810 | <pre>readAllProperties(deviceId, type, instance)</pre> |
||
| 811 | <pre>whoIs()</pre> |
||
| 812 | <pre>iam()</pre> |
||
| 813 | 92 | David Fredriksson | |
| 814 | --- |
||
| 815 | |||
| 816 | 93 | David Fredriksson | h4. Timers & Scheduling |
| 817 | 92 | David Fredriksson | |
| 818 | 93 | David Fredriksson | <pre>runEvery(seconds, callback)</pre> |
| 819 | <pre>runAt("HH:MM", callback)</pre> |
||
| 820 | <pre>runSchedule(scheduleObj, callback)</pre> |
||
| 821 | 92 | David Fredriksson | |
| 822 | --- |
||
| 823 | |||
| 824 | 93 | David Fredriksson | h4. Logging & Notifications |
| 825 | 92 | David Fredriksson | |
| 826 | 93 | David Fredriksson | <pre>trend("energy", value)</pre> |
| 827 | <pre>getTrend("energy")</pre> |
||
| 828 | <pre>notify(level, message)</pre> |
||
| 829 | <pre>alarmOn(tag)</pre> |
||
| 830 | <pre>alarmOff(tag)</pre> |
||
| 831 | 92 | David Fredriksson | |
| 832 | --- |
||
| 833 | |||
| 834 | 93 | David Fredriksson | h4. System Functions |
| 835 | 92 | David Fredriksson | |
| 836 | 93 | David Fredriksson | <pre>restart()</pre> |
| 837 | <pre>reinit()</pre> |
||
| 838 | <pre>getSystemInfo()</pre> |
||
| 839 | <pre>getDeviceList()</pre> |
||
| 840 | 92 | David Fredriksson | |
| 841 | --- |
||
| 842 | |||
| 843 | 93 | David Fredriksson | h3. Complete Automation Examples |
| 844 | 92 | David Fredriksson | |
| 845 | 93 | David Fredriksson | h4. Averaging Temperatures |
| 846 | 92 | David Fredriksson | |
| 847 | 93 | David Fredriksson | <pre> |
| 848 | runEvery(10, () => { |
||
| 849 | let values = [ |
||
| 850 | read("1001","analogInput",1,"presentValue"), |
||
| 851 | read("1001","analogInput",2,"presentValue"), |
||
| 852 | read("1001","analogInput",3,"presentValue"), |
||
| 853 | read("1001","analogInput",4,"presentValue") |
||
| 854 | ] |
||
| 855 | let avg = values.reduce((a,b)=>a+b) / values.length |
||
| 856 | write("local", "analogValue", 10, "presentValue", avg) |
||
| 857 | }) |
||
| 858 | </pre> |
||
| 859 | 92 | David Fredriksson | |
| 860 | 93 | David Fredriksson | h4. COV-Controlled Cooling |
| 861 | 92 | David Fredriksson | |
| 862 | 93 | David Fredriksson | <pre> |
| 863 | subscribeCOV("3000","analogInput",7,(value)=>{ |
||
| 864 | write("local","binaryValue",5,"presentValue", value > 22 ? 1 : 0) |
||
| 865 | }) |
||
| 866 | </pre> |
||
| 867 | 92 | David Fredriksson | |
| 868 | 93 | David Fredriksson | h4. Humidity Alarm |
| 869 | 92 | David Fredriksson | |
| 870 | 93 | David Fredriksson | <pre> |
| 871 | runEvery(5, () => { |
||
| 872 | let humidity = read("ruuvi01","analogInput",8,"presentValue") |
||
| 873 | |||
| 874 | if (humidity > 80) { |
||
| 875 | alarmOn("HumidityHigh") |
||
| 876 | notify("critical", "Humidity too high: " + humidity) |
||
| 877 | } else { |
||
| 878 | alarmOff("HumidityHigh") |
||
| 879 | } |
||
| 880 | }) |
||
| 881 | </pre> |
||
| 882 | |||
| 883 | h4. Multi-State Virtual Logic |
||
| 884 | |||
| 885 | <pre> |
||
| 886 | runEvery(1, () => { |
||
| 887 | let t = read("local","analogValue",10,"presentValue") |
||
| 888 | let state = |
||
| 889 | t < 18 ? 1 : |
||
| 890 | t < 22 ? 2 : |
||
| 891 | t < 25 ? 3 : 4 |
||
| 892 | |||
| 893 | write("local","multiStateValue",20,"presentValue",state) |
||
| 894 | }) |
||
| 895 | </pre> |
||
| 896 | |||
| 897 | 92 | David Fredriksson | |
| 898 | |||
| 899 | --- |
||
| 900 | |||
| 901 | 87 | David Fredriksson | h2. BACnet |
| 902 | 82 | David Fredriksson | |
| 903 | 87 | David Fredriksson | BACnet (Building Automation and Control Network) is an international open communication standard for building automation systems. |
| 904 | It enables devices from different manufacturers to communicate, share data, and coordinate functions such as HVAC, lighting, alarms, access control and energy management. |
||
| 905 | 76 | David Fredriksson | |
| 906 | 87 | David Fredriksson | BACnet is defined and maintained by the BACnet Committee (SSPC 135) under ASHRAE. |
| 907 | |||
| 908 | More information: https://bacnet.org |
||
| 909 | |||
| 910 | 1 | Torbjorn Carlqvist Admin | --- |
| 911 | |||
| 912 | 87 | David Fredriksson | h3. Standards and Certification |
| 913 | |||
| 914 | BACnet is based on globally recognized standards: |
||
| 915 | |||
| 916 | * *ASHRAE Standard 135* |
||
| 917 | The core BACnet protocol specification, maintained by ASHRAE. |
||
| 918 | |||
| 919 | * *ISO 16484-5* |
||
| 920 | International standard for building automation and control networks. |
||
| 921 | |||
| 922 | * *ANSI/ASHRAE Addenda* |
||
| 923 | Regular updates ensure modern features and cyber-security enhancements. |
||
| 924 | |||
| 925 | Because BACnet is standardized internationally, devices are tested and validated against consistent technical rules. |
||
| 926 | This ensures long-term compatibility and protects investments in automation systems. |
||
| 927 | |||
| 928 | --- |
||
| 929 | |||
| 930 | h3. How BACnet Communication Works |
||
| 931 | |||
| 932 | BACnet defines: |
||
| 933 | * *Objects* — structured data models (AI, AO, BI, BO, Schedules, etc.) |
||
| 934 | * *Properties* — attributes of each object (Present Value, Units, Status Flags…) |
||
| 935 | * *Services* — methods for communicating (ReadProperty, WriteProperty, etc.) |
||
| 936 | |||
| 937 | Common communication mechanisms: |
||
| 938 | * **BACnet/IP** over UDP (default port 47808) |
||
| 939 | * **Who-Is / I-Am** device discovery |
||
| 940 | * **ReadProperty / WriteProperty** for data exchange |
||
| 941 | * **COV (Change of Value) subscriptions** for event-driven updates |
||
| 942 | * **Alarm and Event notifications** |
||
| 943 | |||
| 944 | DTXr implements: |
||
| 945 | * Full BACnet/IP functionality |
||
| 946 | * Device discovery |
||
| 947 | * Automatic reading and writing of properties |
||
| 948 | * Real-time event handling |
||
| 949 | * COV subscriptions when available |
||
| 950 | |||
| 951 | --- |
||
| 952 | |||
| 953 | 89 | David Fredriksson | h3. Key Advantages of BACnet |
| 954 | 87 | David Fredriksson | |
| 955 | *Open and vendor-neutral* |
||
| 956 | BACnet is not controlled by a single private company. Any manufacturer can implement the standard. |
||
| 957 | This eliminates vendor lock-in and ensures long-term system freedom. |
||
| 958 | |||
| 959 | *Large global ecosystem* |
||
| 960 | Hundreds of companies worldwide produce BACnet-certified devices: |
||
| 961 | * HVAC controllers |
||
| 962 | * Sensors and actuators |
||
| 963 | * Lighting systems |
||
| 964 | * VAV and damper controllers |
||
| 965 | * Energy monitoring systems |
||
| 966 | * User interfaces and visualizations |
||
| 967 | |||
| 968 | This means integrators can mix-and-match equipment from different brands without special gateways. |
||
| 969 | |||
| 970 | *Interoperability by design* |
||
| 971 | Because BACnet defines standard object types and required properties, devices share: |
||
| 972 | * Common naming conventions |
||
| 973 | * Common alarm/event handling behavior |
||
| 974 | * Standard scheduling objects |
||
| 975 | * Standard data types |
||
| 976 | |||
| 977 | This makes exchanging live data straightforward and predictable. |
||
| 978 | |||
| 979 | *Efficient Event-Driven Communication with COV* |
||
| 980 | Rather than constantly polling for updates, BACnet supports **Change of Value (COV)** subscriptions: |
||
| 981 | * A device notifies subscribers only when a value *actually changes* |
||
| 982 | * No wasted network traffic |
||
| 983 | * Faster updates for dynamic values |
||
| 984 | * Lower CPU and bandwidth usage |
||
| 985 | * Ideal for large systems or wireless deployments |
||
| 986 | |||
| 987 | COV is one of BACnet’s biggest advantages over legacy systems that rely on heavy cyclic polling. |
||
| 988 | |||
| 989 | *Rich Metadata Built Into the Protocol* |
||
| 990 | BACnet objects include a wide range of metadata: |
||
| 991 | * Object Name |
||
| 992 | * Description |
||
| 993 | * Units |
||
| 994 | * Engineering limits |
||
| 995 | * Reliability state |
||
| 996 | * Status flags |
||
| 997 | * Priority array |
||
| 998 | * Object type |
||
| 999 | |||
| 1000 | Metadata allows tools like DTXr to: |
||
| 1001 | * Auto-discover device capabilities |
||
| 1002 | * Display real names and units |
||
| 1003 | * Visualize systems without custom drivers |
||
| 1004 | * Auto-generate controls and dashboards |
||
| 1005 | |||
| 1006 | This reduces engineering time and improves clarity for end users. |
||
| 1007 | |||
| 1008 | --- |
||
| 1009 | 90 | David Fredriksson | |
| 1010 | 89 | David Fredriksson | h2. Davitor Advantage |
| 1011 | 90 | David Fredriksson | |
| 1012 | 87 | David Fredriksson | h3. Interoperability and Vendor Collaboration |
| 1013 | |||
| 1014 | BACnet has a long-standing interoperability testing ecosystem: |
||
| 1015 | |||
| 1016 | * *BACnet Testing Laboratories (BTL)* |
||
| 1017 | Certifies devices against standardized profiles, ensuring correct communication. |
||
| 1018 | |||
| 1019 | * *BTL Listings* |
||
| 1020 | Public database of certified devices that work together reliably. |
||
| 1021 | |||
| 1022 | * *Plugfests* |
||
| 1023 | Manufacturers meet twice per year to test their devices against each other in real networks. |
||
| 1024 | |||
| 1025 | The result: |
||
| 1026 | * Multi-brand BACnet systems work reliably |
||
| 1027 | * Integration cost is lower |
||
| 1028 | * Long-term compatibility is ensured |
||
| 1029 | * Devices can be replaced without redesigning the entire system |
||
| 1030 | |||
| 1031 | BACnet is one of the strongest and most mature interoperability ecosystems in the automation industry. |
||
| 1032 | |||
| 1033 | --- |
||
| 1034 | |||
| 1035 | h3. Why BACnet Works Exceptionally Well With DTXr |
||
| 1036 | |||
| 1037 | DTXr is built around BACnet’s strengths: |
||
| 1038 | * Automatic discovery of BACnet devices |
||
| 1039 | * Real-time event and alarm handling |
||
| 1040 | * Full COV support |
||
| 1041 | * Multi-priority writing of Present Value |
||
| 1042 | * Automatic metadata integration (names, units, descriptions) |
||
| 1043 | * Native schedule editor compatible with BACnet Schedule objects |
||
| 1044 | * BACnet notifications shown directly in the interface |
||
| 1045 | |||
| 1046 | DTXr can be used as: |
||
| 1047 | * A BACnet central controller |
||
| 1048 | * A visualization/HMI layer |
||
| 1049 | * A programming environment (Code + Blocks) |
||
| 1050 | * A diagnostics tool for technicians |
||
| 1051 | 1 | Torbjorn Carlqvist Admin | * A multi-device integration and commissioning tool |
| 1052 | 87 | David Fredriksson | |
| 1053 | DTXr leverages the power of BACnet without requiring advanced protocol knowledge from the user. |
||
| 1054 | 1 | Torbjorn Carlqvist Admin | |
| 1055 | --- |
||
| 1056 | 89 | David Fredriksson | h2. DTX Overview (Development Environment) |
| 1057 | 1 | Torbjorn Carlqvist Admin | |
| 1058 | !https://www.davitor.com/Home/DTX! |
||
| 1059 | 89 | David Fredriksson | |
| 1060 | DTX (by Davitor) is a powerful development and runtime environment designed for building automation, integration, and control — especially for BACnet-based systems. |
||
| 1061 | The environment is directly integrated into the device, allowing engineers to create, test, and execute automation logic locally or remotely via a web browser. |
||
| 1062 | 96 | David Fredriksson | DTX is suitable for controllers, gateways, cloud connectors, and industrial IO devices. |
| 1063 | 89 | David Fredriksson | |
| 1064 | --- |
||
| 1065 | |||
| 1066 | h3. Core Concept: Development Inside the Device |
||
| 1067 | |||
| 1068 | DTX is described by Davitor as a **“Development Environment for BACnet devices”**. |
||
| 1069 | 96 | David Fredriksson | Its philosophy centers around **self-contained automation**, where development tools live inside the device itself — eliminating lost code, mismatched versions, or external dependencies. This enhances system integrity and long-term maintainability. |
| 1070 | 89 | David Fredriksson | |
| 1071 | 1 | Torbjorn Carlqvist Admin | A major benefit of this approach: |
| 1072 | 89 | David Fredriksson | * Your automation project is stored and executed natively inside the device. |
| 1073 | * You can access the development environment anywhere on the network. |
||
| 1074 | * No separate development workstation is required. |
||
| 1075 | 98 | David Fredriksson | * The same environment works on almost any hardware or operating system supporting Java 17 or higher. |
| 1076 | 89 | David Fredriksson | |
| 1077 | 1 | Torbjorn Carlqvist Admin | --- |
| 1078 | 89 | David Fredriksson | |
| 1079 | 1 | Torbjorn Carlqvist Admin | h3. Key Features of DTX |
| 1080 | 89 | David Fredriksson | |
| 1081 | *Modular and Future-Proof Design* |
||
| 1082 | DTX is built with modularity in mind: |
||
| 1083 | * The development environment runs on the device. |
||
| 1084 | 98 | David Fredriksson | * It is platform-independent and OS-agnostic (runs wherever Java 17+ works). |
| 1085 | 96 | David Fredriksson | * It acts as a **controller**, **cloud service**, or **gateway**, depending on need. |
| 1086 | 89 | David Fredriksson | |
| 1087 | *One Unified Environment* |
||
| 1088 | DTX includes everything needed for automation development: |
||
| 1089 | * Full **code editor** with JavaScript (ES6) support. |
||
| 1090 | 1 | Torbjorn Carlqvist Admin | * A built-in **BACnet browser** for object discovery and inspection. |
| 1091 | 89 | David Fredriksson | * Easy **GUI and HMI creation** tools. |
| 1092 | 96 | David Fredriksson | * Integrated script engine, REST API bindings, email notifications, and schedule management. |
| 1093 | 89 | David Fredriksson | |
| 1094 | *Use Any Developer, Any Skill Level* |
||
| 1095 | 96 | David Fredriksson | Since DTX uses **JavaScript**, a widely accessible language, the need for specialized proprietary system knowledge is minimized. Anyone with basic JavaScript skills can build automation logic. |
| 1096 | 89 | David Fredriksson | |
| 1097 | --- |
||
| 1098 | |||
| 1099 | h3. Protocol Integration and Interoperability |
||
| 1100 | |||
| 1101 | DTX natively supports protocols used in modern automation: |
||
| 1102 | 1 | Torbjorn Carlqvist Admin | * **BACnet/IP** (full stack with browser and read/write tools) |
| 1103 | 89 | David Fredriksson | * **MODBUS** (both Master and Slave over TCP/RTU) |
| 1104 | * **REST API** (both server and client capabilities for external application integration) |
||
| 1105 | * Optional LION fieldbus support on specialized hardware |
||
| 1106 | * MQTT broker capability for IoT use cases |
||
| 1107 | 96 | David Fredriksson | * Serial port support (ASCII and HEX with configurable delimiter) |
| 1108 | 89 | David Fredriksson | |
| 1109 | 96 | David Fredriksson | The modular approach allows data from any source (BACnet or otherwise) to be exposed directly through DTX’s REST interface — enabling integration with cloud, database or analytics platforms while preserving metadata and object structure. |
| 1110 | 89 | David Fredriksson | |
| 1111 | --- |
||
| 1112 | |||
| 1113 | h3. Unified Automation Stack |
||
| 1114 | |||
| 1115 | DTX unifies: |
||
| 1116 | * Development (IDE + editor inside the device) |
||
| 1117 | * HMI design (visual diagram editor) |
||
| 1118 | 1 | Torbjorn Carlqvist Admin | * Script execution (JavaScript engine) |
| 1119 | 89 | David Fredriksson | * Protocol communication (BACnet, Modbus, HTTP, MQTT, etc.) |
| 1120 | * Notifications and email support |
||
| 1121 | 96 | David Fredriksson | * Database integration (built-in user database or external Postgres SQL) |
| 1122 | 89 | David Fredriksson | |
| 1123 | This makes DTX not only a controller but also a **full automation ecosystem** where: |
||
| 1124 | * Automation logic is developed, tested, and deployed locally |
||
| 1125 | * Values and objects are available in real time |
||
| 1126 | * Projects are stored in the device and cannot get disconnected from the runtime |
||
| 1127 | |||
| 1128 | --- |
||
| 1129 | |||
| 1130 | h3. Integration with Davitor Advantage |
||
| 1131 | |||
| 1132 | When combined with Davitor Advantage, DTX becomes a **remotely manageable node** in a scalable automation network: |
||
| 1133 | * Develop locally on any device |
||
| 1134 | * Provision devices via Davitor cloud |
||
| 1135 | * Manage and monitor projects across multiple sites and protocols |
||
| 1136 | * Keep firmware, logic, and configuration synchronized across installations |
||
| 1137 | |||
| 1138 | 96 | David Fredriksson | See https://www.davitor.com for product details and documentation. |
| 1139 | 89 | David Fredriksson | |
| 1140 | --- |
||
| 1141 | |||
| 1142 | 91 | David Fredriksson | h2. Radio Support & Supported Protocols |
| 1143 | 1 | Torbjorn Carlqvist Admin | |
| 1144 | 91 | David Fredriksson | DTX provides flexible wireless communication depending on platform and hardware. |
| 1145 | 98 | David Fredriksson | Because DTX can run on any system capable of Java 17 or later, wireless capabilities can range from WiFi-only devices to advanced multi-protocol gateways. |
| 1146 | 1 | Torbjorn Carlqvist Admin | |
| 1147 | 91 | David Fredriksson | Below are the primary wireless technologies supported by DTX, in recommended reading order. |
| 1148 | |||
| 1149 | --- |
||
| 1150 | |||
| 1151 | h3. WiFi (BACnet over WiFi) |
||
| 1152 | |||
| 1153 | 98 | David Fredriksson | DTX includes a complete BACnet/IP stack and can run on any Java 17+ capable WiFi device. |
| 1154 | 91 | David Fredriksson | When DTX is installed on hardware with WiFi (e.g., Raspberry Pi, industrial WiFi gateways, embedded controllers), it automatically supports: |
| 1155 | |||
| 1156 | * Full BACnet/IP communication over WiFi |
||
| 1157 | * COV subscriptions (efficient change-based updates) |
||
| 1158 | * Who-Is / I-Am device discovery |
||
| 1159 | * Reading and writing BACnet properties |
||
| 1160 | * BACnet schedules, events, notifications, and alarms |
||
| 1161 | * Participation in BACnet networks without wired Ethernet |
||
| 1162 | |||
| 1163 | This makes DTX a fully wireless BACnet controller when running on WiFi-enabled hardware — ideal for commissioning, mobile diagnostics, or wireless installations. |
||
| 1164 | |||
| 1165 | --- |
||
| 1166 | |||
| 1167 | h3. Bluetooth Devices (non-mesh) |
||
| 1168 | |||
| 1169 | DTX supports Bluetooth Low Energy (BLE) devices for direct sensor integration. |
||
| 1170 | This includes well-known BLE beacon and sensor devices such as **RUUVI smart sensors**, which DTX can automatically detect and encapsulate as BACnet objects. |
||
| 1171 | |||
| 1172 | Examples of RUUVI sensor data mapped by DTX: |
||
| 1173 | |||
| 1174 | * **Temperature** (°C) |
||
| 1175 | * **Humidity** (%) |
||
| 1176 | * **Air Pressure** (Pa/hPa) |
||
| 1177 | * **Movement / Acceleration** (X/Y/Z axis) |
||
| 1178 | * **Battery level** |
||
| 1179 | * **Signal strength (RSSI)** |
||
| 1180 | |||
| 1181 | DTX automatically: |
||
| 1182 | |||
| 1183 | * Detects nearby BLE sensors |
||
| 1184 | * Parses their advertisement data (no pairing required) |
||
| 1185 | * Creates corresponding BACnet objects |
||
| 1186 | * Updates values in real time |
||
| 1187 | * Allows automation logic and HMI dashboards to use them like any other BACnet sensor |
||
| 1188 | |||
| 1189 | This enables **fully wireless environmental measurement** with zero wiring and minimal configuration. |
||
| 1190 | |||
| 1191 | RUUVI devices are ideal for: |
||
| 1192 | |||
| 1193 | * HVAC monitoring |
||
| 1194 | * Building comfort tracking |
||
| 1195 | * Server room supervision |
||
| 1196 | * Warehousing & storage |
||
| 1197 | * Indoor air quality dashboards |
||
| 1198 | * Asset or movement detection |
||
| 1199 | |||
| 1200 | Because the sensors broadcast continuously, DTX receives updates passively, with extremely low energy usage on the sensor side. |
||
| 1201 | |||
| 1202 | --- |
||
| 1203 | |||
| 1204 | h3. Wireless Long-Range DALI-2 Device (Davitor) |
||
| 1205 | |||
| 1206 | DTX supports integration with **Davitor’s Wireless Long-Range DALI-2 Device**, enabling wireless extension of DALI-2 lighting networks. |
||
| 1207 | Instead of cabling DALI buses across long distances, the system uses Davitor’s long-range radio modules to connect DALI-2 control gear wirelessly. |
||
| 1208 | |||
| 1209 | Key features: |
||
| 1210 | |||
| 1211 | * Wireless connection between DTX and DALI-2 luminaires |
||
| 1212 | * Maintains full DALI-2 functionality (dimming, groups, scenes, status) |
||
| 1213 | * Extends DALI-2 coverage beyond normal cable distance limits |
||
| 1214 | * Simplifies installation & retrofit work |
||
| 1215 | * Reduces cable infrastructure costs |
||
| 1216 | * All DALI-2 channels and objects appear in DTX as BACnet objects |
||
| 1217 | |||
| 1218 | This allows DTX to become a **wireless lighting controller**, combining BACnet automation with DALI-2 lighting systems. |
||
| 1219 | |||
| 1220 | Suitable for: |
||
| 1221 | |||
| 1222 | * Industrial halls |
||
| 1223 | * Large buildings |
||
| 1224 | * Office retrofits |
||
| 1225 | * Outdoor lighting |
||
| 1226 | * Warehouses |
||
| 1227 | * Locations where DALI cabling is impractical |
||
| 1228 | |||
| 1229 | DTX treats wireless DALI-2 exactly like wired BACnet points, enabling seamless integration with automation scripts, schedules, alarms, and GUI pages. |
||
| 1230 | |||
| 1231 | --- |
||
| 1232 | |||
| 1233 | h3. Radio Mesh (MIRA & BLE5 Mesh) |
||
| 1234 | |||
| 1235 | DTX integrates with radio-based mesh networks such as **MIRA Mesh** and **BLE5 Mesh** using Davitor’s multi-protocol radio interface. |
||
| 1236 | Mesh networks provide long-range, self-healing wireless communication ideal for distributed sensors and actuators. |
||
| 1237 | |||
| 1238 | DTX can: |
||
| 1239 | |||
| 1240 | * Discover mesh nodes automatically |
||
| 1241 | * Map mesh node values into BACnet objects |
||
| 1242 | * Control mesh actuators through BACnet writes |
||
| 1243 | * Use mesh-based sensors for automation logic |
||
| 1244 | * Support large installations with many devices |
||
| 1245 | |||
| 1246 | Common mesh technologies used with DTX: |
||
| 1247 | |||
| 1248 | * **MIRA Mesh** — IPv6-based, ultra-low power, long-range self-healing mesh |
||
| 1249 | * **BLE5 Mesh** — Bluetooth-based many-to-many lighting & sensor networks |
||
| 1250 | |||
| 1251 | Benefits of mesh: |
||
| 1252 | |||
| 1253 | * Extremely scalable |
||
| 1254 | * Multi-hop routing increases range |
||
| 1255 | * No single point of failure |
||
| 1256 | * Low power consumption for battery nodes |
||
| 1257 | * Ideal for smart buildings, lighting control, indoor/outdoor sensor grids |
||
| 1258 | |||
| 1259 | Example applications: |
||
| 1260 | |||
| 1261 | * Wireless environmental sensors |
||
| 1262 | * Industrial sensor networks |
||
| 1263 | * Lighting control clusters |
||
| 1264 | * Distributed monitoring systems |
||
| 1265 | * Mesh-connected actuators or relay nodes |
||
| 1266 | |||
| 1267 | DTX treats mesh nodes as native BACnet devices, providing seamless integration across wired, WiFi, Bluetooth, and mesh networks. |
||
| 1268 | |||
| 1269 | --- |
||
| 1270 | |||
| 1271 | h3. Summary |
||
| 1272 | |||
| 1273 | DTX supports multiple wireless communication paths: |
||
| 1274 | |||
| 1275 | * **WiFi** — full BACnet/IP capability on wireless hardware |
||
| 1276 | * **Bluetooth (RUUVI and others)** — automatic BLE sensor discovery and BACnet mapping |
||
| 1277 | * **Wireless Long-Range DALI-2** — wireless lighting control integration |
||
| 1278 | * **Radio Mesh (MIRA & BLE5)** — scalable multi-hop wireless automation |
||
| 1279 | |||
| 1280 | This allows DTX to operate in environments where wired infrastructure is limited, expensive, or impossible — while maintaining complete BACnet interoperability and automation capabilities. |
||
| 1281 | 1 | Torbjorn Carlqvist Admin | |
| 1282 | |||
| 1283 | --- |
||
| 1284 | |||
| 1285 | |||
| 1286 | h3. Developer's Guide |
||
| 1287 | |||
| 1288 | [[IDE|IDE walk through]] |
||
| 1289 | [[Javascript|The DTXr Javascript guide]] |
||
| 1290 | [[Blockly|Blockly tutorials]] |