<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[🔢 Data Point Types Explained (INT, BOOL, STR, JSON, RAW + enum fields)]]></title><description><![CDATA[<h1>Data Point Types Explained</h1>
<p dir="auto">A data point type is not just a storage detail. It decides what the dashboard can render, what a control widget can write, and how the value is validated.</p>
<p dir="auto">This guide covers the types exposed by the current create panel, plus the two cases people ask about most: decimals and enum values.</p>
<p dir="auto"><img src="https://forum.grapesiot.com/assets/uploads/files/1794556169740-01-types.png" alt="Data point type buttons in the create panel" class=" img-fluid img-markdown" /></p>
<p dir="auto"><em>The create panel exposes INT, BOOL, STR, JSON and RAW. INT is the numeric type and accepts decimal values.</em></p>
<h2>The five top-level types</h2>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>Button</th>
<th>Stored as</th>
<th>Use it for</th>
<th>Notes</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>INT</strong></td>
<td>JSON number</td>
<td>Temperature, humidity, voltage, counters</td>
<td>The numeric type. Decimals are allowed even though the label says INT.</td>
</tr>
<tr>
<td><strong>BOOL</strong></td>
<td>Boolean</td>
<td>Pump on/off, door open/closed, relay state</td>
<td>Send real <code>true</code> / <code>false</code>, not <code>"on"</code> or <code>1</code>.</td>
</tr>
<tr>
<td><strong>STR</strong></td>
<td>String</td>
<td>Mode names, firmware version, short labels</td>
<td>Set a max length.</td>
</tr>
<tr>
<td><strong>JSON</strong></td>
<td>Object with typed fields</td>
<td>Schedules, config blobs, grouped telemetry</td>
<td>Defined as named fields with their own types.</td>
</tr>
<tr>
<td><strong>RAW</strong></td>
<td>String</td>
<td>Opaque vendor frames, hex payloads, pre-encoded data</td>
<td>Stored as text; the platform does not interpret it.</td>
</tr>
</tbody>
</table>
<h3>INT is the numeric type</h3>
<p dir="auto">The create panel labels the numeric type <strong>INT</strong>, but the backend stores it as a number. That means <code>25.4</code> is a valid value.</p>
<p dir="auto">There is no separate <strong>FLOAT</strong> button in this build. If you need fractional values, use INT and set the unit, min, max, and step. When the widget prompts for a number, the step controls the increment.</p>
<h3>BOOL is strict</h3>
<p dir="auto">A boolean data point expects <code>true</code> or <code>false</code> in the payload:</p>
<pre><code class="language-json">{ "pump": true }
</code></pre>
<p dir="auto">Sending <code>"true"</code>, <code>1</code>, or <code>"on"</code> may be accepted as a string by JSON but will not behave like a boolean in widgets and automations. Normalise the value in firmware before publishing.</p>
<h3>STR and RAW are not the same</h3>
<p dir="auto">Both are stored as strings, but they signal different intent:</p>
<ul>
<li><strong>STR</strong> is human-readable: <code>"auto"</code>, <code>"eco"</code>, <code>"v1.4.2"</code>. Use it when the dashboard may display or select the value.</li>
<li><strong>RAW</strong> is opaque: a hex frame, a base64 blob, a vendor-specific payload. Use it when the platform should store and forward the value without interpreting it.</li>
</ul>
<p dir="auto">If you want to display the value, prefer STR. If you want to preserve bytes, prefer RAW.</p>
<h2>JSON data points</h2>
<p dir="auto">A JSON point is a small schema. Instead of one value, it contains named fields, each with its own type:</p>
<p dir="auto"><img src="https://forum.grapesiot.com/assets/uploads/files/1794556170216-02-json.png" alt="JSON data point variable editor" class=" img-fluid img-markdown" /></p>
<p dir="auto"><em>JSON data points are defined as a set of named fields. Each field has its own type and optional default.</em></p>
<pre><code class="language-json">{
  "schedule": {
    "start": "06:00",
    "duration_min": 15,
    "enabled": true,
    "mode": "auto"
  }
}
</code></pre>
<p dir="auto">The JSON field editor lets you define each field's key, type, default value, and description. Supported field types are:</p>
<ul>
<li><strong>bool</strong></li>
<li><strong>number</strong></li>
<li><strong>string</strong></li>
<li><strong>enum</strong></li>
</ul>
<p dir="auto">Use JSON when the values belong together and you want one data point instead of five. Use separate top-level points when each value needs its own widget, history, or automation trigger.</p>
<p dir="auto"><img src="https://forum.grapesiot.com/assets/uploads/files/1794556170783-03-json-fields.png" alt="JSON field editor with key, type and description" class=" img-fluid img-markdown" /></p>
<p dir="auto"><em>Inside a JSON point you can mix bool, number, string and enum fields. The key is what your device publishes.</em></p>
<h3>Enum fields</h3>
<p dir="auto">Enum is available as a <strong>field type inside JSON</strong> and as a binding type in widgets. It maps a stored value to a human label:</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>Key</th>
<th>Label</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>auto</code></td>
<td>Automatic</td>
</tr>
<tr>
<td><code>eco</code></td>
<td>Eco</td>
</tr>
<tr>
<td><code>manual</code></td>
<td>Manual</td>
</tr>
</tbody>
</table>
<p dir="auto">This is the right choice for mode selectors and state machines. A top-level ENUM type is reserved in the schema and supported by some widgets, but the current create panel does not expose it as a top-level button. If you need named states today, use a JSON field with type Enum, or a STR with a documented set of values.</p>
<h2>Direction is part of the type decision</h2>
<p dir="auto">The type says what the value is. The direction says who owns it.</p>
<p dir="auto"><img src="https://forum.grapesiot.com/assets/uploads/files/1794556171268-04-direction.png" alt="Logic and access settings for a data point" class=" img-fluid img-markdown" /></p>
<p dir="auto"><em>Direction decides who owns the value: Control means the dashboard writes it, Status means the device reports it.</em></p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>Direction</th>
<th>Meaning</th>
<th>Typical examples</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>Status (from device)</strong></td>
<td>Device reports; dashboard reads</td>
<td>Temperature, humidity, battery</td>
</tr>
<tr>
<td><strong>Control (to device)</strong></td>
<td>Dashboard or automation writes; device obeys</td>
<td>Pump, target temperature, mode</td>
</tr>
<tr>
<td><strong>Both</strong></td>
<td>Device reports and dashboard can write</td>
<td>Setpoint echoed by the device</td>
</tr>
</tbody>
</table>
<p dir="auto">Choose direction before you deploy. A control widget cannot bind to a status-only point, and changing direction later can invalidate existing bindings.</p>
<h2>Storage and history</h2>
<p dir="auto">Storage is separate from type. A point can be live-only or stored:</p>
<ul>
<li><strong>Live-only:</strong> the current value is available to monitors and widgets, but no history is kept.</li>
<li><strong>Stored:</strong> history is written for charts, exports, and audits.</li>
</ul>
<p dir="auto">High-rate telemetry is often live-only. Daily totals, alarm states, and setpoints are usually stored.</p>
<h2>Naming rules</h2>
<p dir="auto">The identifier is the key your device publishes, so keep it stable and boring.</p>
<ul>
<li>Must start with a letter.</li>
<li>Lowercase letters, numbers, and underscores only.</li>
<li>Maximum <strong>16 characters</strong>.</li>
<li>Must be unique within the product.</li>
<li>Name: maximum <strong>32 characters</strong>.</li>
<li>Description: maximum <strong>64 characters</strong>.</li>
</ul>
<p dir="auto">Good: <code>temp</code>, <code>humidity</code>, <code>pump_state</code>, <code>battery_v</code>.<br />
Avoid: <code>Temp</code>, <code>pump-state</code>, <code>temperature_sensor_1</code>, <code>t</code>.</p>
<h2>Choosing a type: quick guide</h2>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>If you are measuring...</th>
<th>Use</th>
</tr>
</thead>
<tbody>
<tr>
<td>A number, including decimals</td>
<td>INT</td>
</tr>
<tr>
<td>An on/off state</td>
<td>BOOL</td>
</tr>
<tr>
<td>A short label or mode name</td>
<td>STR</td>
</tr>
<tr>
<td>A group of related values</td>
<td>JSON</td>
</tr>
<tr>
<td>An opaque frame or blob</td>
<td>RAW</td>
</tr>
<tr>
<td>A named state inside a group</td>
<td>JSON field with type Enum</td>
</tr>
</tbody>
</table>
<h2>Common mistakes</h2>
<ol>
<li><strong>Sending a string for a numeric point.</strong> <code>"25.4"</code> is not <code>25.4</code>. Cast in firmware.</li>
<li><strong>Using BOOL for a multi-state value.</strong> A pump is boolean; a mode with three values is not.</li>
<li><strong>Using five top-level points for one config blob.</strong> Use JSON when the values are always updated together.</li>
<li><strong>Using JSON when each value needs history.</strong> History and widgets are easier with separate points.</li>
<li><strong>Renaming a code after devices are deployed.</strong> Add a new point instead.</li>
</ol>
<h2>Next</h2>
<ul>
<li><strong>Quickstart: Device → MQTT → Live Monitor</strong> for a working publisher.</li>
<li><strong>Your First Dashboard in UI Studio</strong> for binding each type to the right widget.</li>
</ul>
]]></description><link>https://forum.grapesiot.com/topic/91/data-point-types-explained-int-bool-str-json-raw-enum-fields</link><generator>RSS for Node</generator><lastBuildDate>Thu, 19 Nov 2026 13:02:45 GMT</lastBuildDate><atom:link href="https://forum.grapesiot.com/topic/91.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 13 Nov 2026 07:49:29 GMT</pubDate><ttl>60</ttl></channel></rss>