Skip to content

Commit

Permalink
Merge pull request #17 from CC1337/master
Browse files Browse the repository at this point in the history
Added option to not log 85°C readings. They appear if a DS18B20 has a power failure and returns this initial register value.
  • Loading branch information
GermanBluefox authored Feb 13, 2020
2 parents 42dc9fd + 8892c47 commit 48f0cbd
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 4 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ Before you must create the directroy */mnt/1wire* with command `mkdir /mnt/1wire
http://sourceforge.net/projects/owfs/

## Changelog
### 0.6.3 (2020-10-23)

### 0.6.4 (2020-01-26)
* (CC1337) Added option to not log 85°C readings. They appear if a DS18B20 has a power failure and returns this initial register value.

### 0.6.3 (2020-01-23)
* (INgo Rah) Added the alarm state handling

### 0.6.2 (2019-10-29)
Expand Down
1 change: 1 addition & 0 deletions admin/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ <h4 class="translate">OWFS server settings</h4>
<tr><td><label class="translate" for="interval">Poll interval(sec):</label></td><td class="admin-icon"></td><td><input class="value number" id="interval" size="4"/></td></tr>
<tr><td><label class="translate" for="alarmInterval">Alarm poll interval(msec / 0 = off):</label></td><td class="admin-icon"></td><td><input class="value number" id="alarmInterval" size="4"/></td></tr>
<tr><td><label class="translate" for="noStateChangeOnError">No state change on error</label></td><td class="admin-icon"></td><td><input class="value" id="noStateChangeOnError" type="checkbox"/></td></tr>
<tr><td><label class="translate" for="noStateChangeOn85C">No state change on 85°C reading (initial state of DS18B20 in case of power failure)</label></td><td class="admin-icon"></td><td><input class="value" id="noStateChangeOn85C" type="checkbox"/></td></tr>
</table>
<h4 class="translate">Wires addresses</h4>
<div id="values" style="width: 100%; height: calc(100% - 280px)">
Expand Down
4 changes: 4 additions & 0 deletions admin/index_m.html
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,10 @@
<input class="value" id="noStateChangeOnError" type="checkbox"/>
<label class="translate" for="noStateChangeOnError">No state change on error</label>
</div>
<div class="col s12 m4">
<input class="value" id="noStateChangeOn85C" type="checkbox"/>
<label class="translate" for="noStateChangeOn85C">No state change on 85°C reading (initial state of DS18B20 in case of power failure)</label>
</div>
</div>
</div>
<div id="tab-devices" class="col s12 page">
Expand Down
1 change: 1 addition & 0 deletions admin/words.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 14 additions & 1 deletion io-package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
{
"common": {
"name": "owfs",
"version": "0.6.3",
"version": "0.6.4",
"news": {
"0.6.4": {
"en": "Added option to not log 85°C readings. They appear if a DS18B20 has a power failure and returns this initial register value.",
"de": "Eine Option, 85°C Werte zu ignorieren wurde hinzugefügt. Diese treten beim DS18B20 nach einem Neustart aufgrund Spannungsverlust auf (Initialwert).",
"ru": "Добавлена возможность не регистрировать 85 °C показаний. Они появляются, если DS18B20 имеет сбой питания и возвращает это начальное значение регистра.",
"pt": "Adicionado opção para não registrar leituras de 85 °C. Eles aparecem se um DS18B20 tiver uma falha de energia e retornar esse valor inicial do registro.",
"nl": "Optie toegevoegd om 85 °C-waarden niet te loggen. Ze verschijnen als een DS18B20 een stroomstoring heeft en deze initiële registerwaarde retourneert.",
"fr": "Ajout d'une option pour ne pas enregistrer les mesures à 85 °C. Ils apparaissent si un DS18B20 a une panne de courant et renvoie cette valeur de registre initiale.",
"it": "Aggiunta opzione per non registrare letture a 85 °C. Appaiono se un DS18B20 ha un'interruzione di corrente e restituisce questo valore iniziale del registro.",
"es": "Opción agregada para no registrar lecturas de 85 °C. Aparecen si un DS18B20 tiene una falla de energía y devuelve este valor de registro inicial.",
"pl": "Dodano opcję nie rejestrowania odczytów 85 °C. Pojawiają się, jeśli DS18B20 ma awarię zasilania i zwraca tę początkową wartość rejestru.",
"zh-cn": "添加了不记录85°C读数的选项。如果DS18B20断电并返回该初始寄存器值,则会显示它们。"
},
"0.6.3": {
"en": "Added the alarm state handling",
"de": "Die Alarmstatusbehandlung wurde hinzugefügt",
Expand Down Expand Up @@ -137,6 +149,7 @@
"path": "/mnt/1wire",
"ip": "127.0.0.1",
"noStateChangeOnError": false,
"noStateChangeOn85C": false,
"port": 4304,
"alarmInterval": 0,
"interval": 30,
Expand Down
6 changes: 5 additions & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,11 @@ function readWire(wire) {
// else some float value, e.g. temperature
let val = owfsParseFloat(result.value);
if (!isNaN(val)) {
adapter.setState('wires.' + wire._name, {val: val, ack: true, q: 0});
if (adapter.config.noStateChangeOn85C && val >= 84.999 && val <= 85.001) {
adapter.log.info('Ignoring 85.0°C value of /' + wire.id + '/' + (wire.property || 'temperature') + ': ' + result.value);
} else {
adapter.setState('wires.' + wire._name, {val: val, ack: true, q: 0});
}
} else {
adapter.log.info('Cannot parse value of /' + wire.id + '/' + (wire.property || 'temperature') + ': ' + result.value);
if (!adapter.config.noStateChangeOnError) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "iobroker.owfs",
"description": "This adapter enable read and control of 1wire sensors over owfs server from ioBroker.",
"version": "0.6.3",
"version": "0.6.4",
"author": "bluefox <dogafox@gmail.com>",
"contributors": [
"bluefox <dogafox@gmail.com>"
Expand Down

0 comments on commit 48f0cbd

Please sign in to comment.