Giter VIP home page Giter VIP logo

homebridge-http-temperature-humidity's Introduction

homebridge-http-temperature-humidity

A HTTP(S) temperature and humidity accessory for Homebridge.

Installation

  1. Install homebridge using: npm install -g homebridge
  2. Install this plugin using: npm install -g homebridge-httptemperaturehumidity
  3. Update your configuration file. See sample-config.json in this repository for a sample.

Configuration

Sample configuration:

"accessories": [
    {
        "accessory": "HttpTemphum",
        "name": "Living Room Weather",
        "url": "http://192.168.1.210/weather",
        "httpMethod": "GET",
        "humidity": true,
        "cacheExpiration": 60
    }
]

Set humidity to false if your HTTP endpoint doesn't include a humidity reading.

The cacheExpiration option specifies, in seconds, how long HTTP responses will be stored in the in-memory cache.


Your HTTP(S) endpoint should produce JSON that looks like this:

{
    "temperature": 25.8,
    "humidity": 38
}

This plugin only acts as an interface between a web endpoint and Homebridge. You will still need some dedicated hardware to expose the web endpoints with the temperature and humidity information. In my case, I used a simple NodeMCU board and a DHT11 (or DHT22). Check my other repo for the NodeMCU code.

homebridge-http-temperature-humidity's People

Contributors

b2un0 avatar dantheman827 avatar kemathy avatar lucacri avatar matiaskorhonen avatar ohlzon avatar oskarrn93 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

homebridge-http-temperature-humidity's Issues

Difference between Home Humidity reported in Home app

Hi,

Great work!

There is a problem concerning humidity reading in iOS Home app.
Even though the Sensor Humidity is correctly reported, the general Room humidity is stuck at 82%.

img_2485

The attached screenshot shows the issue. Home humidity is wrongly reported as 82% ,and sensor humidity correctly at 64% .

HomeBridge Config:

  "accessories": [
    {
        "accessory": "HttpTemphum",
        "name": "Living Room Weather",
        "url": "http://nms.home/scripts/get_sensor.py",
        "httpMethod": "GET",
        "humidity": true,
        "cacheExpiration": 60
    }

HTTP Service output:

curl http://nms.home/scripts/get_sensor.py
{
    "humidity": "64.10",
    "temperature": "18.70"
}

HomeKit Log output:

 systemctl status homebridge.service
● homebridge.service - Node.js HomeKit Server
   Loaded: loaded (/usr/lib/systemd/system/homebridge.service; enabled; vendor preset: disabled)
   Active: active (running) since Sun 2018-02-18 12:36:58 EET; 29min ago
 Main PID: 2319 (homebridge)
    Tasks: 14 (limit: 1165)
   CGroup: /system.slice/homebridge.service
           ├─2319 homebridge
           ├─2356 sudo -n journalctl -o cat -n 500 -f -u homebridge
           └─2358 journalctl -o cat -n 500 -f -u homebridge

Feb 18 12:53:23 archie homebridge[2319]: [2/18/2018, 12:53:23 PM] [Living Room Weather] { humidity: '63.50', temperature: '18.60' }
Feb 18 12:54:08 archie homebridge[2319]: [2/18/2018, 12:54:08 PM] [Living Room Weather] HTTP power function succeeded!
Feb 18 12:54:08 archie homebridge[2319]: [2/18/2018, 12:54:08 PM] [Living Room Weather] <Buffer 7b 0a 20 20 20 20 22 68 75 6d 69 64 69 74 79 22 3a 20 22 36 33 2e 35 30 22 2c 0a 20 2
Feb 18 12:54:08 archie homebridge[2319]: [2/18/2018, 12:54:08 PM] [Living Room Weather] { humidity: '63.50', temperature: '18.60' }
Feb 18 12:58:40 archie homebridge[2319]: [2/18/2018, 12:58:40 PM] [Living Room Weather] HTTP power function succeeded!
Feb 18 12:58:40 archie homebridge[2319]: [2/18/2018, 12:58:40 PM] [Living Room Weather] <Buffer 7b 0a 20 20 20 20 22 68 75 6d 69 64 69 74 79 22 3a 20 22 36 34 2e 30 30 22 2c 0a 20 2
Feb 18 12:58:40 archie homebridge[2319]: [2/18/2018, 12:58:40 PM] [Living Room Weather] { humidity: '64.00', temperature: '18.70' }
Feb 18 13:03:04 archie homebridge[2319]: [2/18/2018, 1:03:04 PM] [Living Room Weather] HTTP power function succeeded!
Feb 18 13:03:04 archie homebridge[2319]: [2/18/2018, 1:03:04 PM] [Living Room Weather] <Buffer 7b 0a 20 20 20 20 22 68 75 6d 69 64 69 74 79 22 3a 20 22 36 33 2e 38 30 22 2c 0a 20 20
Feb 18 13:03:04 archie homebridge[2319]: [2/18/2018, 1:03:04 PM] [Living Room Weather] { humidity: '63.80', temperature: '18.70' }

Updating of humidity is not working

I tried this and at first it seemed to work fine, than I noticed that the humidity is not updated in my app on iOS. It always appeared to show some value for a split-second at refresh and then went back to zero.

I fixed this by adding the following line under this.temperature = Number( info.temperature );:

this.humidity = Number( info.humidity);

MicroPython ESP8266 Endpoint

Hello, thank you for this awesome homebridge plugin. It is working really well. Just wanted to let you know that I "ported" your lua ESP8266 endpoint to to MicroPython, this is the code if you are interested in any way. Feel free to close this issue right away:

boot.py

import uos, machine
import gc
def do_connect():
    import network
    sta_if = network.WLAN(network.STA_IF)
    if not sta_if.isconnected():
        print('connecting to network...')
        sta_if.active(True)
        sta_if.connect('<YOUR_SSID>', '<YOUR_PASSWORD>')
        while not sta_if.isconnected():
            pass
    print('network config:', sta_if.ifconfig())
gc.collect()
do_connect()

main.py:

import machine
import dht
import time
import socket
import utime

d = dht.DHT22(machine.Pin(4))
time.sleep(2)
d.measure()

addr = socket.getaddrinfo('0.0.0.0', 80)[0][-1]

s = socket.socket()
s.setblocking(True)
s.bind(addr)
s.listen(1)
print('listening on', addr)
currenttime = utime.ticks_ms()
lasttime = utime.ticks_ms()
while True:
    cl, addr = s.accept()
    currenttime = utime.ticks_ms()
    print(utime.ticks_diff(currenttime,lasttime))
    if utime.ticks_diff(currenttime,lasttime) >= 2500:
      d.measure()
    print('client connected from', addr)
    cl_file = cl.makefile('rwb', 0)
    while True:
        line = cl_file.readline()
        if not line or line == b'\r\n':
            break
    cl.send("HTTP/1.0 200 OK\r\nContent-Type: application/json\r\nCache-Control: private, no-store\r\n\r\n{\"temperature\": ")
    cl.send(str(d.temperature()-1.4))
    cl.send(", \"humidity\": ")
    cl.send(str(d.humidity()))
    cl.send("}")
    cl.close()
    lasttime = utime.ticks_ms()

4 seconds delay

Hi,

I have installed the homebridge software on my RaspberryPi and configured 2 http-temphum devices. It takes 4 seconds for every http request to get the temperature and humidity from a sql-Database over a php-script. Is this normal or is there a way to reduce this time?

bildschirmfoto 2016-10-06 um 20 57 07
bildschirmfoto 2016-10-06 um 20 56 52

Temperature below 0degrees

Plugin not working if temperature went below 0degrees, would be nice to see fix. Otherwise it's great plugin.

Badges in iOS are showing up Inactive

Hi,

The humidity and temp-sensor is showing up inactive (dark gray) in iOS. They've got the correct values but shown dark/inactive. Is there a configuration error?

HTTP Failure

Hi, I have a problem to get data to homebridge. I still get messages HTTP Failure. I don't know where is a problem, could somene help me? I tried everything. Here is part of my code from arduino (which works without problem)

 EthernetClient client = server.available();
  if(client){
    Serial.println("new client");
    boolean currentLineIsBlank = true;
    while(client.connected()){
      if(client.available()){
        char c = client.read();
        Serial.write(c);

        if(c == '\n' && currentLineIsBlank){
          client.println("HTTP/1.1 200 OK");
          client.println("Content-Type: application/json");
          client.println("Connection: close");  // the connection will be closed after completion of the response
          client.println("Refresh: 5");  // refresh the page automatically every 5 sec
          client.println();
          client.println(F("{"));
          client.print(F("\t\"temperature\": "));
          client.print(temperature);
          client.println(F(","));
          client.print(F("\t\"humidity\": "));
          client.println(humidity);
          client.println(F("}"));
          
      
          break;
        }
        if (c == '\n') {
          // you're starting a new line
          currentLineIsBlank = true;
        } else if (c != '\r') {
          // you've gotten a character on the current line
          currentLineIsBlank = false;
        }
      }
    }
     delay(1);
    // close the connection:
    client.stop();
"accessories": [
        {
                "accessory": "HttpTemphum",
                "name": "Office Temperature",
                "url": "http://192.168.1.170",
                "http_method": "GET",
                "humidity": true,
                "cacheExpiration": 60
        }
    ]

Thank you in advance.

DOESNT WORK AT ALL

I have my config.json :

{
    "bridge": {
        "name": "Homebridge",
        "username": "CC:22:3D:E3:CE:30",
        "port": 51826,
        "pin": "031-45-154"
    },
    "description": "This is an example configuration file with one fake accessory and one fake platform. You can use this as a template for creating your own configuration file containing devices you actually own.",
    "ports": {
        "start": 52100,
        "end": 52150,
        "comment": "This section is used to control the range of ports that separate accessory (like camera or television) should be bind to."
    },
    "accessories": [
        {
            "accessory": "HttpTemphum",
            "name": "Living Room Weather",
            "url": "http://192.168.1.24/dht",
            "httpMethod": "GET",
            "humidity": true,
            "cacheExpiration": 60
        }
    ],
    "platforms": [
        
    ]
}

and my result of the adress :
image

and this doesn't work at all... i have this when i reload my Home App on my iPhone :

[Living Room Weather] HTTP success ({"method":"GET","uri":"http://192.168.1.24/dht","params":null,"options":{"accept":"application/json"}})

but temp and humidity is still at 0 and when i do console.log on res.body it still gave me {}

get temp an humidity fron esp easy with bme280

hello,

I'm trying to get temp and humidity from an esp8266 with esp easy and bme280 sensor.
when i use this: http://esp easy/json?tasknr=1
I have as result
{
"TaskName": "Temperature and Humidity",
"Temperature": 19.06,
"Humidity": 51.57,
"Pressure": 1010.49
}

how can i modify the request to match
{
"Temperature": 19.06,
"Humidity": 51.57,
}

or can you adapt you module to deal with it ?

thank you

Too frequent http requests

Currently, I see http requests every 30 seconds. Is there any way to reduce the load on my homebridge installation? My sensors only pull data every 5 minutes. Would I need to modify the sendimmediatelyparameter, and if so what would that be?

Still "no reply" with negative temperature

Hello,
with " [12/17/2016, 6:36:01 PM] [Esterno] { temperature: -0.1, humidity: 92 }" still have "no reply" from sensor.

I have manually updated /usr/local/lib/node_modules/homebridge-httptemperaturehumidit/index.js

Maybe my update procedure is wrong?

Request - Dust / Air Quality

Hi, big THX for this great piece of code, it works like a charm!

Ist it possible to integrate also this sensors in the lua/mcu and then in the homebridge (works this with AppleHomekit?)?

  1. Dust sensor e.g. ppm
    https://www.sharpsde.com/products/optoelectronic-components/model/GP2Y1012AU0F/

  2. Air Quality eg. CO2 concentrtion

https://www.google.ch/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=0ahUKEwjwy7O17p3PAhUDCBoKHcFbD-sQFgghMAA&url=https%3A%2F%2Fwww.olimex.com%2FProducts%2FComponents%2FSensors%2FSNS-MQ135%2Fresources%2FSNS-MQ135.pdf&usg=AFQjCNF2zcpNVxoAFgjLjcQWbAep7cpm4Q

Big THX
neo

Temperature sensor without humidity

Also I'd like to add some temperature sensor that don't have (and doesn't need) humidity sensors.
I think that Homebridge could recognize that it doesn't have humidity sensor if server output is not:

{"temperature": 24,"humidity": 40}

but just:

{"temperature": 24}

Adding "humidity": false did not help

0 degrees all the time

I have set up a web server that shows this: { "Temperature": 18.31 }

And I have set up this Homebridge plugin but the home app on my phone always shows 0 degrees.
Here the output when running homebridge:
[2018-4-12 17:45:54] [Living Room Weather] HTTP power function succeeded! [2018-4-12 17:45:54] [Living Room Weather] <Buffer 20 7b 20 22 54 65 6d 70 65 72 61 74 75 72 65 22 3a 20 31 38 2e 33 31 20 7d 20> [2018-4-12 17:45:54] [Living Room Weather] { Temperature: 18.31 }

I don't have a connection error, because when I had one then the whole Homebridge crashed (I thought it is fixed?). What can the problem be?

Humidity calculates to zero

Calculation of Humidity shows Zero. Reading from DHT11 OK and website JSON output is present and correct.

img_cc7373e9efbe-1

config file:

          {
            "accessory": "HttpTemphum",
            "name": "Garage",
            "humidity": "true",
            "url": "http://192.168.1.123/garage",
            "sendimmediately": "",
            "http_method": "GET"
            },

Website JSON output:

{
"temperature": 8.00,
"humidity": 34.00
}

Ive tried changing the temp and hum outputs to being in quotes, changed the order, tried without floating value, nothing changed the fact that the home kit reports the humidity is Zero.

version bump

hey,

the latest fix with caching for requests and exception handling is only in master.

Arduino Sensor

Hello man,
Today i use the raspberry pi with homebridge and arduino with sensors, how i can send the temperature and humidity by http to homebridge on raspberry pi?

can't remove decimal

Home app always showing decimals even when the temp value has no decimals.
I changed the json from the sensor to send integer values but home app still shows 23.0 C.

How can I remove decimals in temp value?

json: {"temperature":23,"humidity":56}

asset

example for "weather" page neaded

Can you give me an example how the /weather page (given in the url-parameter) has to look like? I would like to create my own values and send them to homebridge using this module.... thank you :)

Two accessories in config.json?

I am getting some strange readings when I use two accessories in the same config.json. Can I have two?

 {
                "accessory": "HttpTemphum",
                "name": "Temp HT",
                "url": "http://10.0.xxx.x2/weather.php",
                "http_method": "GET",
                "humidity": false
        },
        {
                "accessory": "HttpTemphum",
                "name": "Temp LV",
                "url": "http://10.0.xxx.x1/weather.php",
                "http_method": "GET",
                "humidity": false
        }

here are both of the weather.php results:

{ "temperature":70.7, "humidity": 75 }

{ "temperature":78.26, "humidity": 75 }

Homebridge crashes if not reacheble (eg. not connected the luaMCU)

Hi,
got this message after starting homebridge with deconnected LUA/MCU.

`/usr/local/lib/node_modules/homebridge-httptemperaturehumidity/node_modules/sync-request/index.js:31
throw new Error(response.error.message || response.error || response);
^

Error: connect EHOSTUNREACH 192.168.1.119:80
at doRequest (/usr/local/lib/node_modules/homebridge-httptemperaturehumidity/node_modules/sync-request/index.js:31:11)
at Object.HttpTemphum.getState (/usr/local/lib/node_modules/homebridge-httptemperaturehumidity/index.js:51:12)
at emitTwo (events.js:100:13)
at emit (events.js:185:7)
at Characteristic.getValue (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Characteristic.js:120:10)
at Bridge. (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:587:20)
at Array.forEach (native)
at Bridge.Accessory._handleGetCharacteristics (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:554:8)
at emitThree (events.js:110:13)
at HAPServer.emit (events.js:188:7)
pi@raspberrypi ~/.homebridge $ `

any idea?

thx neo

Connection Refused of Backend Server results in complete homebridge crash

Error: connect ECONNREFUSED 127.0.0.1:3000
at doRequest (/usr/local/lib/node_modules/homebridge-httptemperaturehumidity/node_modules/sync-request/index.js:31:11)
at Object.HttpTemphum.getState (/usr/local/lib/node_modules/homebridge-httptemperaturehumidity/index.js:51:12)

accessory could just set "not available" instead of full crash

max humidity 200

you set the max humidity to 200 (why?).
my json web service from DHT22 Sensor response 34 for humidity, but the Apple Home App says 17 (34 / 2).

if i change the max value from 200 to 100 everything shows correct in the apple home app.

should fix this?

.setProps({ minValue: 0, maxValue: 200 })

0.0.8: SyntaxError: missing ) after argument list

Feb 09 17:06:45 DietPi node[10375]: ERROR LOADING PLUGIN homebridge-http-temperature-humidity:
Feb 09 17:06:45 DietPi node[10375]: SyntaxError: missing ) after argument list
Feb 09 17:06:45 DietPi node[10375]: at exports.runInThisContext (vm.js:53:16)
Feb 09 17:06:45 DietPi node[10375]: at Module._compile (module.js:374:25)
Feb 09 17:06:45 DietPi node[10375]: at Object.Module._extensions..js (module.js:405:10)
Feb 09 17:06:45 DietPi node[10375]: at Module.load (module.js:344:32)
Feb 09 17:06:45 DietPi node[10375]: at Function.Module._load (module.js:301:12)
Feb 09 17:06:45 DietPi node[10375]: at Module.require (module.js:354:17)
Feb 09 17:06:45 DietPi node[10375]: at require (internal/module.js:12:17)
Feb 09 17:06:45 DietPi node[10375]: at Plugin.load (/opt/node/lib/node_modules/homebridge/lib/plugin.js:65:22)
Feb 09 17:06:45 DietPi node[10375]: at Server.<anonymous> (/opt/node/lib/node_modules/homebridge/lib/server.js:70:14)
Feb 09 17:06:45 DietPi node[10375]: at Array.forEach (native)

Won't update my temperature, never go below 0 celsius

Hello!

My temperature never go below 0 celsius. But in my Logs and on the ESP device I can see the -4 degree.

This is my log:

[12/17/2018, 6:55:27 AM] [Kinti időjárás] HTTP power function succeeded! [12/17/2018, 6:55:27 AM] [Kinti időjárás] <Buffer 7b 0a 20 22 74 65 6d 70 65 72 61 74 75 72 65 22 3a 2d 34 2c 0a 20 22 68 75 6d 69 64 69 74 79 22 3a 39 32 0a 7d> [12/17/2018, 6:55:27 AM] [Kinti időjárás] { temperature: -4, humidity: 92 }

And that is my Config:

{ "accessory": "HttpTemphum", "name": "Kinti időjárás", "url": "http://10.0.1.36/temperature", "humidity": true, "http_method": "GET", "cacheExpiration": 60 }

What do you think, what is wrong with it?

Weather.json

This is my code on arduino:
` delay(2000);
float h = dht.readHumidity();
float t = dht.readTemperature();
if (isnan(h) || isnan(t)) {
Serial.println("Failed to read from DHT sensor!");
break;
return;
}
Serial.print("Humidity: ");
Serial.print(h);
Serial.print("Temperature: ");
Serial.print(t);
Serial.print(" *C ");

          client.println("{\"temperature\": ");
          client.println(t);
          client.println(",\"humidity\": ");
          client.println(h);
          client.println("}");`

What is the problem?

Full Code:

`#include <SPI.h>

include <Ethernet.h>

include "DHT.h"

byte mac[] = { 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB }; //physical mac address
byte ip[] = { 192, 168, XX, XX }; // ip in lan
byte gateway[] = { 192, 168, XX, XX }; // internet access via router
byte subnet[] = { 255, 255, 255, 0 }; //subnet mask
EthernetServer server(80); //server port

String readString;
int p1 = 30, p2 = 13, p3 = 31, menu = 0;

//DHT

define DHTPIN 2

define DHTTYPE DHT11

DHT dht(DHTPIN, DHTTYPE);
//////////////////////

void setup() {
//enable serial data print
Serial.begin(9600);
//DHT
dht.begin();
//Pinos de Saida
pinMode(30, OUTPUT); //pin selected to control
pinMode(31, OUTPUT); //pin selected to control
pinMode(13, OUTPUT); //pin selected to control
//start Ethernet
Ethernet.begin(mac, ip, gateway, gateway, subnet);
server.begin();
}

void loop() {
// Create a client connection
EthernetClient client = server.available();
if (client) {
while (client.connected()) {
if (client.available()) {
char c = client.read();

    //read char by char HTTP request
    if (readString.length() < 100) {

      //store characters to string
      readString += c;
      //Serial.print(c);
    }

    //if HTTP request has ended
    if (c == '\n') {

      ///////////////
      Serial.println(readString); //print to serial monitor for debuging

      client.println("HTTP/1.1 200 OK"); //send new page
      client.println("Content-Type: text/html");
      client.println();

      client.println("<HTML>");
      client.println("<HEAD>");
      client.println("<TITLE>Arduino My Homie</TITLE>");
      client.println("</HEAD>");
      client.println("<BODY>");

      client.println("<H1>Simple Arduino button PIN 30 e 13</H1>");

      client.println("<a href=\"/?o1\">ON</a>");
      client.println("<a href=\"/?f1\">OFF</a>");

      client.println("<a href=\"/?o2\">ON</a>");
      client.println("<a href=\"/?f2\">OFF</a>");

      client.println("<a href=\"/weather\">weather</a>");

      client.println("</BODY>");
      client.println("</HTML>");


      ////////////////////// control Menu
      if (readString.startsWith("GET /?o1")) {
        menu = 1;
      } else if (readString.startsWith("GET /?f1")) {
        menu = 2;
      } else if (readString.startsWith("GET /?o2")) {
        menu = 3;
      } else if (readString.startsWith("GET /?f2")) {
        menu = 4;
      } else if (readString.startsWith("GET /weather")) {
        menu = 5;
      }

      ///////////////////// control Switch
      switch (menu) {
        ///////////////////// control arduino pin 30
        case 1 :
          digitalWrite(p1, true);    // set pin 30 high
          Serial.println("Bedroom Lamp On");
          break;
        case 2  :
          digitalWrite(p1, false);    // set pin 30 low
          Serial.println("Bedroom Lamp Off");
          break;
        ///////////////////// control arduino pin 13
        case 3  :
          digitalWrite(p2, true);    // set pin 13 high
          Serial.println("Living Room Lamp On");
          break;
        case 4  :
          digitalWrite(p2, false);    // set pin 13 low
          Serial.println("Living Room Lamp Off");
          break;
        ///////////////////// control arduino pin XX
        case 5  :
          Serial.println("Pegando Temp e Humd");

          delay(2000);
          float h = dht.readHumidity();
          float t = dht.readTemperature();
          if (isnan(h) || isnan(t)) {
            Serial.println("Failed to read from DHT sensor!");
            break;
            return;
          }
          float hic = dht.computeHeatIndex(t, h, false);
          Serial.print("Humidity: ");
          Serial.print(h);
          Serial.print("Temperature: ");
          Serial.print(t);
          Serial.print(" *C ");

          client.println("{\"temperature\": ");
          client.println(t);
          client.println(",\"humidity\": ");
          client.println(h);
          client.println("}");
          break;
      }
      //clearing string for next read
      delay(1);
      //stopping client
      client.stop();
      readString = "";
      menu = 0;

    }
  }
}

}
}`

Add air pressure?

Hello, this is not an issue but a feature request:

is possible to add air pressure and why not wind speed and direction?

Not working with negative value

I'm using two accessories in configuration file, one for internal and one for external
the external is now -0.7 degree, and homebrige say that the device is not responding ...

this is the json generated file:

{
"temperature": -0.7,
"humidity": 91
}

Faking the http results

I have a DS18b30 sensor. If I write some code on a web server accessible on my network that basically generates the following json file example...

{
"temperature": 27.3,
"humidity": 74.6
}

Would this plugin work with the getting the details back and displayed in my HomeKit app of choice?

Decimal places

Hello,

is it possible to add decimal places for humidity and temperature? I got simple server returning http json:

{
	"temperature": 27.9,
	"humidity": 46.4
}

But humidity is rounded for whole number and the temperature too even though it shows that it has one decimal. Sorry for the arrows, I created this picture for another opened issue here.
IMG_7365

Of course the setup:

       {
            "accessory": "HttpTemphum",
            "name": "Pařníček - Teplota",
            "url": "http://192.168.1.110/hTemperatureAndHumidity",
            "sendimmediately": "",
            "http_method": "GET",
            "humidity": true,
            "cacheExpiration": 60
        }

Thanks,
Regards,
Petr Sourek

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.