-
Notifications
You must be signed in to change notification settings - Fork 0
Devices
The Adapters plugin currently supports these device types:
The Predefined Scale Adapter device provides several built-in standard conversions, including: Length, Power, and Temperature. Select the scale type, then choose the native scale (what your source device reports) and the desired scale (what you want the adapter to display). You can also set the decimal precision of the output.

The Custom Linear Scale Adapter applies a linear transformation to a numeric sensor state using the formula:
result = (native reading * multiplier) + offset
Set the Multiplier and Offset fields to define the transformation, then use the Format field to control
how the result is displayed (Python "new style" format strings, e.g. {0:.2f} °C). Use the Show Result button
to preview the output before saving.

The Custom Formula Adapter (numeric) lets you write an arbitrary math expression to transform a sensor value. Use
x in your expression to refer to the current sensor reading. Expressions are evaluated safely using a restricted
Python evaluator. Some examples:
-
(9/5 * x) + 32— Celsius to Fahrenheit -
x ** 2 + 3 * x + 4— polynomial expression -
1 if x == 2 else -1— conditional mapping
Set the Format field to control how the numeric result is displayed. Use the Show Result button to preview the output before saving.

The Custom Formula Adapter (string) is similar to the numeric variant but produces a string state value. This is
useful for mapping sensor readings to labels or codes. Use x to refer to the current sensor reading. Some examples:
'up' if x == 1 else 'down''up' if x == 1 else 'down' if x == 0 else 'stuck'
Set the Format field to wrap the result string if needed (e.g. code {0}). Use the Show Result button to
preview the output before saving.

This plugin, originally authored by forum user "dustysparkle", is distributed as open source under the Apache 2.0 license.