+ Antworten
Seite 1 von 2 1 2 LetzteLetzte
Ergebnis 1 bis 10 von 11

Thema: Tesla - api

  1. #1
    Registriert seit
    Feb 2011
    Beiträge
    627

    Standard Tesla - api

    Moin zusammen,

    gibt es hier irgend jemanden der eventuell schon still und heimlich seinen TELSA mit IPS abfragt ?
    Eine API dafür gibt es ja und "eigentlich" auch schon ein Script (TESLA4IPS) bei GitHub, aber das ist schon etwas angestaubt und ich bekomme es einfach nicht zum laufen.

    ich hab das Script mit minimalen Anpassungen installiert ( $_IPS['SELF'] & $_IPS['SENDER'] ), aber bekomme keine Werte in IPS 5.1
    Irgend eine Idee woran es liegt ?

    PHP-Code:
    <?
    require_once("standardinclude.php"); //Hilfs-Script
    $instanceName="Tesla Control"//Name der Dummy Instanz für das "Gerät" Tesla
    class SimpleTeslaAPI {
    // !!!!!!!!! Hier Token und vehicle_id von z.B. RemoteS einsetzen !!!!!!!!!
        
    var $token"hierdentokenrein";
        var 
    $vehicleID "hierdievehicleidrein";
        
        
    // Namen der anzulegenden VAriablen.
        // Nach der Installation sollten diese nicht mehr verändert werden!
         
    var $varInnentemperatur 'Innentemperatur';
          var 
    $varAussentemperatur 'Aussentemperatur';
          var 
    $varTempFahrer 'TempFahrer';
          var 
    $varTempBeifahrer 'TempBeifahrer';
          var 
    $varKlimaState 'Klima';
          var 
    $varName 'Name';
          var 
    $varSchiebedach 'Schiebedach';
          var 
    $varVerriegelt 'Auto';
            var 
    $varVerriegeln 'Verriegeln';
          var 
    $varEntriegeln 'Entriegeln';
          var 
    $varVersion 'Version';
          
          
          var 
    $varHupe 'Hupe';
           var 
    $varLicht 'Lichthupe';
          var 
    $varChargeState="Ladestatus";
          var 
    $varChargeTriggerStart="LadenStarten";
          var 
    $varChargeTriggerStop="LadenUnterbrechen";
          var 
    $varChargeLimit="Ladelimit";
          var 
    $varChargeSOC="SOC";
          var 
    $varChargePort="Ladeport"//tbd
          
    var $varBatteryHeater="Batterieheizung";
          var 
    $varTypicalRange="RWIdeal";
          var 
    $varEstimatedRange="RWTypisch";
          var 
    $varIdealRange="RWGeschaetzt";
        
    // Namen für individulle Profile
          
    var $profileKM="TESLAKM";
          var 
    $profileButton="TESLATrigger";
          var 
    $profileChargeRange="TESLACharge";
        
    //Trigger Button Farbe
          
    var $colTriggerButton="0x0000FF";
        
        
    //TESLA API Url
        
    var $url 'https://owner-api.teslamotors.com/';
        
        var 
    $parentID;
        function 
    SimpleTeslaAPI($parentID){
            
    $this->parentID=$parentID;
        }
         
    //Funktion zum Auslesen der Klima Daten und Schreiben in die Variablen
        
    function readClimateState2Variable() {
               
    $climate=$this->climate_state();
                 
    UpdateIPSvar($this->parentID,$this->varInnentemperatur,($climate->{'response'}->{'inside_temp'}),2);
                 
    UpdateIPSvar($this->parentID,$this->varAussentemperatur,($climate->{'response'}->{'outside_temp'}),2);
                
    UpdateIPSvar($this->parentID,$this->varTempFahrer,($climate->{'response'}->{'driver_temp_setting'}),2);
                 
    UpdateIPSvar($this->parentID,$this->varTempBeifahrer,($climate->{'response'}->{'passenger_temp_setting'}),2);
                
    $climateActive=($climate->{'response'}->{'fan_status'}>0);
                echo 
    "Lüftung ist ".$climateActive;
                
    UpdateIPSvar($this->parentID,$this->varKlimaState,$climateActive,0);
        }
        
         
    //Funktion zum Auslesen der Fzg Daten und Schreiben in die Variablen
        
    function readVehicleState2Variable() {
                  
    $vehicle_state =$this->vehicle_state();
               
    UpdateIPSvar($this->parentID,$this->varName,($vehicle_state->{'response'}->{'vehicle_name'}),3);
                
    UpdateIPSvar($this->parentID,$this->varSchiebedach,($vehicle_state->{'response'}->{'sun_roof_percent_open'}),1);
                
    UpdateIPSvar($this->parentID,$this->varVerriegelt,$vehicle_state->{'response'}->{'locked'},0);
                
    UpdateIPSvar($this->parentID,$this->varVersion,($vehicle_state->{'response'}->{'car_version'}),3);
            }
            
             function 
    readChargeState2Variable() {
                  
    $charge_state =$this->charge_state();
                
    UpdateIPSvar($this->parentID,$this->varChargeState,($charge_state->{'response'}->{'charging_state'}),3);
                
    UpdateIPSvar($this->parentID,$this->varChargeLimit,($charge_state->{'response'}->{'charge_limit_soc'}),1);
                
    UpdateIPSvar($this->parentID,$this->varChargeSOC,($charge_state->{'response'}->{'battery_level'}),1);
                
    UpdateIPSvar($this->parentID,$this->varBatteryHeater,($charge_state->{'response'}->{'battery_heater_on'}),0);
                
    UpdateIPSvar($this->parentID,$this->varTypicalRange,($charge_state->{'response'}->{'battery_range'}/0.621371),2);
                
    UpdateIPSvar($this->parentID,$this->varEstimatedRange,($charge_state->{'response'}->{'est_battery_range'}/0.621371),2);
                
    UpdateIPSvar($this->parentID,$this->varIdealRange,($charge_state->{'response'}->{'ideal_battery_range'}/0.621371),2);
                
             
    UpdateIPSvar($this->parentID,$this->varChargeTriggerStop,1,1);
                
    UpdateIPSvar($this->parentID,$this->varChargeTriggerStart,1,1);
                if(
    $charge_state->{'response'}->{'charging_state'}=="Charging"){
                     
    IPS_SetHidden(IPS_GetVariableIDByName($this->varChargeTriggerStop,$this->parentID),false);
                    
    IPS_SetHidden(IPS_GetVariableIDByName($this->varChargeTriggerStart,$this->parentID),true);
                }else if(
    $charge_state->{'response'}->{'charging_state'}=="Stopped"){
                     
    IPS_SetHidden(IPS_GetVariableIDByName($this->varChargeTriggerStop,$this->parentID),true);
                    
    IPS_SetHidden(IPS_GetVariableIDByName($this->varChargeTriggerStart,$this->parentID),false);
                }else if(
    $charge_state->{'response'}->{'charging_state'}=="Complete"){
                     
    IPS_SetHidden(IPS_GetVariableIDByName($this->varChargeTriggerStop,$this->parentID),true);
                    
    IPS_SetHidden(IPS_GetVariableIDByName($this->varChargeTriggerStart,$this->parentID),true);
                }
                
                
                
            }
            
        
    //Funktion zum Auslesen der Drive Daten und Schreiben in die Variablen
        
    function readDriveState2Variable() {
               
    $drive_state =$this->drive_state();
                  
    UpdateIPSvar($this->parentID,'GoogleMaps URL',"\nhttp://maps.google.com/?q=" $drive_state->{'response'}->{'latitude'} . "," $drive_state->{'response'}->{'longitude'},3);
         }
        
        private function 
    curlexec($command,$mode="GET",$params=array()) {
            
              
    $url=$this->url;
            
    $ch curl_init();
            
    curl_setopt($ch,CURLOPT_SSL_VERIFYPEERfalse);
            
    curl_setopt($ch,CURLOPT_RETURNTRANSFERtrue);
            
    $params['vehicle_id']=$this->vehicleID;
            if ( 
    $mode == "POST" ) {
                if ( 
    $command == "oauth/token" ) {
                    
    curl_setopt($ch,CURLOPT_URL$url.$command);
                } else {
                    if ( 
    $command == "wake_up" ) {
                        
    curl_setopt($ch,CURLOPT_URL$url."api/1/vehicles/".$this->vehicleID."/wake_up");
                    } else {
                        
    curl_setopt($ch,CURLOPT_URL$url."api/1/vehicles/".$this->vehicleID."/command/".$command);
                    }
                    
    curl_setopt($ch,CURLOPT_HTTPHEADER, array("Authorization:Bearer ".$this->token) );
                }
                
    curl_setopt($ch,CURLOPT_POST1);
                
    curl_setopt($ch,CURLOPT_POSTFIELDS$params);
            } else {
                if ( 
    $command == "vehicles" ) {
                    
    curl_setopt($ch,CURLOPT_URL$url."api/1/vehicles");
                } else {
                    
    curl_setopt($ch,CURLOPT_URL$url."api/1/vehicles/".$this->vehicleID."/data_request/".$command."?".join("&",$params));
                }
                
    curl_setopt($ch,CURLOPT_HTTPHEADER, array("Authorization:Bearer ".$this->token) );
            }
            
    $result curl_exec($ch);
            
    $rc=curl_getinfo($ch,CURLINFO_HTTP_CODE);
            
    curl_close($ch);
                
    //echo "\n".$result;
            
    return json_decode($result);
        }
        
    //Grundfunktionen
        
    function vehicles() {
            return 
    $this->curlexec("vehicles","GET");
        }
        function 
    wake_up() {
            return 
    $this->curlexec("wake_up","POST");
        }
        
    //data-requests
        
    function charge_state() {
            return 
    $this->curlexec("charge_state","GET");
        }
        function 
    climate_state() {
            return 
    $this->curlexec("climate_state","GET");
        }
        function 
    drive_state() {
            return 
    $this->curlexec("drive_state","GET");
        }
        function 
    gui_settings() {
            return 
    $this->curlexec("gui_settings","GET");
        }
        function 
    vehicle_state() {
            return 
    $this->curlexec("vehicle_state","GET");
        }
        
    // commands
        
    function charge_port_door_open() {
            return 
    $this->curlexec("charge_port_door_open","POST");
        }
        function 
    charge_standard() {
            return 
    $this->curlexec("charge_standard","POST");
        }
        function 
    charge_max_range() {
            return 
    $this->curlexec("charge_max_range","POST");
        }
        function 
    set_charge_limit($percent) {
            return 
    $this->curlexec("set_charge_limit","POST",array("percent" => $percent ));
        }
        function 
    charge_start() {
            return 
    $this->curlexec("charge_start","POST");
        }
        function 
    charge_stop() {
            return 
    $this->curlexec("charge_stop","POST");
        }
        function 
    flash_lights() {
            return 
    $this->curlexec("flash_lights","POST");
        }
        function 
    honk_horn() {
            return 
    $this->curlexec("honk_horn","POST");
        }
        function 
    door_unlock() {
            return 
    $this->curlexec("door_unlock","POST");
        }
        function 
    door_lock() {
            return 
    $this->curlexec("door_lock","POST");
        }
        function 
    set_temps($tempDriver$tempPassenger) {
            return 
    $this->curlexec("set_temps","POST",array("driver_temp" => $tempDriver,"passenger_temp" => $tempPassenger ));
        }
        function 
    auto_conditioning_start() {
            return 
    $this->curlexec("auto_conditioning_start","POST");
        }
        function 
    auto_conditioning_stop() {
            return 
    $this->curlexec("auto_conditioning_stop","POST");
        }
        function 
    sun_roof_control_state($state) {
            return 
    $this->curlexec("sun_roof_control","POST",array("state" => $state ));
        }
        function 
    sun_roof_control_percent($percent) {
            return 
    $this->curlexec("sun_roof_control","POST",array("state" => "move""percent" => $percent ));
        }
        function 
    remote_start_drive($password) {
            return 
    $this->curlexec("remote_start_drive","POST",array("password" => $password ));
        }
       
        
    // deprecated
      //  function trunk_open() {
      //      return $this->curlexec("trunk_open","POST",array("which_trunk" => "rear" ));
      //  }
      
      
    }
    $object IPS_GetObject($_IPS['SELF']);
    $parentID $object['ParentID'];
    //Installation
    if(IPS_GetName($parentID)!=$instanceName){
        
    //Anlegen der DummyInstanz
        
    $instanceID IPS_CreateInstance("{485D0419-BE97-4548-AA9C-C083EB82E61E}");
        
    IPS_SetParent($instanceID$parentID);
        
    $parentID $instanceID;
        
    IPS_SetName($instanceID$instanceName);
        
    IPS_SetParent($_IPS['SELF'], $instanceID);
        
    IPS_SetName($instanceID$instanceName);
        
        
    //Anlegen aller Variablen für die State Werte
        
    $tesla=new SimpleTeslaAPI($instanceID);
        
    $tesla->readClimateState2Variable();
        
    $tesla->readVehicleState2Variable();
        
    $tesla->readChargeState2Variable();
        
        
    //Profile anlegen:
        
    if(IPS_VariableProfileExists($tesla->profileKM)==false){
            
    IPS_CreateVariableProfile($tesla->profileKM,2);
            
    IPS_SetVariableProfileText($tesla->profileKM,"","KM");
        }
        
        if(
    IPS_VariableProfileExists($tesla->profileButton)==false){
            
    IPS_CreateVariableProfile($tesla->profileButton,1);
            
    IPS_SetVariableProfileAssociation($tesla->profileButton1"OK"""0x008800);
        }
        if(
    IPS_VariableProfileExists($tesla->profileChargeRange)==false){
            
    IPS_CreateVariableProfile($tesla->profileChargeRange,1);
            
    IPS_SetVariableProfileValues($tesla->profileChargeRange,50,100,10);
            
    IPS_SetVariableProfileAssociation($tesla->profileChargeRange50"50"""0x008800);
            
    IPS_SetVariableProfileAssociation($tesla->profileChargeRange60"60"""0x008800);
            
    IPS_SetVariableProfileAssociation($tesla->profileChargeRange70"70"""0x008800);
            
    IPS_SetVariableProfileAssociation($tesla->profileChargeRange80"80"""0x008800);
            
    IPS_SetVariableProfileAssociation($tesla->profileChargeRange90"90"""0x008800);
            
    IPS_SetVariableProfileAssociation($tesla->profileChargeRange100"100"""0x008800);
        }
        
        
    //Setzen der Eigenschaften für die einzelnen Variablen:
        
    $idVar=IPS_GetVariableIDByName($tesla->varInnentemperatur,$instanceID);
        
    IPS_SetVariableCustomProfile($idVar,"~Temperature");
        
    $idVar=IPS_GetVariableIDByName($tesla->varAussentemperatur,$instanceID);
        
    IPS_SetVariableCustomProfile($idVar,"~Temperature");
        
    $idVar=IPS_GetVariableIDByName($tesla->varTempFahrer,$instanceID);
        
    IPS_SetVariableCustomProfile($idVar,"~Temperature");
        
    $idVar=IPS_GetVariableIDByName($tesla->varTempBeifahrer,$instanceID);
        
    IPS_SetVariableCustomProfile($idVar,"~Temperature");
        
        
    $idVar=IPS_GetVariableIDByName($tesla->varKlimaState,$instanceID);
        
    IPS_SetVariableCustomProfile($idVar,"~Switch");
        
    IPS_SetVariableCustomAction($idVar,$_IPS['SELF']);
       
    $idVar=IPS_GetVariableIDByName($tesla->varName,$instanceID);
        
    IPS_SetVariableCustomProfile($idVar,"~String");
        
    $idVar=IPS_GetVariableIDByName($tesla->varSchiebedach,$instanceID);
        
    IPS_SetVariableCustomProfile($idVar,"~Intensity.100");
       
    $idVar=IPS_GetVariableIDByName($tesla->varVerriegelt,$instanceID);
        
    IPS_SetVariableCustomProfile($idVar,"~Lock");
       
    $idVar=IPS_GetVariableIDByName($tesla->varVersion,$instanceID);
        
    IPS_SetVariableCustomProfile($idVar,"~String");
       
    $idVar=IPS_GetVariableIDByName($tesla->varChargeState,$instanceID);
        
    IPS_SetVariableCustomProfile($idVar,"~String");
        
       
    $idVar=IPS_GetVariableIDByName($tesla->varChargeLimit,$instanceID);
        
    IPS_SetVariableCustomProfile($idVar,$tesla->profileChargeRange);
        
    IPS_SetVariableCustomAction($idVar,$_IPS['SELF']);
        
       
    $idVar=IPS_GetVariableIDByName($tesla->varChargeSOC,$instanceID);
        
    IPS_SetVariableCustomProfile($idVar,"~Battery.100");
       
    $idVar=IPS_GetVariableIDByName($tesla->varBatteryHeater,$instanceID);
        
    IPS_SetVariableCustomProfile($idVar,"~Switch");
        
        
    $idVar=IPS_GetVariableIDByName($tesla->varTypicalRange,$instanceID);
        
    IPS_SetVariableCustomProfile($idVar,$tesla->profileKM); 
       
    $idVar=IPS_GetVariableIDByName($tesla->varEstimatedRange,$instanceID);
        
    IPS_SetVariableCustomProfile($idVar,$tesla->profileKM); 
       
    $idVar=IPS_GetVariableIDByName($tesla->varIdealRange,$instanceID);
        
    IPS_SetVariableCustomProfile($idVar,$tesla->profileKM); 
        
        
    //Trigger Buttons erstellen
        
    UpdateIPSvar($tesla->parentID,$tesla->varHupe,1,1);
        
    UpdateIPSVarButtonProfil($tesla->varHupe$instanceID,$tesla->profileButton,$_IPS['SELF']);
       
       
    UpdateIPSvar($tesla->parentID,$tesla->varLicht,1,1);
        
    UpdateIPSVarButtonProfil($tesla->varLicht$instanceID,$tesla->profileButton,$_IPS['SELF']);
       
    UpdateIPSvar($tesla->parentID,$tesla->varChargePort,1,1);
        
    UpdateIPSVarButtonProfil($tesla->varChargePort$instanceID,$tesla->profileButton,$_IPS['SELF']);
       
    UpdateIPSvar($tesla->parentID,$tesla->varVerriegeln,1,1);
        
    UpdateIPSVarButtonProfil($tesla->varVerriegeln$instanceID,$tesla->profileButton,$_IPS['SELF']);
       
    UpdateIPSvar($tesla->parentID,$tesla->varEntriegeln,1,1);
        
    UpdateIPSVarButtonProfil($tesla->varEntriegeln$instanceID,$tesla->profileButton,$_IPS['SELF']);
        
    //Button zum Starten/Stoppen des Ladens
        
    UpdateIPSVarButtonProfil($tesla->varChargeTriggerStop$instanceID,$tesla->profileButton,$_IPS['SELF']);
        
    UpdateIPSVarButtonProfil($tesla->varChargeTriggerStart$instanceID,$tesla->profileButton,$_IPS['SELF']);
        
    //ENDE Installationsprozess
    }else{
        
    $tesla=new SimpleTeslaAPI($parentID);
        
        if(
    $_IPS['SENDER'] == "WebFront")
        {
            
    //    $IPS_VARIABLE, $IPS_VALUE);
            
    $variableName=IPS_GetName($IPS_VARIABLE);
            if(
    $variableName==$tesla->varHupe){
                
    $tesla->honk_horn();
            }else if(
    $variableName==$tesla->varKlimaState){
               
    $idVarKlimaState=GetValueBoolean(IPS_GetVariableIDByName($tesla->varKlimaState,$parentID));
                if(
    $idVarKlimaState){
                    
    $tesla->auto_conditioning_stop();
                    
    //echo "Klima AUS";
                    
    }
                else{
                    
    $tesla->auto_conditioning_start();
                    
    //echo "Klima AN";
                    
    }
                
    sleep(4);
                
    $tesla->readClimateState2Variable();
            }else if(
    $variableName==$tesla->varLicht){
                
    $tesla->flash_lights();
            }else if(
    $variableName==$tesla->varChargeTriggerStop){
                
    $tesla->charge_stop();
                
    sleep(5);
                
    $tesla->readChargeState2Variable();
            }else if(
    $variableName==$tesla->varChargeTriggerStart){
                
    $tesla->charge_start();
                
    sleep(5);
                
    $tesla->readChargeState2Variable();
            }else if(
    $variableName==$tesla->varChargeLimit){
               
    $tesla->set_charge_limit($_IPS['VALUE']);
               
    sleep(8);
                
    $tesla->readChargeState2Variable();
            }else if(
    $variableName==$tesla->varChargePort){
                
    $tesla->charge_port_door_open();
            
            }else if(
    $variableName==$tesla->varVerriegeln){
                
    $tesla->door_lock();
            
            }else if(
    $variableName==$tesla->varEntriegeln){
                
    $tesla->door_unlock();
                
            }
        }else{
            
    $tesla->readClimateState2Variable();
            
    $tesla->readVehicleState2Variable();
            
    $tesla->readChargeState2Variable();
        }
    }
    ?>
    Code:
    Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; SimpleTeslaAPI has a deprecated constructor in /var/lib/symcon/scripts/47009.ips.php on line 4
    
    Notice: Trying to get property 'response' of non-object in /var/lib/symcon/scripts/47009.ips.php on line 53
    
    Notice: Trying to get property 'inside_temp' of non-object in /var/lib/symcon/scripts/47009.ips.php on line 53
    
    Notice: Trying to get property 'response' of non-object in /var/lib/symcon/scripts/47009.ips.php on line 54
    
    Notice: Trying to get property 'outside_temp' of non-object in /var/lib/symcon/scripts/47009.ips.php on line 54
    
    Notice: Trying to get property 'response' of non-object in /var/lib/symcon/scripts/47009.ips.php on line 55
    
    Notice: Trying to get property 'driver_temp_setting' of non-object in /var/lib/symcon/scripts/47009.ips.php on line 55
    
    Notice: Trying to get property 'response' of non-object in /var/lib/symcon/scripts/47009.ips.php on line 56
    
    Notice: Trying to get property 'passenger_temp_setting' of non-object in /var/lib/symcon/scripts/47009.ips.php on line 56
    
    Notice: Trying to get property 'response' of non-object in /var/lib/symcon/scripts/47009.ips.php on line 57
    
    Notice: Trying to get property 'fan_status' of non-object in /var/lib/symcon/scripts/47009.ips.php on line 57
    Lüftung ist
    Notice: Trying to get property 'response' of non-object in /var/lib/symcon/scripts/47009.ips.php on line 65
    
    Notice: Trying to get property 'vehicle_name' of non-object in /var/lib/symcon/scripts/47009.ips.php on line 65
    
    Notice: Trying to get property 'response' of non-object in /var/lib/symcon/scripts/47009.ips.php on line 66
    
    Notice: Trying to get property 'sun_roof_percent_open' of non-object in /var/lib/symcon/scripts/47009.ips.php on line 66
    
    Notice: Trying to get property 'response' of non-object in /var/lib/symcon/scripts/47009.ips.php on line 67
    
    Notice: Trying to get property 'locked' of non-object in /var/lib/symcon/scripts/47009.ips.php on line 67
    
    Notice: Trying to get property 'response' of non-object in /var/lib/symcon/scripts/47009.ips.php on line 68
    
    Notice: Trying to get property 'car_version' of non-object in /var/lib/symcon/scripts/47009.ips.php on line 68
    
    Notice: Trying to get property 'response' of non-object in /var/lib/symcon/scripts/47009.ips.php on line 73
    
    Notice: Trying to get property 'charging_state' of non-object in /var/lib/symcon/scripts/47009.ips.php on line 73
    
    Notice: Trying to get property 'response' of non-object in /var/lib/symcon/scripts/47009.ips.php on line 74
    
    Notice: Trying to get property 'charge_limit_soc' of non-object in /var/lib/symcon/scripts/47009.ips.php on line 74
    
    Notice: Trying to get property 'response' of non-object in /var/lib/symcon/scripts/47009.ips.php on line 75
    
    Notice: Trying to get property 'battery_level' of non-object in /var/lib/symcon/scripts/47009.ips.php on line 75
    
    Notice: Trying to get property 'response' of non-object in /var/lib/symcon/scripts/47009.ips.php on line 76
    
    Notice: Trying to get property 'battery_heater_on' of non-object in /var/lib/symcon/scripts/47009.ips.php on line 76
    
    Notice: Trying to get property 'response' of non-object in /var/lib/symcon/scripts/47009.ips.php on line 77
    
    Notice: Trying to get property 'battery_range' of non-object in /var/lib/symcon/scripts/47009.ips.php on line 77
    
    Notice: Trying to get property 'response' of non-object in /var/lib/symcon/scripts/47009.ips.php on line 78
    
    Notice: Trying to get property 'est_battery_range' of non-object in /var/lib/symcon/scripts/47009.ips.php on line 78
    
    Notice: Trying to get property 'response' of non-object in /var/lib/symcon/scripts/47009.ips.php on line 79
    
    Notice: Trying to get property 'ideal_battery_range' of non-object in /var/lib/symcon/scripts/47009.ips.php on line 79
    
    Notice: Trying to get property 'response' of non-object in /var/lib/symcon/scripts/47009.ips.php on line 83
    
    Notice: Trying to get property 'charging_state' of non-object in /var/lib/symcon/scripts/47009.ips.php on line 83
    
    Notice: Trying to get property 'response' of non-object in /var/lib/symcon/scripts/47009.ips.php on line 86
    
    Notice: Trying to get property 'charging_state' of non-object in /var/lib/symcon/scripts/47009.ips.php on line 86
    
    Notice: Trying to get property 'response' of non-object in /var/lib/symcon/scripts/47009.ips.php on line 89
    
    Notice: Trying to get property 'charging_state' of non-object in /var/lib/symcon/scripts/47009.ips.php on line 89
    Klicken Sie auf die Grafik für eine größere Ansicht 

Name:	Bildschirmfoto 2019-04-11 um 10.15.28.png 
Hits:	254 
Größe:	156.9 KB 
ID:	48536
    IPS 5.0 @ Synology Docker DS916+ / RaspBerryMatic / influxDB / Grafana / ipsView / Sonos / PhilipsHue / Z-Wave / IP-Cams / Ubiquity / Amazon Echo

  2. #2
    Registriert seit
    Aug 2015
    Ort
    Kircheib
    Beiträge
    57

    Hi,
    bin auch gerade am forschen und bin z.B. auf die JSON-API-Doku von Tim Dorr gestoßen.
    https://tesla-api.timdorr.com/

    Gruß
    Geändert von iMaxxx (11.04.19 um 13:49 Uhr)
    IP-Symcon Unlimited - RaspberryMatic - Homematic Wired

  3. #3
    Registriert seit
    Aug 2015
    Ort
    Kircheib
    Beiträge
    57

    Schön wär es, wenn wir die OAuth2 Authentifizierung noch in das Skript oder ein Modul bekommen.

    Key und Secret sind ja da: [Bash] Tesla OAuth Client ID and Secret - Pastebin.com
    https://tesla-api.timdorr.com/api-basics/authentication
    IP-Symcon Unlimited - RaspberryMatic - Homematic Wired

  4. #4
    Registriert seit
    Oct 2011
    Ort
    Hattersheim (Hessen)
    Beiträge
    6,342

    Zitat Zitat von iMaxxx Beitrag anzeigen
    Schön wär es, wenn wir die OAuth2 Authentifizierung noch in das Skript oder ein Modul bekommen.
    Das ist kein Thema dazu muss nur mit IP-Symcon selber Kontakt aufgenommen werden wenn jemand ein PHP Modul erstellen will. IP-Symcon unterstützt Oauth2. Der Token wird dann direkt von IP-Symcon geholt Beispiel ist hier.

  5. #5
    Registriert seit
    May 2005
    Beiträge
    2,269

    Gibt es da auch schon was für die Tesla Powerwall Gateways?

  6. #6
    Registriert seit
    Feb 2011
    Beiträge
    627

    In so einem Fall nervt es mich, dass ich keine Zeit habe mir das programmieren noch mal richtig beizubringen.
    Ich hätte hier sonst liebend gern ein Modul für gebaut, aber wenn ich es nicht mal schaffe das angestaubte Script zum laufen zu bringen bringt der beste Wille nichts ;-)

    Vielleicht finden sich ja noch 1..2 Telsa Jünger hier zusammen... ich teste gern
    Am meisten nervt es mich nämlich die Ladeverriegelung über die App zu bedienen wenn ich losfahren will, oder den Akkustand in IPS abzulesen wäre auch cool für die Stuerung des Ladecontroller
    IPS 5.0 @ Synology Docker DS916+ / RaspBerryMatic / influxDB / Grafana / ipsView / Sonos / PhilipsHue / Z-Wave / IP-Cams / Ubiquity / Amazon Echo

  7. #7
    Registriert seit
    Aug 2015
    Ort
    Kircheib
    Beiträge
    57

    Ich habe leider auch keine Zeit. Ich versuche mich zwischendurch mal hinzusetzen und ein Modul zu bauen.
    IP-Symcon Unlimited - RaspberryMatic - Homematic Wired

  8. #8
    Registriert seit
    Feb 2011
    Beiträge
    627

    Hallo zusammen,

    könnte man sich nicht eventuell ---> HIER <--- bedienen ? Ist ja schon alles PHP

    Ich habe meine Tesla Ladesteuerung in ips integriert, habe aber das Problem, dass ich das Model 3 nicht aufgeweckt bekomme und die Ladung somit nicht startet. Erst wenn ich per Handy das Auto aufgeweckt habe. Etwas undpraktisch ^^

    Gruß Zeppi
    IPS 5.0 @ Synology Docker DS916+ / RaspBerryMatic / influxDB / Grafana / ipsView / Sonos / PhilipsHue / Z-Wave / IP-Cams / Ubiquity / Amazon Echo

  9. #9
    Registriert seit
    Feb 2011
    Beiträge
    627

    Kleines Update
    Bis gestern wusste ich noch nichts über NodeRed

    Hab das Addon RedMatic auf dem Pi3 (raspimatic) installiert und mich einfach etwas durchgebissen. Puhhh was fürn geiler Schei****

    Ich habe mir in HomeMatic eine Systemvariable angelegt, die ich über symcon entsprechend auf true schalte wenn das Auto aufwachen soll. NodeRed überwacht diese Variable und weckt dann den Tesla auf. Von hinten durch die Brust ^^

    Jetzt muss ich weiterbasteln und die Variablen noch nach Symcon schubsen

    Klicken Sie auf die Grafik für eine größere Ansicht 

Name:	2.JPG 
Hits:	55 
Größe:	139.2 KB 
ID:	48837
    IPS 5.0 @ Synology Docker DS916+ / RaspBerryMatic / influxDB / Grafana / ipsView / Sonos / PhilipsHue / Z-Wave / IP-Cams / Ubiquity / Amazon Echo

  10. #10
    Registriert seit
    Aug 2016
    Beiträge
    2,542

    Ich habe zwar keinen Tesla, aber ich habe mal angefangen ein Modul dafür zu schreiben.
    An die ersten Daten komme ich schon ran.

    Danke an thezepter für die Unterstützung.

    Grüße,
    Kai
    IPS 5.2, auf Tinkerboard und RPI, piVCCU, Homematic & Homematic IP, diverse Tasmota Geräte, Shelly, GHoma, LG HomBot, Sonos, Tvheadend, HomeKit, AppleTV

Ähnliche Themen

  1. Discovergy API
    Von Salem im Forum PHP-Module
    Antworten: 14
    Letzter Beitrag: 15.05.19, 09:44
  2. Trackimo API
    Von jgoller im Forum Skripte, PHP, SQL
    Antworten: 0
    Letzter Beitrag: 06.07.16, 14:02
  3. heise // Tesla kooperiert mit digitalSTROM
    Von Bayaro im Forum Off Topic
    Antworten: 0
    Letzter Beitrag: 09.12.15, 13:13
  4. API Beschreibung
    Von kermitted im Forum Allgemeine Diskussion
    Antworten: 1
    Letzter Beitrag: 01.11.05, 13:43