Home/Support/Support Forum/Transforms devicedriver which checks if value changed: if not, no sample forwarded
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

Transforms devicedriver which checks if value changed: if not, no sample forwarded

0 votes
I upgraded my DIA framework recently to 2.3.1.1 and noticed that the "Transform" device driver changed, introducing a trap :)

I use the Transform device to generate at regular interval simulation values. So my "dia.yml" contains:

devices:
- name: alarm_clock0
driver: devices.alarm_clock_device:AlarmClockDevice

- name: SimulatedTempSensor
driver: devices.transforms_device:TransformsDevice
settings:
- name: "temperature"
unit: ""
channels:
- "alarm_clock.0.15_sec"
expr: "23"

This emits a simulated constant temperature each 15 seconds.

It worked fine before my DIA version upgrade. But now, only the initial value is forwarded to the DIA channel SimulatedTempSensor.temperature

After working hard to try to find the bug in my code, I finish to discover that the Transforms DD writes the new sample to the output channel ONLY IF this value differs from the preceding.
Since my expression is limited to a constant, the value is never re-emitted.

I consider that this is a trap.
  • The documentation does not mention that the value has to change
  • Even when not using a constant expression as I do, nothing guaranties that 2 consecutive values are always different

So, it would be nice if you provide an evolution of the Transforms DD, adding a new setting that allows to discard or not same consecutive values.
asked Dec 22, 2014 in Device Cloud by bernhara New to the Community (5 points)

Please log in or register to answer this question.

...