FHEM Forum

FHEM => English Corner => Thema gestartet von: kroonen am 18 August 2015, 20:56:29

Titel: PID20 how to use the right value
Beitrag von: kroonen am 18 August 2015, 20:56:29
Hi,

I want to use my esp8266 for my pid20.

I only use one reading that looks like this

state    T: 20.5 H: 60     2015-08-18 20:46:46

Now I used it before with oregon, and there was a value of temperature with only the temperature

define thermostaat_slaapkamer PID20 Slaapkamertemp:temperature thermostaat_slaap:valve

Can i define it right to get only the temp? something like this?

define thermostaat_slaapkamer PID20 Slaapkamertemp:state.T: thermostaat_slaap:valve

regards Richard


Titel: Antw:PID20 how to use the right value
Beitrag von: frank am 29 August 2015, 01:50:47
hi kroonen,

you can make a new reading temperature with the attribute userReadings
attr Slaapkamertemp userReadings temperature {my (undef,$temp,undef,undef)=split(' ',ReadingsVal($name,"state",0));return $temp}
and take this to your old definition of pid20.
Titel: Antw:PID20 how to use the right value
Beitrag von: kroonen am 30 August 2015, 13:11:22
Hi,

Thanx for the reply. I only cut and paste this

attr Slaapkamertemp userReadings temperature {my (undef,$temp,undef,undef)=split(' ',ReadingsVal($name,"state",0));return $temp}

configfile: Unknown command return, try help

is there a additional perl package for required?

regards Richard

Titel: Antw:PID20 how to use the right value
Beitrag von: frank am 30 August 2015, 17:41:44
Zitatconfigfile: Unknown command return, try help
i have tried the code with my fhem on my router fritzbox with a minimal perl lib.

i think you directly copy the code in your fhem.cfg. that is the wrong way. you should try the attribute-edit-section in the details window. 
Titel: Antw:PID20 how to use the right value
Beitrag von: kroonen am 30 August 2015, 22:38:38
Well after putting it in the web config it went ok.

Thnx for the solution

regards Richard