homebridge-fritz icon indicating copy to clipboard operation
homebridge-fritz copied to clipboard

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

Open appliko opened this issue 3 years ago • 3 comments

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 ?

appliko avatar Jun 21 '21 05:06 appliko

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.

JoMensdorf avatar Sep 03 '21 09:09 JoMensdorf

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);
    });
};

BionicThomas avatar Oct 15 '21 07:10 BionicThomas

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.

disasterdaddy avatar Sep 11 '22 10:09 disasterdaddy