Error on batterylevel of added device  [SOLVED]

Moderator: leecollings

EddyG
Posts: 1042
Joined: Monday 02 November 2015 5:54
Target OS: -
Domoticz version:

Re: Error on batterylevel of added device

Post by EddyG »

Just an Idea. I use quite long namens that sometimes are lookalikes. All my dzVents scripts are based on names. Is IT possible that namens are beging mixedup?
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Error on batterylevel of added device

Post by waaren »

EddyG wrote: Saturday 20 March 2021 22:39 Just an Idea. I use quite long namens that sometimes are lookalikes. All my dzVents scripts are based on names. Is IT possible that namens are beging mixedup?
Only when you use wildcards. Long names are not cut in dzVents or in the eventSystem. You can check that in the earlier mentioned dump of domoticzdata.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
EddyG
Posts: 1042
Joined: Monday 02 November 2015 5:54
Target OS: -
Domoticz version:

Re: Error on batterylevel of added device

Post by EddyG »

Yesterday I did an other 'debug' run, trying to find out more. Did not find the answer.
In the "domoticzData.lua" file the device was present now.

Code: Select all

    [15] = {
        ["changed"] = false;
        ["lastUpdate"] = "2021-03-18 09:54:34";
        ["subType"] = "ARC";
        ["switchTypeValue"] = 0;
        ["signalLevel"] = 2665764;
        ["protected"] = false;
        ["deviceID"] = "";
        ["image"] = "";
        ["rawData"] = {
            [1] = "255";
        };
        ["baseType"] = "device";
        ["switchType"] = "On/Off";
        ["data"] = {
            ["Image"] = "Light";
            ["icon"] = "lightbulb";
            ["customImage"] = 0;
            ["usedByCamera"] = false;
            ["_nValue"] = 1;
            ["protected"] = false;
            ["_state"] = "On";
            ["hardwareTypeValue"] = 1;
            ["hardwareType"] = "RFXCOM - RFXtrx433 USB 433.92MHz Transceiver";
            ["maxDimLevel"] = 0;
            ["levelVal"] = 255;
            ["hardwareName"] = "RFXCOM";
            ["unit"] = 7;
            ["hardwareID"] = 7909328;
        };
        ["timedOut"] = true;
        ["batteryLevel"] = -1350579280;
        ["description"] = "";
        ["iconNumber"] = 96;
        ["id"] = 48;
        ["lastLevel"] = 0;
        ["name"] = "Keukenkast spotjes slave OLD";
        ["deviceType"] = "Lighting 1";
    };
There are a few strange things I noticed.
1. It is an INactive device, so it should not be in there at all.
2. lastUpdate is quite recent. I did not update the device, because it is inactive.
3. signalLevel is a strange value.
4. There is no deviceID, that should be 69
5. rawData is strange to, should be {};
6. hardwareID is wrong should be 2
7. batteryLevel is wrong should be 255

These value in the database are normal and as above. GUI is showing normal values too.
I looked if hex value might give an indication -> nothing.
I cannot relate any abnormal value to an other device in the database. Checked database again -> no error.
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Error on batterylevel of added device

Post by waaren »

EddyG wrote: Monday 22 March 2021 10:01 Yesterday I did an other 'debug' run, trying to find out more. Did not find the answer.
In the "domoticzData.lua" file the device was present now.
These value in the database are normal and as above. GUI is showing normal values too.
The event system should indeed only pass devices if the hardware module they are connected to is active and if the used field in the database for this device as the value 1.

What do you see when you give

http://<domotcz ip: domoticz port>/json.htm?type=devices&rid=<device idx>

in your browser?
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
EddyG
Posts: 1042
Joined: Monday 02 November 2015 5:54
Target OS: -
Domoticz version:

Re: Error on batterylevel of added device

Post by EddyG »

I already did that and the result is the same as in the database.
Spoiler: show
// 20210322114339
// http://192.168.2.239:8080/json.htm?type=devices&rid=48

{
"ActTime": 1616409819,
"AstrTwilightEnd": "20:50",
"AstrTwilightStart": "04:39",
"CivTwilightEnd": "19:28",
"CivTwilightStart": "06:01",
"DayLength": "12:19",
"NautTwilightEnd": "20:08",
"NautTwilightStart": "05:21",
"ServerTime": "2021-03-22 11:43:39",
"SunAtSouth": "12:45",
"Sunrise": "06:35",
"Sunset": "18:54",
"app_version": "2020.2 (build 13084)",
"result": [
{
"AddjMulti": 1.0,
"AddjMulti2": 1.0,
"AddjValue": 0.0,
"AddjValue2": 0.0,
"BatteryLevel": 255,
"CustomImage": 0,
"Data": "On",
"Description": "",
"DimmerType": "none",
"Favorite": 0,
"HardwareDisabled": false,
"HardwareID": 2,
"HardwareName": "RFXCOM",
"HardwareType": "RFXCOM - RFXtrx433 USB 433.92MHz Transceiver",
"HardwareTypeVal": 1,
"HaveDimmer": false,
"HaveGroupCmd": true,
"HaveTimeout": false,
"ID": "69",
"Image": "Light",
"IsSubDevice": false,
"LastUpdate": "2021-03-18 09:54:34",
"Level": 0,
"LevelInt": 255,
"MaxDimLevel": 0,
"Name": "Keukenkast spotjes slave OLD",
"Notifications": "false",
"PlanID": "0",
"PlanIDs": [
0
],
"Protected": false,
"ShowNotifications": true,
"SignalLevel": 6,
"Status": "On",
"StrParam1": "",
"StrParam2": "",
"SubType": "ARC",
"SwitchType": "On/Off",
"SwitchTypeVal": 0,
"Timers": "false",
"Type": "Lighting 1",
"TypeImg": "lightbulb",
"Unit": 7,
"Used": 0,
"UsedByCamera": false,
"XOffset": "0",
"YOffset": "0",
"idx": "48"
}
],
"status": "OK",
"title": "Devices"
}
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Error on batterylevel of added device

Post by waaren »

EddyG wrote: Monday 22 March 2021 11:44 I already did that and the result is the same as in the database.
Following the logic in the code it should be impossible that this data ends up in the table passed to dzVents. Only devices with 1 in field Used of the devicestatus table are added to that table.
Do you see any other devices in the dzVents dump of the domoticzdata that are not Used ?
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
EddyG
Posts: 1042
Joined: Monday 02 November 2015 5:54
Target OS: -
Domoticz version:

Re: Error on batterylevel of added device

Post by EddyG »

waaren wrote: Monday 22 March 2021 13:01 Do you see any other devices in the dzVents dump of the domoticzdata that are not Used ?
That check is not doable for the amount of active devices I have.
I searched for "deviceID = "" ", and there were none. I checked for signallevel > 12, there were none.
I just found out that this is the only KlikAanKlikUit device with 255 as sValue in the database.
I made the device active switched it a few times, and the value is now "" Put it back to inactive and ran the script again.
Result -> No error. Might be that problem is solved.

Still a little bit creapy, I found this in the domoticz.log

Code: Select all

2021-03-22 13:39:11.716 Error: dzVents: Error: (3.1.6) Discarding device. No last update info found: {["protected"]=false, ["image"]="", ["batteryLevel"]=-1350580304, ["signalLevel"]=2665764, ["subType"]="ARC", ["deviceID"]="", ["deviceType"]="Lighting 1", ["id"]=48, ["data"]={["protected"]=false, ["customImage"]=0, ["Image"]="Light", ["usedByCamera"]=false, ["hardwareTypeValue"]=1, ["_state"]="Off", ["_nValue"]=0, ["hardwareType"]="RFXCOM - RFXtrx433 USB 433.92MHz Transceiver", ["unit"]=7, ["icon"]="lightbulb", ["hardwareID"]=7909328, ["hardwareName"]="RFXCOM", ["levelVal"]=0, ["maxDimLevel"]=0}, ["lastLevel"]=255, ["lastUpdate"]="", ["switchTypeValue"]=0, ["baseType"]="device", ["changed"]=true, ["description"]="", ["rawData"]={}, ["iconNumber"]=240, ["timedOut"]=false, ["name"]="Keukenkast spotjes slave OLD", ["switchType"]="On/Off"}
But the device is gone from domoticzData.lua
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest