--- "96_RenaultZE (1).pm" 2025-05-18 23:02:41.000000000 +0200
+++ FHEM/96_RenaultZE.pm 2025-05-18 23:25:55.447144189 +0200
@@ -1695,16 +1695,18 @@
$homeRadius = AttrVal( $name, "ze_homeRadius", 20 ) if ( $homeRadius eq "auto");
Log3 $name, 5, "RenaultZE_distanceFromHome - Check ".$hash."/".$lat." ".$long."/".$homeRadius;
- if ($distance < $homeRadius) {
+# if ($distance < $homeRadius) {
+ if ($distance < 1) { # change scale for distance < 1 km
$distance = $distance * 1000;
$dim = "m";
if ($distance < $homeRadius) {
- $homeinfo = "home";
+ $homeinfo = "Home";
$homestate = "home";
}
}
$distance = sprintf("%.3f", $distance);
- $homeinfo = $distance." ".$dim." away" if ( $homeinfo eq "");
+# $homeinfo = $distance." ".$dim." away" if ( $homeinfo eq "");
+ $homeinfo = "Away" if ( $homeinfo eq "");
if ( $hlong != 0.0 and $hlat != 0.0) {
readingsSingleUpdate($hash,"distanceFromHome",$distance,1);
readingsSingleUpdate($hash,"distanceUnit",$dim,1);
@@ -1725,7 +1727,8 @@
Log3 $name, 5, "RenaultZE_gAddress1 - In ".$hash."/".$name." ".$lat."/".$long;
readingsSingleUpdate($hash,"ze_Step","RenaultZE_gAddress1",1);
- my $url = "https://www.google.com/maps/place/$lat+$long";
+# my $url = "https://www.google.com/maps/place/$lat+$long";
+ my $url = "https://maps.googleapis.com/maps/api/geocode/json?latlng=$lat,$long&key=<google-maps-api-key>&language=de";
Log3 $name, 5, "RenaultZE_gData_Step1 - URL ".$url;
my $param = {
url => $url,
@@ -1758,7 +1761,13 @@
# my $lastErr = $hash->{READINGS}{ze_lastErr}{VAL};
# return undef if ($lastErr ne "");
- $data =~ s/.*meta content=\"(.*)\" itemprop=\"description\".*/$1/sg;
+# $data =~ s/.*meta content=\"(.*)\" itemprop=\"description\".*/$1/sg;
+ my $decode_json = eval { from_json($data) };
+ if( $@) {
+ Log3 $name, 2, "$name: json error: $@ in RenazltZE_gAddress2";
+ return;
+ }
+ $data = $decode_json->{results}[0]->{formatted_address};
Log3 $name, 5, "RenaultZE_gAddress2 - Address ".$data;
my $oldinfo = ReadingsVal($name,"homeInfo","");
my $newinfo = $oldinfo." (".$data.")"
2025051801 => hod: 01, nod: So, sunaz: 350, sunalt: -19, rad1h: -, wcc: 100, wid: 61, rr1c: 0.00, pvrl: -, con: 734, gcons: 25, temp: 7
2025051802 => hod: 02, nod: So, sunaz: 5, sunalt: -19, rad1h: -, wcc: 100, wid: 3, rr1c: 0.50, pvrl: -, con: 627, gcons: 23, temp: 9
2025051803 => hod: 03, nod: So, sunaz: 20, sunalt: -17, rad1h: -, wcc: 100, wid: 61, rr1c: 0.30, pvrl: -, con: 594, gcons: 22, temp: 9
2025051804 => hod: 04, nod: So, sunaz: 34, sunalt: -12, rad1h: -, wcc: 100, wid: 61, rr1c: 0.30, pvrl: -, con: 567, gcons: 25, temp: 9
2025051805 => hod: 05, nod: So, sunaz: 47, sunalt: -6, rad1h: -, wcc: 100, wid: 61, rr1c: 0.30, pvrl: -, con: 636, gcons: 24, temp: 9
2025051806 => hod: 06, nod: So, sunaz: 59, sunalt: 1, rad1h: -, wcc: 89, wid: 80, rr1c: 0.00, pvrl: 15, con: 638, gcons: 23, temp: 9
2025051807 => hod: 07, nod: So, sunaz: 70, sunalt: 10, rad1h: -, wcc: 100, wid: 61, rr1c: 0.00, pvrl: 189, con: 523, gcons: 23, temp: 9
2025051808 => hod: 08, nod: So, sunaz: 82, sunalt: 19, rad1h: -, wcc: 100, wid: 3, rr1c: 0.00, pvrl: 835, con: 1288, gcons: 28, temp: 10
2025051809 => hod: 09, nod: So, sunaz: 93, sunalt: 28, rad1h: -, wcc: 100, wid: 3, rr1c: 0.00, pvrl: 2649, con: 1603, gcons: 35, temp: 11
2025051810 => hod: 10, nod: So, sunaz: 106, sunalt: 37, rad1h: -, wcc: 74, wid: 2, rr1c: 0.00, pvrl: 4350, con: 976, gcons: 20, temp: 12
2025051811 => hod: 11, nod: So, sunaz: 121, sunalt: 46, rad1h: -, wcc: 80, wid: 2, rr1c: 0.00, pvrl: 3453, con: 913, gcons: 24, temp: 13
2025051812 => hod: 12, nod: So, sunaz: 140, sunalt: 53, rad1h: -, wcc: 60, wid: 3, rr1c: 0.00, pvrl: 2037, con: 888, gcons: 15, temp: 15
2025051813 => hod: 13, nod: So, sunaz: 163, sunalt: 58, rad1h: -, wcc: 52, wid: 2, rr1c: 0.00, pvrl: 3474, con: 1156, gcons: 43, temp: 15
2025051814 => hod: 14, nod: So, sunaz: 190, sunalt: 58, rad1h: -, wcc: 96, wid: 3, rr1c: 0.20, pvrl: 2350, con: 844, gcons: 32, temp: 15
2025051815 => hod: 15, nod: So, sunaz: 214, sunalt: 55, rad1h: -, wcc: 20, wid: 80, rr1c: 0.00, pvrl: 4184, con: 1015, gcons: 10, temp: 15
2025051816 => hod: 16, nod: So, sunaz: 235, sunalt: 48, rad1h: -, wcc: 51, wid: 2, rr1c: 0.00, pvrl: 2127, con: 612, gcons: 3, temp: 16
2025051817 => hod: 17, nod: So, sunaz: 250, sunalt: 40, rad1h: -, wcc: 92, wid: 3, rr1c: 0.00, pvrl: 3355, con: 1920, gcons: 58, temp: 16
2025051818 => hod: 18, nod: So, sunaz: 264, sunalt: 30, rad1h: -, wcc: 100, wid: 3, rr1c: 0.00, pvrl: 1168, con: 1550, gcons: 57, temp: 16
2025051819 => hod: 19, nod: So, sunaz: 276, sunalt: 21, rad1h: -, wcc: 100, wid: 3, rr1c: 0.00, pvrl: 956, con: 633, gcons: 26, temp: 15
2025051820 => hod: 20, nod: So, sunaz: 287, sunalt: 12, rad1h: -, wcc: 34, wid: 2, rr1c: 0.00, pvrl: 418, con: 676, gcons: 23, temp: 14
2025051821 => hod: 21, nod: So, sunaz: 298, sunalt: 4, rad1h: -, wcc: 44, wid: 2, rr1c: 0.00, pvrl: 96, con: 601, gcons: 24, temp: 13
2025051822 => hod: 22, nod: So, sunaz: 310, sunalt: -4, rad1h: -, wcc: 98, wid: 3, rr1c: 0.00, pvrl: -, con: 714, gcons: 23, temp: 13
NextHour00 => starttime: 2025-05-18 23:00:00, day: 18, hourofday: 24, today: 1
pvapifc: 0, pvaifc: -, pvfc: 0, aihit: 0
confc: 22, confcEx: 22, weatherid: 103, wcc: 98, rr1c: 0.00, temp=12.20
rad1h: 0, sunaz: 336, sunalt: -16, DoN: 0
rrange: 0.00, crange: -, DaysInRange: -, correff: 1.00/-
soc01: -, soc02: -, soc03: -, socprogwhsum: -
rcdchargebat01: -, rcdchargebat02: -, rcdchargebat03: -
NextHour01 => starttime: 2025-05-19 00:00:00, day: 19, hourofday: 01, today: 0
pvapifc: 0, pvaifc: -, pvfc: 0, aihit: 0
confc: 22, confcEx: 22, weatherid: 103, wcc: 100, rr1c: 0.00, temp=11.80
rad1h: 0, sunaz: 350, sunalt: -18, DoN: 0
rrange: 0.00, crange: -, DaysInRange: -, correff: 1.00/-
soc01: -, soc02: -, soc03: -, socprogwhsum: -
rcdchargebat01: -, rcdchargebat02: -, rcdchargebat03: -
NextHour02 => starttime: 2025-05-19 01:00:00, day: 19, hourofday: 02, today: 0
pvapifc: 0, pvaifc: -, pvfc: 0, aihit: 0
confc: 22, confcEx: 22, weatherid: 103, wcc: 100, rr1c: 0.00, temp=11.10
rad1h: 0, sunaz: 5, sunalt: -19, DoN: 0
rrange: 0.00, crange: -, DaysInRange: -, correff: 1.00/-
soc01: -, soc02: -, soc03: -, socprogwhsum: -
rcdchargebat01: -, rcdchargebat02: -, rcdchargebat03: -
NextHour03 => starttime: 2025-05-19 02:00:00, day: 19, hourofday: 03, today: 0
pvapifc: 0, pvaifc: -, pvfc: 0, aihit: 0
confc: 22, confcEx: 22, weatherid: 103, wcc: 100, rr1c: 0.00, temp=10.50
rad1h: 0, sunaz: 20, sunalt: -17, DoN: 0
rrange: 0.00, crange: -, DaysInRange: -, correff: 1.00/-
soc01: -, soc02: -, soc03: -, socprogwhsum: -
rcdchargebat01: -, rcdchargebat02: -, rcdchargebat03: -
NextHour04 => starttime: 2025-05-19 03:00:00, day: 19, hourofday: 04, today: 0
pvapifc: 0, pvaifc: -, pvfc: 0, aihit: 0
confc: 21, confcEx: 21, weatherid: 102, wcc: 75, rr1c: 0.00, temp=10.10
rad1h: 0, sunaz: 34, sunalt: -12, DoN: 0
rrange: 0.00, crange: -, DaysInRange: -, correff: 1.00/-
soc01: -, soc02: -, soc03: -, socprogwhsum: -
Zitat von: DS_Starter am 12 Mai 2025, 22:33:17Hallo Kai,
ich sehe bei dir keinen Fehler und habe deswegen bei mir zwei Instanzen nachgestellt.
..........
2025.05.18 22:11:20 1: PERL WARNING: Argument "" isn't numeric in numeric lt (<) at (eval 19697) line 20.
2025.05.18 22:11:20 3: eval: {
my $mode = 'measure_power@green';;
$mode = 'measure_power@yellow' if (ReadingsNum($name, "Wirkleistung", "") < 1);;
my $dc_sum = ReadingsNum($name,"DC_Leistung",0);
my $mode2 = 'sani_solar@green';;
$mode2 = 'sani_solar@yellow' if ($dc_sum < 1);;
my $mode3 = 'solar@green';;
$mode3 = 'solar@yellow' if (ReadingsNum($name,"DC_Leistung_1",0) < 1);;
my $mode4 = 'solar@green';;
$mode4 = 'solar@yellow' if (ReadingsNum($name,"DC_Leistung_2",0) < 1);;
my $chargePw = ReadingsNum($name, "Batterieleistung", "");;
my $chargePCT = ReadingsNum($name, "Ladezustand", "");;
my $charge = '';;
$charge = 'control_arrow_leftward@greenyellow' if ($chargePw < 0);;
$charge = 'control_arrow_rightward@green' if ($chargePw > 0);;
my $ChargeStatus = 'measure_battery_100@green';;
$ChargeStatus = 'measure_battery_75@green' if ($chargePCT < 80);;
$ChargeStatus = 'measure_battery_50@yellow' if ($chargePCT < 55);;
$ChargeStatus = 'measure_battery_25@orange' if ($chargePCT < 30);;
$ChargeStatus = 'measure_battery_0@red' if ($chargePCT < 6);;
my $Cap = ($chargePCT -5) * 190;
"<div>" .
FW_makeImage($mode,"measure_power") ." AC ". ReadingsVal($name,"Wirkleistung",0) ."W ".
FW_makeImage($mode2,"sani_solar") ." DC ".$dc_sum."W ".
FW_makeImage($mode3,"solar") ." MPP1 ".ReadingsVal($name,"DC_Leistung_1",0)."W ".
FW_makeImage($mode4,"solar") ." MPP2 ".ReadingsVal($name,"DC_Leistung_2",0)."W </br>".
FW_makeImage($ChargeStatus,"") .
FW_makeImage($charge,"") ." ". $chargePw ."W ".
$chargePCT ."% ".
$Cap."wh ".
"</div>"}
Bevor ich morgen das SF Attr. ctrlUserExitFn ausprobiere, würde ich gerne das Log klar haben. Was läuft da falsch? (ich weiss, es ist nur eine Warnung, aber alle zwanzig Sekunden ist zu viel /usr/bin/owserver -c /etc/owfs.conf --error_level=9 --error_print=2 --foreground
DEBUG: ow_daemon.c:(170) main thread id = 125925584654656
CONNECT: ow_dnssd.c:(75) DL_open [libdns_sd.so] success
DEBUG: ow_dnssd.c:(85) Linked in Bonjour function DNSServiceRefSockFD
DEBUG: ow_dnssd.c:(86) Linked in Bonjour function DNSServiceProcessResult
DEBUG: ow_dnssd.c:(87) Linked in Bonjour function DNSServiceRefDeallocate
DEBUG: ow_dnssd.c:(88) Linked in Bonjour function DNSServiceResolve
DEBUG: ow_dnssd.c:(89) Linked in Bonjour function DNSServiceBrowse
DEBUG: ow_dnssd.c:(90) Linked in Bonjour function DNSServiceRegister
DEBUG: ow_dnssd.c:(91) Linked in Bonjour function DNSServiceReconfirmRecord
DEBUG: ow_dnssd.c:(92) Linked in Bonjour function DNSServiceCreateConnection
DEBUG: ow_dnssd.c:(93) Linked in Bonjour function DNSServiceEnumerateDomains
CALL: ow_parsename.c:(174) path=[]
DEBUG: owlib.c:(77) Global temp limit 0C to 100C (for fake and mock adapters)
DEBUG: ow_net_client.c:(28) Called with 192.168.179.70:5000 default=4304
DEBUG: ow_regex.c:(24) Reg Ex expression <^$> compiled to 0x72875643eba0
DEBUG: ow_regex.c:(24) Reg Ex expression <^all$> compiled to 0x72875643eb60
DEBUG: ow_regex.c:(24) Reg Ex expression <^scan$> compiled to 0x72875643eb20
DEBUG: ow_regex.c:(24) Reg Ex expression <^\*$> compiled to 0x72875643eae0
DEBUG: ow_regex.c:(24) Reg Ex expression <^[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}$> compiled to 0x72875643eaa0
DEBUG: ow_regex.c:(24) Reg Ex expression <^-?[[:digit:]]+$> compiled to 0x72875643ea60
]*$> compiled to 0x72875643ea20 expression <^ *([^ ]+)[
]*$> compiled to 0x72875643e9e0 expression <^ *([^ ]+) *: *([^ ]+)[
]*$> compiled to 0x72875643e9a0 expression <^ *([^ ]+) *: *([^ ]+) *: *([^ ]+)[
DEBUG: ow_regex.c:(53) Not found
DEBUG: ow_regex.c:(100) 0: 0->19 found <><192.168.179.70:5000><>
DEBUG: ow_regex.c:(100) 1: 0->14 found <><192.168.179.70><:5000>
DEBUG: ow_regex.c:(100) 2: 15->19 found <192.168.179.70:><5000><>
DEBUG: ow_parse_address.c:(80) IP <192.168.179.70>
DEBUG: ow_parse_address.c:(142) First <192.168.179.70>
DEBUG: ow_parse_address.c:(147) Second <5000>
DEBUG: ow_parse_address.c:(84) Num <5000> 5000
DEBUG: ow_net_client.c:(85) Called with [192.168.179.70:5000] IP address=[192.168.179.70] port=[5000]
DEBUG: ow_net_server.c:(76) ServerAddr: [0.0.0.0] [4304]
*** WARNING *** The program 'owserver' uses the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see <http://0pointer.de/blog/projects/avahi-compat.html>