change the state value

Begonnen von franc, 23 Mai 2015, 11:29:42

Vorheriges Thema - Nächstes Thema

franc


Hi,

I am working on changing the hardware that submits temperature and and humidity readings, unfortunately these don't support floating point numbers and the value are multiplied by 10. The old system did something things like

   set Temperature 22.3

the new hardware does

   set Temperature 223

Is it possible to write a rule so that fhem sets that state to 22.3 instead of 223 ?

thanks


Benni

#1
Hi franc,

there are two possibilities to do something like that:


  • Use stateFormat attribute which allows you to modify what is displayed in STATE which is  actually what is displayed in overviews
  • Generate your own reading via the attribute userReadings if you need these values e.g. for logging purposes.

for a detailed description on both attributes search in the fhem commandref.

regards
Benni.

franc


Neither of those do quite what I want/need, thanks anyway

I've managed to hack the new system so that it now sends the correct values