GithubHelp home page GithubHelp logo

supereg / homebridge-http-temperature-sensor Goto Github PK

View Code? Open in Web Editor NEW
30.0 6.0 18.0 273 KB

Http temperature sensor for Homebridge: https://github.com/homebridge/homebridge

License: ISC License

JavaScript 100.00%
homebridge temperature-sensor http hap homekit javascript notifications homebridge-plugin homebridge-http mqtt

homebridge-http-temperature-sensor's People

Contributors

daberlin avatar dependabot[bot] avatar doldis77 avatar supereg 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

homebridge-http-temperature-sensor's Issues

This plugin slows down Homebridge

Describe the bug
An error in the log files. Slows homebridge

Expected behavior
No errors

Version (output of npm list -g homebridge homebridge-http-temperature-sensor)

  • homebridge: 1.3.4
  • homebridge-http-temperature-sensor: 1.0.9

Configuration

{
            "accessory": "HTTP-TEMPERATURE",
            "name": "media",
            "getUrl": "http://192.168.0.21:2025/getSystemData",
            "statusPattern": "(\\d\\d\\.\\d(?=,\"minDamper\":0,\"motion\":0,\"motionConfig\":1,\"name\":\"M))",
            "pullInterval": "900000",
            "_bridge": {
                "username": "0E:9E:99:11:3A:93"
            }
        },
        {
            "accessory": "HTTP-TEMPERATURE",
            "name": "office",
            "getUrl": "http://192.168.0.21:2025/getSystemData",
            "statusPattern": "(\\d\\d\\.\\d(?=,\"minDamper\":0,\"motion\":0,\"motionConfig\":1,\"name\":\"St))",
            "pullInterval": "900000",
            "_bridge": {
                "username": "0E:9E:99:11:3A:93"
            }
        },

Additional context
Add any other context about the problem here.
[13/04/2021, 5:30:49 pm] [homebridge-http-temperature-sensor] This plugin slows down Homebridge. The read handler for the characteristic 'Current Temperature' didn't respond at all!. Please check that you properly call the callback! See https://git.io/JtMGR for more info.

Accessory cannot be added in Home

Logs show successful configuration:

Jun 12 04:05:18 raspberrypi homebridge[27987]: [2019-6-12 04:05:18] [Pi Zero Temp Sensor] Initializing HTTP-TEMPERATURE accessory...

Jun 12 04:06:14 raspberrypi homebridge[27987]: [2019-6-12 04:06:14] [Pi Zero Temp Sensor] Temperature is currently at 24.5

Config:

{
      "accessory": "HTTP-TEMPERATURE",
      "name": "Pi Zero Temp Sensor",
      "getUrl": "http://192.168.0.177:8000/",
      "debug":true,
      "pullInterval":10000
    }

When trying to add the accessory in the Home app, nothing shows up as available. Ruled out device/bridge issues by removing/re-adding my IP cams

Temperature precision

Hi,

I'm loading temperature from my local server and successfully added the accessory to homebridge.

However a temperature of 10.3125 will display as 10.5on my iPhone.

I though I could change the statusPattern to : (-?[0-9]{0,3}(\.[0-9][0-9])?) so I could get a 2 digits precision (10.31) but this was uneffective.

Do you have any tips for that?

thanks,

Sébastien

Property 'getUrl' is required when using MQTT

Describe the bug
My understanding is getUrl is only used for the 'pull' way. But when I config MQTT, it still ask for getUrl:

[1/4/2022, 11:30:05 PM] [BedRoom] Initializing HTTP-TEMPERATURE accessory...
[1/4/2022, 11:30:05 PM] [BedRoom] Property 'getUrl' is required!
[1/4/2022, 11:30:05 PM] [BedRoom] Aborting...
[1/4/2022, 11:30:05 PM] [BedRoom] Accessory HTTP-TEMPERATURE returned empty set of services; not adding it to the bridge.

If I give it a getUrl, it can connect to the broker but it still getting the value from getUrl instead of MQTT

[1/4/2022, 11:32:18 PM] [BedRoom] Initializing HTTP-TEMPERATURE accessory...
[1/4/2022, 11:32:18 PM] [BedRoom] MQTT connecting to broker...
[1/4/2022, 11:32:18 PM] [BedRoom] MQTT Connected!
[1/4/2022, 11:32:18 PM] [BedRoom] Subscribing to existing topic: BedRoom/temperature
[1/4/2022, 11:32:18 PM] [BedRoom] MQTT successfully subscribed to topic 'BedRoom/temperature. Granted [{"topic":"BedRoom/temperature","qos":1}]'

Expected behavior
Expected the getUrl property is optional or will be ignored if mqtt config is present.

To Reproduce

  1. Setup mqtt server
  2. Connect to it using below config

Version (output of npm list -g homebridge homebridge-http-temperature-sensor)

  • homebridge: v1.3.9
  • homebridge-http-temperature-sensor: v1.0.10

Configuration

{
    "accessory": "HTTP-TEMPERATURE",
    "name": "BedRoom",
    "unit": "celsius",
    "statusCache": "5000",
    "mqtt": {
        "host": "127.0.0.1",
        "port": 1883,
        "subscriptions": [
            {
                "topic": "BedRoom/temperature",
                "characteristic": "CurrentTemperature",
                "messagePattern": "(-?[0-9]{1,3}(.[0-9]{1,3}))"
            }
        ]
    }
}

Config with Ambient Weather Station API

Thanks so much for this great plugin!
I know Ambient Weather stations are pretty popular, so I though I would post my config file for their APIs below:
Grab both API and Application API keys from: https://ambientweather.net/account

{
            "accessory": "HTTP-TEMPERATURE",
            "name": "Temperature Sensor",
            "getUrl": {
                "url": "https://api.ambientweather.net/v1/devices?applicationKey=INSERTAPPLICATIONAPIKEYHERE&apiKey=INSERTAPIKEYHERE",
                "method": "GET"
            },
            "pullInterval": 90000,
            "statusPattern": "(?<=.tempf.:)(-?[0-9]{1,3})",
            "unit": "fahrenheit",
            "debug": "true"
        }

If the API temp ends with a .0, the API truncates the decimal and default expression returns an error. Thus, I have shortened the statuspattern/regularexpression to just return whole numbers. One can also replace the .tempf. with .tempinf. for the indoor temperature.

Taking temperature from the body

Hello,
I have a small problem with taking the temperature from my device. I am trying to configure it so that it downloads data from the blebox sensor, after http I get such data
{"tempSensor":{"sensors":[{"type":"temperature","id":0,"value":2118,"trend":2,"state":2,"elapsedTimeS":1055}]}}
I try to get the temperature with a regular expression but it doesn't work for me, what am I doing wrong? My configuration:

{"accessory": "HTTP-TEMPERATURE", "name": "Temperature Sensor", "statusPattern": "/((?<=\"value\":)[0-9]{2})/", "getUrl": "http://192.168.1.204/api/tempsensor/state" }

thermostat Plugin for Honeywell

Hey,

I see you do a lot of typescript, what are the chances of creating a HomeBridge plugin for Honeywell lyric thermostats?

How to configure the The 'push' way:

Is your feature request related to a problem? Please describe.
How can I configure the push way. Do I need the get address? Can I configure the port?

thanks
Describe the solution you'd like
A clear and concise description of what you want to happen.

Additional context
Add any other context about the feature request here.
The

Last version not working

Hey. What has changed in the latest version? The plugin has stopped working, gives an error:
f905a2bf-312b-4c6a-ac2b-e40a22790fd6

{ "accessory": "HTTP-TEMPERATURE", "name": "iKettle 2.0t", "pullInterval": 5000, "getUrl": "http://10.0.0.100:2080/api/10.0.0.13/raw/temperature" },

I did not change my configuration. By reference from the configuration, I still see the temperature.

e8dd7fc6-650a-4ef8-b335-709d65d5144e

Expanded temperature range

Is your feature request related to a problem? Please describe.

By default it expects the http server to return the temperature as a float ranging from 0-100 (step 0.1).

Since I want to use this plugin to read the Hotend temperature of my 3D printer, it would be nice to have values greater than 100 supported. Would this be possible or is this a limitiation introduced by HomeKit itself?

Describe the solution you'd like

I would like this plugin to support temperature values of up to 300. Possibly for some users negative values would also be relevant.

Additional context

Can't get temperature value

Hello,

I'm trying to get the temperature value from my myStrom motion sensor.
Here's the API > https://api.mystrom.ch/?version=latest#95d8103e-db16-4383-b141-8e93afef0bbd
and here's my code:

{ "accessory": "HTTP-TEMPERATURE", "name": "Bath Temp", "getUrl": { "url": "http://192.168.1.241/api/v1/sensors", "method": "GET", "statusPattern": "\"temperature\":([0-9]{2})", "pullInterval": 30, "debug": true }
Not sure if my pattern is correct.
I have no error logs to share, there's none and debug on is not making any difference.

Thanks for helping :)
Zolpho

Get Temperature failed

First: Sorry for my bad english.

I have a temperature-sensor, which has a metrics-site for a prometheus exporter.

My Homebridge-Config:

        {
            "accessory": "HTTP-TEMPERATURE",
            "name": "Schlafzimmer",
            "unit": "celsius",
            "getUrl": {
                "url": "http://10.23.43.7/metrics",
                "method": "GET",
                "statusPattern": "esp_bme_temperature (-?[0-9]{1,3}(.[0-9]))"
            }
        }

Behind the URL is:

# HELP esp_bme_temperature Current BME280 Temperature
# TYPE esp_bme_temperature gauge
esp_bme_temperature 22.51

The senor in HomeKit shows me 1,0°C.
I have checked the regex here: https://regex101.com/ -> Everything fine (i think).
Where is my mistake?

Thanks
Jan

Multiple sensors

Is it possible to use this plugin for many temperature sensors?

Anyway to pass words through instead of numbers?

I’m trying to figure out if it’s possible to pass a word through instead of a number value? I tried setting the statusPattern regex as "statusPattern": "(Off|Running)" which i thought might enable this but it didn’t seem to have any affect. Is this a possibility? Thank you

Feature request Eve app history

Hi,
I am testing out the plugin, and everything works.
Are you planning on adding history data (the eve app displays a history graph)?
I see there is a project that adds the required functionality.
fakegato-history

Consistency with units?

The temperature displayed in HomeKit is always Celsius.

For maximum functionality, it would be preferable to have an additional configuration option, maybe "displayUnit," that would control what units are supplied to HomeKit. So, "unit" would tell the plugin whether it's reading C or F from the source, and "displayUnit" would tell the plugin whether to send C or F values to HomeKit.

At the very least, if "unit" is set to "fahrenheit" then those units should be passed straight to HomeKit. Less functional, but at least consistent.

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.