Skip to content

Unofficial NodeJS module to communicate with a Flipr device

Notifications You must be signed in to change notification settings

nikkow/node-flipr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Node Flipr

https://img.shields.io/npm/l/node-flipr.svg

Intro

Flipr devices are used to monitor private and public swimming pools. Node-Flipr is an unofficial NodeJS library used to communicate with them and retrieve their latest metrics.

Usage

Setup

Run the following command in your project to install the latest version of Node-Flipr.

npm install node-flipr --save

Then, all you need is to import this library to start using it:

Javascript

var nodeFlipr = require('node-flipr');
var flipr = new nodeFlipr.Flipr(config);

TypeScript

import { Flipr } from 'node-flipr';

Basic usage

var Flipr = require('node-flipr').Flipr;
var TemperatureUnit = require('node-flipr').TemperatureUnit;
var DisinfectantType = require('node-flipr').DisinfectantType;

var flipr = new Flipr({
  username : "your flipr email address" ,
  password : "your flipr password",
  deviceSerial: "your flipr serial"
})

flipr.getLastMeasure().then(metrics => {
  console.log('--- General information ---');
  console.log('Date: ', metrics.getDate());
  console.log('Battery level (percent): ', metrics.getBatteryLevel());
  console.log('Battery level (raw): ', metrics.getBatteryLevel(true));
  console.log('UV Index: ', metrics.getUVIndex());
  console.log('Cloud coverage (percent): ', metrics.getCloudCoverage());
  console.log('Cloud coverage (raw): ', metrics.getCloudCoverage(true));
  console.log('');
  console.log('--- Water temperature ---');
  console.log('Temperature in Celcius: ', metrics.getTemperature(TemperatureUnit.CELCIUS));
  console.log('Temperature in Fahrenheit: ', metrics.getTemperature(TemperatureUnit.FAHRENHEIT));
  console.log('Temperature in Kelvin: ', metrics.getTemperature(TemperatureUnit.KELVIN));
  console.log('');
  console.log('--- Disinfectant ---');
  console.log('Disinfectant is Chlorine? ', metrics.getDisinfectantType() === DisinfectantType.CHLORINE ? "yes" : "no");
  console.log('Disinfectant is Bromine? ', metrics.getDisinfectantType() === DisinfectantType.BROMINE ? "yes" : "no");
  console.log('Disinfectant is Salt? ', metrics.getDisinfectantType() === DisinfectantType.SALT ? "yes" : "no");
  console.log('Disinfectant deviation: ', metrics.getDisinfectantDeviation(true));
  console.log('Disinfectant deviation variation: ', metrics.getDisinfectantDeviation());
  console.log('');
  console.log('--- PH ---');
  console.log('PH value: ', metrics.getPHValue());
  console.log('PH deviation: ', metrics.getPHDeviation(true));
  console.log('PH deviation variation: ', metrics.getPHDeviation());
})

API Reference

In progress.

About

Unofficial NodeJS module to communicate with a Flipr device

Resources

Stars

Watchers

Forks

Packages

No packages published