Autor Thema: change the state value  (Gelesen 1201 mal)


  • Gast
change the state value
« am: 23 Mai 2015, 11:29:42 »


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 ?


Offline Benni

  • Developer
  • Hero Member
  • ****
  • Beiträge: 2375
  • FHEMinist
Antw:change the state value
« Antwort #1 am: 23 Mai 2015, 12:30:46 »
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.

« Letzte Änderung: 23 Mai 2015, 16:21:20 von Benni »


  • Gast
Antw:change the state value
« Antwort #2 am: 24 Mai 2015, 07:40:04 »

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