Closed mjf2708 closed 4 years ago
I think the issue occurs here: `
function DevGenericSensorT(data) {
var ptrn = /([0-9]+(?:\.[0-9]+)?) ?(.+)/;
var res = data.Data.match(ptrn).slice(1);
var value = res[0];
var suffix = res[1];
` which appears to be dropping the minus ('-') sign on a negative value. However, I don't understand regex-type patterns to be able to confirm / change this.
fixed in the git, will be soon reposted as .deb and .spk
I'm using MDAH version 0.2.39 with Domoticz 4.9700 on a RPi 2B with Stretch Lite.
I have a custom sensor in Domoticz, which shows sun altitude. After sunset, this has negative values, but these are showing as positive in MDAH (and Imperihome). E.g., In Domoticz: Sun altitude -54.5° In MDAH:
{"id":"338","name":"Sun altitude","type":"DevGenericSensor","room":"Utility","params":[{"key":"Value","value":"54.5","unit":"°","graphable":"true"}]}