Comments (4)
Any error messages which are produced by this plugin?
try a pattern like this "statusPattern": "\"value\":([0-9]{2})"
.
Note that I removed the slashes at the beginning and the end since those are not needed.
The plugin extracts the value contained in the first group (configurable). As you just want the number you just need to but the number matching in brackets so only the numbers get extracted.
from homebridge-http-temperature-sensor.
Any error messages which are produced by this plugin?
try a pattern like this"statusPattern": "\"value\":([0-9]{2})"
.
Note that I removed the slashes at the beginning and the end since those are not needed.
The plugin extracts the value contained in the first group (configurable). As you just want the number you just need to but the number matching in brackets so only the numbers get extracted.
Thanks for answer, when I try my regax I got:
[Temperature Sensor] getTemperature() error occurred while extracting temperature from body: Pattern didn't match (value: '{"tempSensor":{"sensors":[{"type":"temperature","id":0,"value":2118,"trend":2,"state":2,"elapsedTimeS":2209}]}}', pattern: '/\/((?<="value":)[0-9]{2})\//')
When I changed to your suggestion it worked :) Thank you very much
It would be possible to add one or two additional digits after the decimal point, e.g. 21,1 or 21.18 ??
from homebridge-http-temperature-sensor.
... Pattern didn't match ...
Yeah one problem were the leading and trailing slash. And I see now this mistake is also present in the README 😅
In theory yes but in praxis no. The plugin will happily accept those numbers if they are formatted correctly (so there is a decimal point in the input). And the will round it to 0.5 steps (as HomeKit expects it). But it cannot handle it in the format you are currently supplying it (without a decimal point)
from homebridge-http-temperature-sensor.
... Pattern didn't match ...
Yeah one problem were the leading and trailing slash. And I see now this mistake is also present in the README 😅In theory yes but in praxis no. The plugin will happily accept those numbers if they are formatted correctly (so there is a decimal point in the input). And the will round it to 0.5 steps (as HomeKit expects it). But it cannot handle it in the format you are currently supplying it (without a decimal point)
I changed my index.js file and formatted the data there so that it would display correctly. Thanks for the help.
from homebridge-http-temperature-sensor.
Related Issues (18)
- thermostat Plugin for Honeywell HOT 4
- If you're going to support Fahrenheit values from the server, support them for display purposes as well. HOT 2
- Can't get temperature value HOT 1
- Config with Ambient Weather Station API
- Get Temperature failed
- Consistency with units? HOT 3
- How to configure the The 'push' way:
- Multiple sensors HOT 2
- This plugin slows down Homebridge
- Expanded temperature range HOT 1
- Property 'getUrl' is required when using MQTT
- Anyway to pass words through instead of numbers?
- - HomeKit accessory converts temperature value to Celsius automatically via this plugin. HOT 2
- Last version not working HOT 1
- Feature request Eve app history HOT 6
- Accessory cannot be added in Home HOT 1
- Temperature precision HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from homebridge-http-temperature-sensor.