get temperature in php

Moderator: Telldus

Post Reply
ifsioegr
Posts: 1
Joined: Fri Mar 17, 2023 9:45 am

get temperature in php

Post by ifsioegr »

Hi
sorry for my bad englisch
i have tellstick duo on a windows server and I have the opportunity to use linux
now i will get the temperatur of my sensor in php or command line

can you help me please ?


@admins can you set up a board in german language? thangs
egilj
Posts: 49
Joined: Fri Mar 17, 2023 9:45 am

Re: get temperature in php

Post by egilj »

Hi!

In windows, both the values for temperature and humidity is stored in registry.
You can get the temperature value from a batch/cmd file like this:

for /f "tokens=2,*" %%a in ('reg query HKCU\Software\Telldus\TelldusCenter\com.telldus.sensors\sensors\22\values\values\1\values /t REG_SZ /v value ^| findstr value') do echo %%b

The first value "22" (starts with 0,1,2) in the path is the number for the sensor, and the second "1" is for the temperature.

The value for the humidity is stored under \values\values\0\values... you can get it like this:

for /f "tokens=2,*" %%a in ('reg query HKCU\Software\Telldus\TelldusCenter\com.telldus.sensors\sensors\22\values\values\0\values /t REG_SZ /v value ^| findstr value') do echo %%b

In the examples above, the values vil be put in the %%b variable.

Important! if you run this in a batch file, use two (double) %% for the variables, if you just want to test it from a commandprompt window (cmd), then use just one percent character.
You can echo the values to textfile or something, i run scripts from eventghost and them change the values in a web page to display them on my intranets smarthome site.

Hope this helps
Regards
Egil
Post Reply