Default value for channels [message #1777198] |
Sun, 26 November 2017 23:27 |
Gabriel Klein Messages: 5 Registered: November 2017 |
Junior Member |
|
|
Hello,
I'm writing the implementation of my te923 weather station.
To update one channel, I do:
updateState(new ChannelUID(getThing().getUID(), c.getMappingName()),
new DecimalType(d[c.getPositionInResponse()]));
One of my issue is that data may not come directly to the weather station.
If the data is not available yet, I don't call updateState for this channel. As an example one of my temperature sensor may not send some data (due to intermittent connectivity issues).
My issue is on the control tab.
By default, the value is set to 0.
Example
Temperature Internal Channel: 21.4 °C
Humidity Internal Channel: 51 %
Temperature Channel 1: 0.0 °C
Humidity Channel 1: 0 %
I'm expecting something like
Temperature Internal Channel: 21.4 °C
Humidity Internal Channel: 51 %
Temperature Channel 1: - (Not available yet)
Humidity Channel 1: - (Not available yet)
If I try to set
updateState(new ChannelUID(getThing().getUID(), c.getMappingName()),
new DecimalType(Double.NaN));
I get the following error : Character N is neither a decimal digit number, decimal point, nor "e" notation exponential mark. (probably the first letter of NaN)
Do I do something wrong? Could I notify openHab or smarthome that my data is not (yet) available for a specific channel?
[Updated on: Mon, 27 November 2017 07:40] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03778 seconds