Skip to content

Instantly share code, notes, and snippets.

@stas-dovgodko
Created January 9, 2022 17:21
Show Gist options
  • Save stas-dovgodko/b6c0ece8b38519533cd6e12da8452db9 to your computer and use it in GitHub Desktop.
Save stas-dovgodko/b6c0ece8b38519533cd6e12da8452db9 to your computer and use it in GitHub Desktop.
let proxy = require('openhab-proxy-pattern');
proxy.bind("GF_Office_Co2", "Netatmo_Indoor_Co2")
.update(function(value) {
const ppm = parseInt(value);
return (typeof value == 'string') ? `${ppm} ppm` : undefined;
});
proxy.bind("GF_Office_Humidity", "Netatmo_Indoor_Humidity")
.update(function(value) {
const v = parseInt(value);
return (typeof value == 'string') ? `${v} %` : undefined;
});
proxy.bind("GF_Office_Temperature", "Netatmo_Indoor_Temperature")
.update(function(value) {
const v = parseInt(value);
return (typeof value == 'string') ? `${v} °C` : undefined;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment