Negative number in custom sensor

Easy to use, 100% Lua-based event scripting framework.

Moderator: leecollings

Post Reply
roblom
Posts: 408
Joined: Wednesday 26 February 2014 15:28
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: the Netherlands
Contact:

Negative number in custom sensor

Post by roblom »

I'm working on a dzVents script that calculates my energy costs. But I'm running into a problem with negative numbers. Is it correct that a custom sensor can't handle negative numbers?
User avatar
waltervl
Posts: 5859
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Negative number in custom sensor

Post by waltervl »

A custom sensor can handle negative values.
Try it manually with a api call
/json.htm?type=command&param=udevice&idx=IDX&nvalue=0&svalue=VALUE
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
willemd
Posts: 650
Joined: Saturday 21 September 2019 17:55
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.1
Location: The Netherlands
Contact:

Re: Negative number in custom sensor

Post by willemd »

Already explained to you on github
https://github.com/domoticz/domoticz/issues/5544
Create a COUNTER device for this. They can now handle negative values.
With the edit button they can be configured. Choose CUSTOM and then defined units, label etc.
roblom
Posts: 408
Joined: Wednesday 26 February 2014 15:28
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: the Netherlands
Contact:

Re: Negative number in custom sensor

Post by roblom »

Thank you. The problem was due to something else indeed.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest