Giter VIP home page Giter VIP logo

Comments (6)

alandtse avatar alandtse commented on May 18, 2024 1

The new service can set this. You'll need to know your vehicle_id. Turn on debugging of teslajsonpy to see it.

service: tesla_custom.api
data:
  email: [email protected]
  command: CHANGE_CHARGE_LIMIT
  parameters:
    path_vars:
      vehicle_id: 'REPLACE'
    wake_if_asleep: true
    percent: '90'

from tesla.

alandtse avatar alandtse commented on May 18, 2024

This is something that has been discussed in the api. The problem is how to display it in HA.

from tesla.

remulasce avatar remulasce commented on May 18, 2024

It seems like HA has example code for using a 'light' to control what is really a volume knob in https://www.home-assistant.io/integrations/light.template/#theater-volume-control.

What is the 'custom service call' thing that is discussed in that issue? It seems a little backwards to give access only to the API surface that conveniently maps to existing toggles. Is there a different way I can call Tesla's API from Home Assistant without needing these UI base types?

from tesla.

iMicknl avatar iMicknl commented on May 18, 2024

What about a number entity?

from tesla.

alandtse avatar alandtse commented on May 18, 2024

What about a number entity?

That's probably the right entity. I guess we can use the value whenever the max range switch is off.

from tesla.

drobtravels avatar drobtravels commented on May 18, 2024

If anyone's looking for some templates to make this easier... I made this script to set the charge limit to any value

script:
  set_tesla_max_charge:
    description:  Set Tesla Max Charge
    fields:
      charge_limit:
        name: charge_limit
        description: Max Percent of charge
        required: true
        example: 70
        default: 70
    mode: queued
    sequence:
      - service: tesla_custom.api
        data:
          email: !secret tesla_user
          command: CHANGE_CHARGE_LIMIT
          parameters:
            path_vars:
              vehicle_id: !secret tesla_vehicle_id
            wake_if_asleep: true
            percent: '{{ charge_limit}}'

And a custom "max range" switch which uses my preferred values. Note that I use teslamate MQTT to get all state instead of this component. You will like need to edit the value_template and availability_template properties.

switch:
  - platform: template
    switches:
      tesla_trip_charge:
        friendly_name: Tesla Charge for Road Trip
        unique_id: chase_trip_charge_293u439
        availability_template: "{{ is_number(states('sensor.teslamate_charge_limit_soc')) }}"
        value_template: "{{ states('sensor.teslamate_charge_limit_soc')|int  >= 90 }}"
        turn_on:
          service: script.set_tesla_max_charge
          data:
            charge_limit: 96
        turn_off:
          service: script.set_tesla_max_charge
          data:
            charge_limit: 70

from tesla.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.