diff --git a/46_TeslaPowerwall2AC.pm b/46_TeslaPowerwall2AC.pm index 2910497..354d1ce 100644 --- a/46_TeslaPowerwall2AC.pm +++ b/46_TeslaPowerwall2AC.pm @@ -457,21 +457,21 @@ sub Write($) { ); # #### temporär - # ErrorHandling( - # { - # url => 'http://' . $uri, - # timeout => 5, - # method => $method, - # data => $data, - # header => $header, - # hash => $hash, - # setCmd => $path, - # doTrigger => 1, - # callback => \&ErrorHandling, - # }, - # undef, - # '{"none": "none"}' - # ); +# ErrorHandling( +# { +# url => 'http://' . $uri, +# timeout => 5, +# method => $method, +# data => $data, +# header => $header, +# hash => $hash, +# setCmd => $path, +# doTrigger => 1, +# callback => \&ErrorHandling, +# }, +# undef, +# '{"none": "none"}' +# ); Log3 $name, 4, "TeslaPowerwall2AC ($name) - Send with URI: https://$uri"; } @@ -487,113 +487,14 @@ sub ErrorHandling($$$) { unless ( defined($err) and $err); - # my $path = $param->{setCmd}; # temporär +# my $path = $param->{setCmd}; # temporär # #### temporär # if ( $path eq 'statussoe' ) { # $data = '{"percentage":69.1675560298826}'; # } # elsif ( $path eq 'aggregates' ) { -# $data = '{ -# "site":{ -# "last_communication_time":"2018-04-02T16:11:41.885377469-07:00", -# "instant_power":-21.449996948242188, -# "instant_reactive_power":-138.8300018310547, -# "instant_apparent_power":140.47729986545957, -# "frequency":60.060001373291016, -# "energy_exported":1136916.6875890202, -# "energy_imported":3276432.6625890196, -# "instant_average_voltage":239.81999969482422, -# "instant_total_current":0, -# "i_a_current":0, -# "i_b_current":0, -# "i_c_current":0 -# }, -# "battery":{ -# "last_communication_time":"2018-04-02T16:11:41.89022247-07:00", -# "instant_power":-2350, -# "instant_reactive_power":0, -# "instant_apparent_power":2350, -# "frequency":60.033, -# "energy_exported":1169030, -# "energy_imported":1638140, -# "instant_average_voltage":239.10000000000002, -# "instant_total_current":45.8, -# "i_a_current":0, -# "i_b_current":0, -# "i_c_current":0 -# }, -# "load":{ -# "last_communication_time":"2018-04-02T16:11:41.885377469-07:00", -# "instant_power":1546.2712597712405, -# "instant_reactive_power":-71.43153973801415, -# "instant_apparent_power":1547.920305979569, -# "frequency":60.060001373291016, -# "energy_exported":0, -# "energy_imported":7191016.994444443, -# "instant_average_voltage":239.81999969482422, -# "instant_total_current":6.44763264839839, -# "i_a_current":0, -# "i_b_current":0, -# "i_c_current":0 -# }, -# "solar":{ -# "last_communication_time":"2018-04-02T16:11:41.885541803-07:00", -# "instant_power":3906.1700439453125, -# "instant_reactive_power":53.26999855041504, -# "instant_apparent_power":3906.533259164868, -# "frequency":60.060001373291016, -# "energy_exported":5534272.949724403, -# "energy_imported":13661.930279959455, -# "instant_average_voltage":239.8699951171875, -# "instant_total_current":0, -# "i_a_current":0, -# "i_b_current":0, -# "i_c_current":0 -# }, -# "busway":{ -# "last_communication_time":"0001-01-01T00:00:00Z", -# "instant_power":0, -# "instant_reactive_power":0, -# "instant_apparent_power":0, -# "frequency":0, -# "energy_exported":0, -# "energy_imported":0, -# "instant_average_voltage":0, -# "instant_total_current":0, -# "i_a_current":0, -# "i_b_current":0, -# "i_c_current":0 -# }, -# "frequency":{ -# "last_communication_time":"0001-01-01T00:00:00Z", -# "instant_power":0, -# "instant_reactive_power":0, -# "instant_apparent_power":0, -# "frequency":0, -# "energy_exported":0, -# "energy_imported":0, -# "instant_average_voltage":0, -# "instant_total_current":0, -# "i_a_current":0, -# "i_b_current":0, -# "i_c_current":0 -# }, -# "generator":{ -# "last_communication_time":"0001-01-01T00:00:00Z", -# "instant_power":0, -# "instant_reactive_power":0, -# "instant_apparent_power":0, -# "frequency":0, -# "energy_exported":0, -# "energy_imported":0, -# "instant_average_voltage":0, -# "instant_total_current":0, -# "i_a_current":0, -# "i_b_current":0, -# "i_c_current":0 -# } -# }'; +# $data = '{"site":{"last_communication_time":"2019-09-28T01:18:08.789827048-07:00","instant_power":19.98255157470703,"instant_reactive_power":-250.38783884048462,"instant_apparent_power":251.18394098079662,"frequency":49.99971389770508,"energy_exported":8343253.28995022,"energy_imported":3918908.6732835528,"instant_average_voltage":229.0396474202474,"instant_total_current":0,"i_a_current":0,"i_b_current":0,"i_c_current":0,"timeout":1500000000},"battery":{"last_communication_time":"2019-09-28T01:18:08.790449046-07:00","instant_power":-480,"instant_reactive_power":0,"instant_apparent_power":480,"frequency":49.989000000000004,"energy_exported":3864090,"energy_imported":4474680,"instant_average_voltage":231.20000000000002,"instant_total_current":9.4,"i_a_current":0,"i_b_current":0,"i_c_current":0,"timeout":1500000000},"load":{"last_communication_time":"2019-09-28T01:18:08.789827048-07:00","instant_power":763.0661269030993,"instant_reactive_power":-139.88348897886516,"instant_apparent_power":775.7817376787089,"frequency":49.99971389770508,"energy_exported":0,"energy_imported":14000112.403333334,"instant_average_voltage":229.0396474202474,"instant_total_current":3.331589685444317,"i_a_current":0,"i_b_current":0,"i_c_current":0,"timeout":1500000000},"solar":{"last_communication_time":"2019-09-28T01:18:08.79021638-07:00","instant_power":1223.3705749511719,"instant_reactive_power":111.61752128601074,"instant_apparent_power":1228.4518853884324,"frequency":49.99971389770508,"energy_exported":19079749.482032932,"energy_imported":44702.4620329314,"instant_average_voltage":228.65799967447916,"instant_total_current":0,"i_a_current":0,"i_b_current":0,"i_c_current":0,"timeout":1500000000}}'; # } # elsif ( $path eq 'siteinfo' ) { # $data = '{"site":{"last_communication_time":"2019-09-22T00:21:15.389963162-07:00","instant_power":24.451171875,"instant_reactive_power":53.17060422897339,"instant_apparent_power":58.52326853598416,"frequency":49.99971389770508,"energy_exported":8317850.641600119,"energy_imported":3906677.3213223405,"instant_average_voltage":228.2313995361328,"instant_total_current":0,"i_a_current":0,"i_b_current":0,"i_c_current":0,"timeout":1500000000},"battery":{"last_communication_time":"2019-09-22T00:21:15.501660598-07:00","instant_power":1350,"instant_reactive_power":-30,"instant_apparent_power":1350.3332921912279,"frequency":49.994,"energy_exported":3816030,"energy_imported":4422670,"instant_average_voltage":235,"instant_total_current":-31.8,"i_a_current":0,"i_b_current":0,"i_c_current":0,"timeout":1500000000},"load":{"last_communication_time":"2019-09-22T00:21:15.389963162-07:00","instant_power":5728.583274805815,"instant_reactive_power":-175.17854151916174,"instant_apparent_power":5731.261105358374,"frequency":49.99971389770508,"energy_exported":0,"energy_imported":13885698.406388888,"instant_average_voltage":228.2313995361328,"instant_total_current":25.0998911037168,"i_a_current":0,"i_b_current":0,"i_c_current":0,"timeout":1500000000},"solar":{"last_communication_time":"2019-09-22T00:21:15.506420255-07:00","instant_power":4363.2269287109375,"instant_reactive_power":-196.4273910522461,"instant_apparent_power":4367.646156842822,"frequency":49.99971389770508,"energy_exported":18947820.8881397,"energy_imported":44309.16147303224,"instant_average_voltage":227.83099365234375,"instant_total_current":0,"i_a_current":0,"i_b_current":0,"i_c_current":0,"timeout":1500000000}}'; @@ -605,117 +506,17 @@ sub ErrorHandling($$$) { # $data = '{"powerwalls":[{"PackagePartNumber":"1092170-03-E","PackageSerialNumber":"T1234567890"},{"PackagePartNumber":"1092170-03-E","PackageSerialNumber":"T1234567891"}],"has_sync":true}'; # } # elsif ( $path eq 'status' ) { -# $data = '{"start_time":"2018-03-16 19:08:46 +0800","up_time_seconds":"402h8m19.937911668s","is_new":false,"version":"1.15.0\n","git_hash":"dc337851c6cad15a7e9c7223d60fff719eb8da4d\n"}'; +# $data = '{"start_time":"2019-09-23 23:59:36 +0800","up_time_seconds":"97h18m32.139207194s","is_new":false,"version":"1.40.2","git_hash":"14f7c1769ec307bba2ea62355a09d01c8e58988c+"}'; # } # elsif ( $path eq 'meterssite' ) { -# $data = '[ -# { -# "id":0, -# "location":"site", -# "type":"neurio_tcp", -# "cts":[ -# true, -# true, -# false, -# false -# ], -# "inverted":[ -# false, -# false, -# false, -# false -# ], -# "connection":{ -# "ip_address":"Neurio-39546", -# "port":443, -# "short_id":"39546", -# "device_serial":"OBB3364102752", -# "neurio_connected":true, -# "https_conf":{ -# "client_cert":"/etc/site/certs/neurio/neurio.crt", -# "client_key":"/etc/site/certs/neurio/neurio.key", -# "server_ca_cert":"/etc/site/certs/neurio/neurio-ca-chain.cert.pem", -# "max_idle_conns_per_host":1 -# } -# }, -# "Cached_readings":{ -# "last_communication_time":"2018-06-10T16:51:46.187715089+01:00", -# "instant_power":13.94000026769936, -# "instant_reactive_power":14.070000305771828, -# "instant_apparent_power":19.80627466405224, -# "frequency":49.95000076293945, -# "energy_exported":3724.253888912031, -# "energy_imported":26003.843888912033, -# "instant_average_voltage":247.52999755740166, -# "instant_total_current":0, -# "i_a_current":0, -# "i_b_current":0, -# "i_c_current":0, -# "v_l1n":247.3300018310547, -# "v_l2n":0.2199999988079071, -# "serial_number":"0x000004714B008720", -# "version":"Tesla-0.0.7" -# } -# } -# ]'; +# $data = '[{"id":0,"location":"site","type":"neurio_mb","cts":[true,true,true,false],"inverted":[false,false,false,false],"connection":{"serial_port":"/dev/ttymxc1","baud":115200,"modbus_id":1,"short_id":"Tesla-0.0.7(2)","device_serial":"0x000004714B001C4B","neurio_connected":true,"disable_echo":true,"https_conf":{}},"Cached_readings":{"last_communication_time":"2019-09-28T01:18:08.589649117-07:00","instant_power":15.785774230957031,"instant_reactive_power":-252.12418460845947,"instant_apparent_power":252.61788363564307,"frequency":49.99971389770508,"energy_exported":8343253.28995022,"energy_imported":3918908.6732835528,"instant_average_voltage":229.02874755859375,"instant_total_current":0,"i_a_current":0,"i_b_current":0,"i_c_current":0,"v_l1n":231.59939575195312,"v_l2n":229.5283660888672,"v_l3n":226.0482177734375,"real_power_a":205.61331176757812,"real_power_b":-42.59746551513672,"real_power_c":-147.23007202148438,"reactive_power_a":-139.41871643066406,"reactive_power_b":-119.14984130859375,"reactive_power_c":8.341647148132324,"serial_number":"0x000004714B001C4B","version":"Tesla-0.0.7(2)","timeout":1500000000}}]'; # } -# elsif ( $path eq 'meterssolar' ) { -# $data = '[ -# { -# "id":0, -# "location":"solar", -# "type":"neurio_tcp", -# "cts":[ -# false, -# false, -# false, -# true -# ], -# "inverted":[ -# false, -# false, -# false, -# false -# ], -# "connection":{ -# "ip_address":"Neurio-39546", -# "port":443, -# "short_id":"39546", -# "device_serial":"OBB3364102752", -# "neurio_connected":true, -# "https_conf":{ -# "client_cert":"/etc/site/certs/neurio/neurio.crt", -# "client_key":"/etc/site/certs/neurio/neurio.key", -# "server_ca_cert":"/etc/site/certs/neurio/neurio-ca-chain.cert.pem", -# "max_idle_conns_per_host":1 -# } -# }, -# "Cached_readings":{ -# "last_communication_time":"2018-06-10T16:52:57.788560639+01:00", -# "instant_power":318.8599853515625, -# "instant_reactive_power":129.94000244140625, -# "instant_apparent_power":344.3197561756678, -# "frequency":49.95000076293945, -# "energy_exported":3.8174999999938235, -# "energy_imported":125317.00444444444, -# "instant_average_voltage":246.82000732421875, -# "instant_total_current":0, -# "i_a_current":0, -# "i_b_current":0, -# "i_c_current":0, -# "v_l1n":246.8800048828125, -# "serial_number":"0x000004714B008720", -# "version":"Tesla-0.0.7" -# } -# } -# ]'; -# } -# +# # elsif ( $path eq 'gridstatus' ) { # $data = '{"grid_status":"SystemGridConnected"}'; # } # elsif ( $path eq 'sitename' ) { -# $data = '{"site_name":"Home Energy Gateway","timezone":"America/Los_Angeles"}'; +# $data = '{"site_name":"Meine Powerwall2AC","timezone":"Europe/Berlin"}'; # } ### Begin Error Handling @@ -809,7 +610,7 @@ sub ErrorHandling($$$) { unless ( defined($err) and $err); - # ResponseProcessing( $hash, $param->{setCmd}, $data ); + ResponseProcessing( $hash, $param->{setCmd}, $data ); } sub ResponseProcessing($$$) { @@ -1202,7 +1003,7 @@ sub CreateUri($$) { ], "release_status": "under develop", "license": "GPL_2", - "version": "v0.6.111", + "version": "v0.6.112", "author": [ "Marko Oldenburg " ],