Skip to content
This repository has been archived by the owner on Jan 27, 2023. It is now read-only.

This plugin generated a warning from the characteristic 'Target Temperature': characteristic value expected valid finite number and received "NaN" (number). #169

Open
appliko opened this issue Jun 21, 2021 · 3 comments

Comments

@appliko
Copy link

appliko commented Jun 21, 2021

I'm getting multiple times this warning, on all my 301 valves

[homebridge-fritz] This plugin generated a warning from the characteristic 'Target Temperature': characteristic value expected valid finite number and received "NaN" (number). See https://git.io/JtMGR for more info.

Could it be because the valves are in off mode ?

@JoMensdorf
Copy link

Hi!
I am getting the same for my FRITZ!DECT 200:
[3.9.2021, 10:41:23] [homebridge-fritz] This plugin generated a warning from the characteristic 'Energy Consumption': characteristic was expected valid number and received NaN. See https://git.io/JtMGR for more info.
[3.9.2021, 10:41:23] [homebridge-fritz] This plugin generated a warning from the characteristic 'Current Temperature': characteristic was expected valid number and received NaN. See https://git.io/JtMGR for more info.

@BionicThomas
Copy link

Hi!
For Power und Energy Cosumption I had the same problem.
In my set-up it was a device registered on the fritz box that was not reachable / broken / lost.
After removing this power outlet device from the Fritz Box the error message is gone.
Hence I think it could be down to the API polling for this device and not getting a proper response due to the device not responding at all.

Not sure if it helped in any way but I also added a couple of lines of code to the outlet.js in the lib/accessories folder.
I'm not a developer and not really sure if this is the correct place to add such a check.
So if you copy it, do it at your own risk and have backups!

in those 2 functions I added sections

   if (power)
        {
        power = 0; 
        }

and

    if (energy)
       {
       energy = 0;
       }

so it looks like this:

FritzOutletAccessory.prototype.queryPowerUsage = function() {
    this.platform.fritz('getSwitchPower', this.ain).then(power => {
        const service = this.services.Outlet;

        if (power)
        {
        power = 0; 
        }

        service.fritzInUse = power > 0;
        service.fritzPowerUsage = power;

        service.getCharacteristic(Characteristic.OutletInUse).updateValue(service.fritzInUse);
        service.getCharacteristic(FritzPlatform.PowerUsage).updateValue(power);
    });
};

FritzOutletAccessory.prototype.getEnergyConsumption = function(callback) {
    this.platform.log(`Getting ${this.type} ${this.ain} energy consumption`);

    callback(null, this.services.Outlet.fritzEnergyConsumption);
    this.queryEnergyConsumption();
};

FritzOutletAccessory.prototype.queryEnergyConsumption = function() {
    this.platform.fritz('getSwitchEnergy', this.ain).then(energy => {
        const service = this.services.Outlet;
        
        if (energy)
        {
        energy = 0;
        }
        energy = energy / 1000.0;
        service.fritzEnergyConsumption = energy;
        service.getCharacteristic(FritzPlatform.EnergyConsumption).updateValue(energy);
    });
};

@disasterdaddy
Copy link

Hi Andig,
there are a lot of "This plugin generated a warning from the characteristic ..." belonging to this issue since many months. Is there any solution? I can't find one. I will be happy if I can stop the messages in the log.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants