Hello,
I wish you an happy christmas.
Any help should be appreciated to solve this "issue".
Thanks by advance
Best regards
Christophe
Environnement :
Version: 2020.1 (build 11839)
Build Hash: 139d994e5-modified
Compile Date: 2020-03-27 06:53:01
dzVents Version: 3.0.1
I use this virtual incremental device
201 VIRTUAL HARDWARE 82201 1 Gaz General Counter Incremental 38.350 m3
Issue :
This script retrieves a bad value
local Appareil = 'Gaz'
local Gaz_previous_value = tonumber(uservariables['Gaz_previous_value'])
-- Si Appareil objet du changement de température et Supervision activée, on rentre dans la boucle de test
if devicechanged[Appareil] then
print ('=========== Début Script Gestion '..Appareil..'===========')
local Gaz_current_value = tonumber(devicechanged[Appareil]) -- Conso relevée
-- On loggue la conso N-1 dans le journal
print ('Conso Gaz N-1 '..Appareil..' : '..Gaz_previous_value)
-- On loggue la conso N dans le journal
print ('Conso Gaz N '..Appareil..' : '..Gaz_current_value)
2020-12-26 12:17:15.763 Status: LUA: Conso Gaz N Gaz : 1.844674407371e+19
compared to domoticz value
sqlite> select * from DeviceStatus where ID=201;
201|5|82201|1|Gaz|1|243|28|1|0|12|255|0|3835|2020-12-26 12:17:15|201|0.0|1.0|0.0|1.0|||0|0|0|||
and
http://192.168.0.252:8084/json.htm?type=devices&rid=201
{
"ActTime" : 1608979480,
"AstrTwilightEnd" : "18:56",
"AstrTwilightStart" : "06:47",
"CivTwilightEnd" : "17:37",
"CivTwilightStart" : "08:06",
"DayLength" : "08:18",
"NautTwilightEnd" : "18:18",
"NautTwilightStart" : "07:25",
"ServerTime" : "2020-12-26 11:44:40",
"SunAtSouth" : "12:52",
"Sunrise" : "08:42",
"Sunset" : "17:01",
"app_version" : "2020.1 (build 11839)",
"result" :
[
{
"AddjMulti" : 1.0,
"AddjMulti2" : 1.0,
"AddjValue" : 0.0,
"AddjValue2" : 0.0,
"BatteryLevel" : 255,
"Counter" : "37.950 m3",
"CounterToday" : "5.980 m3",
"CustomImage" : 0,
"Data" : "37.950 m3",
"Description" : "",
"Favorite" : 0,
"HardwareID" : 5,
"HardwareName" : "VIRTUAL HARDWARE ",
"HardwareType" : "Dummy (Does nothing, use for virtual switches only)",
"HardwareTypeVal" : 15,
"HaveTimeout" : false,
"ID" : "82201",
"LastUpdate" : "2020-12-26 11:44:39",
"Name" : "Gaz",
"Notifications" : "false",
"PlanID" : "8",
"PlanIDs" :
[
8,
6
],
"Protected" : false,
"ShowNotifications" : true,
"SignalLevel" : "-",
"SubType" : "Counter Incremental",
"SwitchTypeVal" : 1,
"Timers" : "false",
"Type" : "General",
"TypeImg" : "counter",
"Unit" : 1,
"Used" : 1,
"ValueQuantity" : "",
"ValueUnits" : "",
"XOffset" : "0",
"YOffset" : "0",
"idx" : "201"
}
],
"status" : "OK",
"title" : "Devices"
}
Wrong value retrieved from Gaz incremantal virtual counter
Moderator: leecollings
Who is online
Users browsing this forum: No registered users and 1 guest