############################################################################### # # Developed with Kate # # (c) 2017-2021 Copyright: Marko Oldenburg (fhemdevelopment at cooltux dot net) # All rights reserved # # This script is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # any later version. # # The GNU General Public License can be found at # http://www.gnu.org/copyleft/gpl.html. # A copy is found in the textfile GPL.txt and important notices to the license # from the author is found in LICENSE.txt distributed with these scripts. # # This script is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # # $Id$ # ############################################################################### ## ## ## Das JSON Modul immer in einem eval aufrufen # $data = eval{decode_json($data)}; # # if($@){ # Log3($SELF, 2, "$TYPE ($SELF) - error while request: $@"); # # readingsSingleUpdate($hash, "state", "error", 1); # # return; # } # ####### ####### # URLs zum Abrufen diverser Daten # https:///api/system_status/soe # https:///api/meters/aggregates # https:///api/site_info # https:///api/sitemaster # https:///api/powerwalls # https:///api/networks # https:///api/system/networks # https:///api/operation # ## ## package FHEM::TeslaPowerwall2AC; use strict; use warnings; use FHEM::Meta; use GPUtils qw(GP_Export); require FHEM::Devices::Tesla::Powerwall; #-- Run before package compilation BEGIN { #-- Export to main context with different name GP_Export( qw( Initialize ) ); } sub Initialize { my $hash = shift; $hash->{GetFn} = \&FHEM::Devices::Tesla::Powerwall::Get; $hash->{SetFn} = \&FHEM::Devices::Tesla::Powerwall::Set; $hash->{DefFn} = \&FHEM::Devices::Tesla::Powerwall::Define; $hash->{UndefFn} = \&FHEM::Devices::Tesla::Powerwall::Undef; $hash->{NotifyFn} = \&FHEM::Devices::Tesla::Powerwall::Notify; $hash->{RenameFn} = \&FHEM::Devices::Tesla::Powerwall::Rename; $hash->{AttrFn} = \&FHEM::Devices::Tesla::Powerwall::Attr; $hash->{AttrList} = 'interval ' . 'disable:1 ' . 'devel:1 ' . 'emailaddr ' . $::readingFnAttributes; $hash->{parseParams} = 1; return FHEM::Meta::InitMod( __FILE__, $hash ); } 1; =pod =item device =item summary Modul to retrieves data from a Tesla Powerwall 2AC =item summary_DE =begin html

Tesla Powerwall 2 AC

    TeslaPowerwall2AC - Retrieves data from a Tesla Powerwall 2AC System
    With this module it is possible to read the data from a Tesla Powerwall 2AC and to set it as reading.

    Define

      define <name> TeslaPowerwall2AC <HOST>

      Example:

        define myPowerWall TeslaPowerwall2AC 192.168.1.34

      This statement creates a Device with the name myPowerWall and the Host IP 192.168.1.34.
      After the device has been created, the current data of Powerwall is automatically read from the device.


    Readings
    • actionQueue - information about the entries in the action queue
    • aggregates-* - readings of the /api/meters/aggregates response
    • batteryLevel - battery level in percent
    • batteryPower - battery capacity in kWh
    • powerwalls-* - readings of the /api/powerwalls response
    • registration-* - readings of the /api/customer/registration response
    • siteinfo-* - readings of the /api/site_info response
    • sitemaster-* - readings of the /api/sitemaster response
    • state - information about internel modul processes
    • status-* - readings of the /api/status response
    • statussoe-* - readings of the /api/system_status/soe response
    • setPassword - write password encrypted to password file
    • removePassword - remove password from password file
    get
    • aggregates - fetch data from url path /api/meters/aggregates
    • powerwalls - fetch data from url path /api/powerwalls
    • registration - fetch data from url path /api/customer/registration
    • siteinfo - fetch data from url path /api/site_info
    • sitemaster - fetch data from url path /api/sitemaster
    • status - fetch data from url path /api/status
    • statussoe - fetch data from url path /api/system_status/soe


    set
    • removePassword - remove password from password file
    • setPassword - save password in passswordfile ATTANTION!!! text must begin with pass= (Example: pass=meinpassword)


    Attribute
    • interval - interval in seconds for automatically fetch data (default 300)
    • emailaddr - emailadress to get cookie token
=end html =begin html_DE

Tesla Powerwall 2 AC

=end html_DE =for :application/json;q=META.json 46_TeslaPowerwall2AC.pm { "abstract": "Modul to retrieves data from a Tesla Powerwall 2AC", "x_lang": { "de": { "abstract": "" } }, "keywords": [ "fhem-mod-device", "fhem-core", "Power", "Tesla", "AC", "Powerwall", "Control" ], "release_status": "stable", "license": "GPL_2", "version": "v2.0.0", "author": [ "Marko Oldenburg " ], "x_fhem_maintainer": [ "CoolTux" ], "x_fhem_maintainer_github": [ "LeonGaultier" ], "prereqs": { "runtime": { "requires": { "FHEM": 5.00918799, "perl": 5.016, "Meta": 0, "JSON": 0, "Date::Parse": 0 }, "recommends": { }, "suggests": { } } } } =end :application/json;q=META.json =cut