Parserproblem i v3.0

http://karpero.mine.nu/ha

Moderators: Daniel, tom_rosenback, Telldus

Post Reply
lillen
Posts: 10
Joined: Fri Mar 17, 2023 9:45 am

Parserproblem i v3.0

Post by lillen »

Gjorde en ren installation av HA 3.0.1 och i den får jag problem med att hämta temperatur data från LogTemp.

Har satt upp parsen lika som jag haft det förut
och kör jag parser.php från cmd så står det :
Parsing 'logtemp'
parsing 'logtemp' completed

Men inga rader läggs till i tabellen "temps"

Det ligger rader i *.txt filen från logtemp och har dubbelkollat alla inställningar i parser_config och i system_config/logtemp

Är det nått nytt som ska göras eller vad har jag missat?
tom_rosenback
Posts: 779
Joined: Fri Mar 17, 2023 9:45 am
Contact:

Re: Parserproblem i v3.0

Post by tom_rosenback »

lillen wrote:Gjorde en ren installation av HA 3.0.1 och i den får jag problem med att hämta temperatur data från LogTemp.

Har satt upp parsen lika som jag haft det förut
och kör jag parser.php från cmd så står det :
Parsing 'logtemp'
parsing 'logtemp' completed

Men inga rader läggs till i tabellen "temps"

Det ligger rader i *.txt filen från logtemp och har dubbelkollat alla inställningar i parser_config och i system_config/logtemp

Är det nått nytt som ska göras eller vad har jag missat?
Hej,

Kan du skicka över din logtemp samt dina config filer för parsern? Släng dem på mailen eller ladda upp dem direkt hit så kollar jag över dem.
//Tom

Senaste info och release om/av HomeAutomation hittas här http://karpero.mine.nu/ha
Latest info and release of HomeAutomation can be found here http://karpero.mine.nu/ha
lillen
Posts: 10
Joined: Fri Mar 17, 2023 9:45 am

Re: Parserproblem i v3.0

Post by lillen »

Så här ser det ut.
Parser_config

Code: Select all

<?php
	// Weather system file parser v0.7

	// uncomment the system(s) in use by removing the // in front of the line(s)
	// $systems[] = "wview";
	// $systems[] = "owfs";
	// $systems[] = "owread";
	// $systems[] = "cumulus";
	 $systems[] = "logtemp";
	// $systems[] = "calculations";
	// $systems[] = "telldusduo";
	// $systems[] = "rpigpio";
	// $systems[] = "yoctolight";

	// uncomment the following line (by removing // in front) if you only want to simulate the data parsing without inserting it to the database. Can be handy when testing out new sensors and systems.	
	// define("PARSER_SIMULATE", true);

?>
Logtemp

Code: Select all

<?php
/* logtemp specific config */

	// the path to the logtemp sensor files
	$logtempPath = "C:/xampp/htdocs/tempfiler/";
	
	//date format, indexed from 0-2, example date dd.mm.yy
	$dateFormat["d"] = 0;
	$dateFormat["m"] = 1;
	$dateFormat["y"] = 2;
	$dateFormat["separator"] = ".";
	
	// an array of sensors to parse, where xyz is the sensor serial eg. 1026CA23010800A7
	// if you have several sensors, just duplicate the row below and change xyz to match the sensor serials for each sensor

      //$sensorsToParse[] = "3B000003F81EF028";
	//$sensorsToParse[] = "5A000003F8318228";
	$sensorsToParse[] = "33000003F8229228";
	//$sensorsToParse[] = "A3000003F819CF28";
	//$sensorsToParse[] = "1F0000047F7D4328";
	$sensorsToParse[] = "61000000A11C3926-H";
	//$sensorsToParse[] = "B80000047F769D283B000003F81EF028";
	//$sensorsToParse[] = "E5000004801E6828";
	
	// When using 1-wire systems the readout of the sensor can sometimes be faulty, enable this if you experience any problems. A faulty value is equal to 85, without decimals.
	$filteringEnabled = true;
	
/*
	example contents of logfile
	/////////////////// FILE STARTS HERE //////////////////////////
	Date; Time; Temp °C
	09.08.2011; 21:29:23;25.38
	/////////////////// FILE END HERE ////////////////////////////
*/

?>
Och så här ser mina *.txt filer ut som kommer från logtemp

Code: Select all

Date; Time; Temp °C
24.03.2014; 07:04:55;-1.50
24.03.2014; 07:06:05;-1.38
24.03.2014; 07:07:15;-1.44
24.03.2014; 07:08:25;-1.44
24.03.2014; 07:09:35;-1.44
24.03.2014; 07:10:45;-1.25
24.03.2014; 07:11:55;-1.25
24.03.2014; 07:13:05;-1.25
24.03.2014; 07:14:15;-1.19
24.03.2014; 07:15:25;-1.13
När jag kolla runt lite på morgonen såg jag att valet för att välja in 1-wire tempsensorer i HA inställningar är borta
kan det ha nått med det att göra?
tom_rosenback
Posts: 779
Joined: Fri Mar 17, 2023 9:45 am
Contact:

Re: Parserproblem i v3.0

Post by tom_rosenback »

lillen wrote:Så här ser det ut.
Parser_config

Code: Select all

<?php
	// Weather system file parser v0.7

	// uncomment the system(s) in use by removing the // in front of the line(s)
	// $systems[] = "wview";
	// $systems[] = "owfs";
	// $systems[] = "owread";
	// $systems[] = "cumulus";
	 $systems[] = "logtemp";
	// $systems[] = "calculations";
	// $systems[] = "telldusduo";
	// $systems[] = "rpigpio";
	// $systems[] = "yoctolight";

	// uncomment the following line (by removing // in front) if you only want to simulate the data parsing without inserting it to the database. Can be handy when testing out new sensors and systems.	
	// define("PARSER_SIMULATE", true);

?>
Logtemp

Code: Select all

<?php
/* logtemp specific config */

	// the path to the logtemp sensor files
	$logtempPath = "C:/xampp/htdocs/tempfiler/";
	
	//date format, indexed from 0-2, example date dd.mm.yy
	$dateFormat["d"] = 0;
	$dateFormat["m"] = 1;
	$dateFormat["y"] = 2;
	$dateFormat["separator"] = ".";
	
	// an array of sensors to parse, where xyz is the sensor serial eg. 1026CA23010800A7
	// if you have several sensors, just duplicate the row below and change xyz to match the sensor serials for each sensor

      //$sensorsToParse[] = "3B000003F81EF028";
	//$sensorsToParse[] = "5A000003F8318228";
	$sensorsToParse[] = "33000003F8229228";
	//$sensorsToParse[] = "A3000003F819CF28";
	//$sensorsToParse[] = "1F0000047F7D4328";
	$sensorsToParse[] = "61000000A11C3926-H";
	//$sensorsToParse[] = "B80000047F769D283B000003F81EF028";
	//$sensorsToParse[] = "E5000004801E6828";
	
	// When using 1-wire systems the readout of the sensor can sometimes be faulty, enable this if you experience any problems. A faulty value is equal to 85, without decimals.
	$filteringEnabled = true;
	
/*
	example contents of logfile
	/////////////////// FILE STARTS HERE //////////////////////////
	Date; Time; Temp °C
	09.08.2011; 21:29:23;25.38
	/////////////////// FILE END HERE ////////////////////////////
*/

?>
Och så här ser mina *.txt filer ut som kommer från logtemp

Code: Select all

Date; Time; Temp °C
24.03.2014; 07:04:55;-1.50
24.03.2014; 07:06:05;-1.38
24.03.2014; 07:07:15;-1.44
24.03.2014; 07:08:25;-1.44
24.03.2014; 07:09:35;-1.44
24.03.2014; 07:10:45;-1.25
24.03.2014; 07:11:55;-1.25
24.03.2014; 07:13:05;-1.25
24.03.2014; 07:14:15;-1.19
24.03.2014; 07:15:25;-1.13
När jag kolla runt lite på morgonen såg jag att valet för att välja in 1-wire tempsensorer i HA inställningar är borta
kan det ha nått med det att göra?
Det har nog inget med HA inställningarna att göra utan det måste nog vara något med inläsningen av värdena som inte fungerar, återkommer senare med resultat.
//Tom

Senaste info och release om/av HomeAutomation hittas här http://karpero.mine.nu/ha
Latest info and release of HomeAutomation can be found here http://karpero.mine.nu/ha
tom_rosenback
Posts: 779
Joined: Fri Mar 17, 2023 9:45 am
Contact:

Re: Parserproblem i v3.0

Post by tom_rosenback »

lillen wrote:Så här ser det ut.
Parser_config

Code: Select all

<?php
	// Weather system file parser v0.7

	// uncomment the system(s) in use by removing the // in front of the line(s)
	// $systems[] = "wview";
	// $systems[] = "owfs";
	// $systems[] = "owread";
	// $systems[] = "cumulus";
	 $systems[] = "logtemp";
	// $systems[] = "calculations";
	// $systems[] = "telldusduo";
	// $systems[] = "rpigpio";
	// $systems[] = "yoctolight";

	// uncomment the following line (by removing // in front) if you only want to simulate the data parsing without inserting it to the database. Can be handy when testing out new sensors and systems.	
	// define("PARSER_SIMULATE", true);

?>
Logtemp

Code: Select all

<?php
/* logtemp specific config */

	// the path to the logtemp sensor files
	$logtempPath = "C:/xampp/htdocs/tempfiler/";
	
	//date format, indexed from 0-2, example date dd.mm.yy
	$dateFormat["d"] = 0;
	$dateFormat["m"] = 1;
	$dateFormat["y"] = 2;
	$dateFormat["separator"] = ".";
	
	// an array of sensors to parse, where xyz is the sensor serial eg. 1026CA23010800A7
	// if you have several sensors, just duplicate the row below and change xyz to match the sensor serials for each sensor

      //$sensorsToParse[] = "3B000003F81EF028";
	//$sensorsToParse[] = "5A000003F8318228";
	$sensorsToParse[] = "33000003F8229228";
	//$sensorsToParse[] = "A3000003F819CF28";
	//$sensorsToParse[] = "1F0000047F7D4328";
	$sensorsToParse[] = "61000000A11C3926-H";
	//$sensorsToParse[] = "B80000047F769D283B000003F81EF028";
	//$sensorsToParse[] = "E5000004801E6828";
	
	// When using 1-wire systems the readout of the sensor can sometimes be faulty, enable this if you experience any problems. A faulty value is equal to 85, without decimals.
	$filteringEnabled = true;
	
/*
	example contents of logfile
	/////////////////// FILE STARTS HERE //////////////////////////
	Date; Time; Temp °C
	09.08.2011; 21:29:23;25.38
	/////////////////// FILE END HERE ////////////////////////////
*/

?>
Och så här ser mina *.txt filer ut som kommer från logtemp

Code: Select all

Date; Time; Temp °C
24.03.2014; 07:04:55;-1.50
24.03.2014; 07:06:05;-1.38
24.03.2014; 07:07:15;-1.44
24.03.2014; 07:08:25;-1.44
24.03.2014; 07:09:35;-1.44
24.03.2014; 07:10:45;-1.25
24.03.2014; 07:11:55;-1.25
24.03.2014; 07:13:05;-1.25
24.03.2014; 07:14:15;-1.19
24.03.2014; 07:15:25;-1.13
När jag kolla runt lite på morgonen såg jag att valet för att välja in 1-wire tempsensorer i HA inställningar är borta
kan det ha nått med det att göra?
Hittade problemet i loggfilen och problemet var den tomma raden som fanns i logtemp loggen. Detta problem skall vara åtgärdat i v0.7.3 som finns att laddas ner på hemsidan, http://karpero.mine.nu/ha/index.php?pag ... d&hl=en_US
//Tom

Senaste info och release om/av HomeAutomation hittas här http://karpero.mine.nu/ha
Latest info and release of HomeAutomation can be found here http://karpero.mine.nu/ha
lillen
Posts: 10
Joined: Fri Mar 17, 2023 9:45 am

Re: Parserproblem i v3.0

Post by lillen »

Tack!
Funkar perfekt nu :D
lorde
Posts: 20
Joined: Fri Mar 17, 2023 9:45 am

Re: Parserproblem i v3.0

Post by lorde »

lillen wrote:Tack!
Funkar perfekt nu :D
It doesn't work for me, I've got the same problem.
I don't understand how you solved-it ?
I have clean installation of v3.0.1 on Raspberry Pi 2B
tom_rosenback
Posts: 779
Joined: Fri Mar 17, 2023 9:45 am
Contact:

Re: Parserproblem i v3.0

Post by tom_rosenback »

lorde wrote:
lillen wrote:Tack!
Funkar perfekt nu :D
It doesn't work for me, I've got the same problem.
I don't understand how you solved-it ?
I have clean installation of v3.0.1 on Raspberry Pi 2B
You need to install test latest Parser from HA homepage.
//Tom

Senaste info och release om/av HomeAutomation hittas här http://karpero.mine.nu/ha
Latest info and release of HomeAutomation can be found here http://karpero.mine.nu/ha
lorde
Posts: 20
Joined: Fri Mar 17, 2023 9:45 am

Re: Parserproblem i v3.0

Post by lorde »

tom_rosenback wrote:
lorde wrote:
lillen wrote:Tack!
Funkar perfekt nu :D
It doesn't work for me, I've got the same problem.
I don't understand how you solved-it ?
I have clean installation of v3.0.1 on Raspberry Pi 2B
You need to install test latest Parser from HA homepage.

How can i do this ?
It's ok to replace the files with WinSCP ???
tom_rosenback
Posts: 779
Joined: Fri Mar 17, 2023 9:45 am
Contact:

Re: Parserproblem i v3.0

Post by tom_rosenback »

lorde wrote:
tom_rosenback wrote: You need to install test latest Parser from HA homepage.

How can i do this ?
It's ok to replace the files with WinSCP ???
EDIT:
I'm affraid i allready have the latest version, since i've installed HA3.0.1 .......
I do think there is a new version of Weather Parser even if you have 3.0.1 installed. Just download the latest ZIP of WP and replace the files in your installation with the contents of the ZIP. WinSCP should work just fine.
//Tom

Senaste info och release om/av HomeAutomation hittas här http://karpero.mine.nu/ha
Latest info and release of HomeAutomation can be found here http://karpero.mine.nu/ha
lorde
Posts: 20
Joined: Fri Mar 17, 2023 9:45 am

Re: Parserproblem i v3.0

Post by lorde »

Parser has been replaced with 0.7.6 , but the *txt files are still the same, no changes ...

Output :

Code: Select all

pi@raspberrypi ~ $ php /var/www/HomeAutomation/parser/parser.php
Parsing 'logtemp'
Date: 2011-03-30
Time: 15:47:38
Found: oregon-f824-21, value: 4
Date: 2011-08-09
Time: 21:29:23
Found: oregon-f824-21-humidity, value was filtered out. Value: 85
Parsing 'logtemp' completed

Parsing 'telldusduo'
Found: oregon-F824-21, value: 20.9
Found: oregon-F824-21-humidity, value: 57
Parsing 'telldusduo' completed
logtemp oregon-f824-21.txt and oregon-f824-21-humidity.txt are both of them empty :

Code: Select all

Date; Time; Counter
30.03.2011; 15:47:38;4
and

Code: Select all

Date; Time; Temp °C
09.08.2011; 21:29:23;85
Is this normal ? What is the parser used for, then ???

Also i don't understand how to do this (from readme) : - Add a cron job / Windows scheduledtask that executes the following line with an interval of your choice, typically 15min
path-to-php\php path-to-parser\parser.php


Just now my cron tab looks like this:

Code: Select all

*/10 * * * * php /var/www/HomeAutomation/parser/parser.php


01 00 * * * /usr/bin//php /var/www/HomeAutomation/run.php command=updateschedules >/dev/null 2>&1
Thank you for your help, i'm really new here ..... and very confused, unfortunatelly ....
tom_rosenback
Posts: 779
Joined: Fri Mar 17, 2023 9:45 am
Contact:

Re: Parserproblem i v3.0

Post by tom_rosenback »

lorde wrote:Parser has been replaced with 0.7.6 , but the *txt files are still the same, no changes ...

Output :

Code: Select all

pi@raspberrypi ~ $ php /var/www/HomeAutomation/parser/parser.php
Parsing 'logtemp'
Date: 2011-03-30
Time: 15:47:38
Found: oregon-f824-21, value: 4
Date: 2011-08-09
Time: 21:29:23
Found: oregon-f824-21-humidity, value was filtered out. Value: 85
Parsing 'logtemp' completed

Parsing 'telldusduo'
Found: oregon-F824-21, value: 20.9
Found: oregon-F824-21-humidity, value: 57
Parsing 'telldusduo' completed
logtemp oregon-f824-21.txt and oregon-f824-21-humidity.txt are both of them empty :

Code: Select all

Date; Time; Counter
30.03.2011; 15:47:38;4
and

Code: Select all

Date; Time; Temp °C
09.08.2011; 21:29:23;85
Is this normal ? What is the parser used for, then ???

Also i don't understand how to do this (from readme) : - Add a cron job / Windows scheduledtask that executes the following line with an interval of your choice, typically 15min
path-to-php\php path-to-parser\parser.php


Just now my cron tab looks like this:

Code: Select all

*/10 * * * * php /var/www/HomeAutomation/parser/parser.php


01 00 * * * /usr/bin//php /var/www/HomeAutomation/run.php command=updateschedules >/dev/null 2>&1
Thank you for your help, i'm really new here ..... and very confused, unfortunatelly ....
The parser just reads the data from respective application, in your case now logtemp, and then feeds this data into HA database. No logfiles are updated (except HA debug log files). So the output you see is correct and you should have new sensors in your database. Just go to Configuration => Sensors, and on that page click on "Update sensors".

Adding the cronjob is just a way to automate the reading/parsing. This you can add from inside of HA too, go to Configuration => System schedules and add
"php" as application and "/var/www/HomeAutomation/parser/parser.php", as interval select Daily and 00:15.
//Tom

Senaste info och release om/av HomeAutomation hittas här http://karpero.mine.nu/ha
Latest info and release of HomeAutomation can be found here http://karpero.mine.nu/ha
lorde
Posts: 20
Joined: Fri Mar 17, 2023 9:45 am

Re: Parserproblem i v3.0

Post by lorde »

I had added 3 new sensors and i've got another problem ;

Code: Select all

pi@raspberrypi ~ $ php /var/www/HomeAutomation/parser/parser.php
Parsing 'logtemp'
PHP Parse error:  syntax error, unexpected '$filteringEnabled' (T_VARIABLE) in /var/www/HomeAutomation/parser/system_config/logtemp.php on line 24

2nd problem :

After i "update sensors" in HA i get one sensor twice times. I can't even delete-it, it will be still shown in Measurements log...
i tried to removed or to change his name, after "update" command, new one is coming up.

EDIT: 2nd problem solved, i had removed the ENTIRE list then run again "Update Sensors"
tom_rosenback
Posts: 779
Joined: Fri Mar 17, 2023 9:45 am
Contact:

Re: Parserproblem i v3.0

Post by tom_rosenback »

lorde wrote:I had added 3 new sensors and i've got another problem ;

Code: Select all

pi@raspberrypi ~ $ php /var/www/HomeAutomation/parser/parser.php
Parsing 'logtemp'
PHP Parse error:  syntax error, unexpected '$filteringEnabled' (T_VARIABLE) in /var/www/HomeAutomation/parser/system_config/logtemp.php on line 24

2nd problem :

After i "update sensors" in HA i get one sensor twice times. I can't even delete-it, it will be still shown in Measurements log...
i tried to removed or to change his name, after "update" command, new one is coming up.

EDIT: 2nd problem solved, i had removed the ENTIRE list then run again "Update Sensors"
1st problem

You have some syntax error in the logtemp config file. Please double check it with sample file to ensure tge syntax.

2nd problem
Yes sensors will always reappear even if you have deleted them. This is because no data is deleted when deleting a sensor and when you then click Update sensors it checks all read sensor data and adds them as a new sensor.
//Tom

Senaste info och release om/av HomeAutomation hittas här http://karpero.mine.nu/ha
Latest info and release of HomeAutomation can be found here http://karpero.mine.nu/ha
Post Reply