sfudeus / homematic_exporter

Prometheus exporter for homematic ccu3
Apache License 2.0
23 stars 17 forks source link

Do not ignore values that are 0 or false. #16

Closed neredera closed 3 years ago

neredera commented 3 years ago

Report values that are 0 or false.

neredera commented 3 years ago

Seems to have a problem with HmIP devices that have not sent a value to the ccu.

sfudeus commented 3 years ago

@neredera Stumbled myself about this issue yesterday (because a power-value of a HmIP-FSM was never reset to 0). What problem did you see with your proposed fix? Does it make worse than the bug we have or just not complete?

sfudeus commented 3 years ago

However, this seems a lot more reasonable than the current behaviour. With this, only empty string values and missing values will be ignored, currently 0 is ignored, too, which definitely is wrong. And if devices pending an initialization wrongly report 0 instead if their correct value and would now be measured as "0", this is definitely a lot less frequent the case.

neredera commented 3 years ago

I tried to use the overload of getParamSet (see this commit) that returns if the value is undefined. I think it works for IP devices correct, but it still returns after a restart of the exporter 0 for Bidcos Devices that are unavailable (e.g. battery empty).

If you want I can create a pull request from this. I have it running for some time in my environment without problems, except that it does not fix the problem for bidcos devices.

I think it additionally can report more values for IP devices if only one value is undefined.