Comments (5)
What commands do you have in that automation? Unless I know whats itside of it I wont be able to troubleshoot this one any futher.
from hass-teslemetry.
`alias: "[Tesla Smart Charge] Charge on solar power"
description: ""
trigger:
- platform: state
entity_id: sensor.power_grid_usage
condition:
- condition: template
value_template: |
{{ now() - this.attributes.last_triggered > timedelta(seconds=10) }}
- condition: state
entity_id: input_boolean.smart_charge
state: "on"
- condition: state
entity_id: binary_sensor.tesla_charge_cable
state: "on"
- condition: state
entity_id: device_tracker.tesla_location
state: home
action:
- variables:
min_charging_amps: 1
minimum_start_amps: 2
max_charging_amps: 16
current_charging_amps: "{{ states('number.tesla_charge_current') | int }}"
spare_energy: "{{ states('sensor.power_grid_usage') | float }}"
grid_voltage: "{{ 240 | float * 3 }}"
spare_amps: "{{ (spare_energy / grid_voltage) | round(0, 'floor') | int }}"
new_charge_amps: "{{ (current_charging_amps + spare_amps) | int }}"
charge_limit: "{{ states('number.tesla_charge_limit_2') | int }}"
battery_level: "{{ states('sensor.tesla_battery_level') | int }}"
- choose:
- conditions:
- condition: template
value_template: "{{ spare_amps >= minimum_start_amps }}"
- condition: state
entity_id: switch.tesla_charge
state: "off"
- condition: template
value_template: "{{ charge_limit > battery_level }}"
sequence:
- service: logbook.log
data:
name: "[Tesla Smart Charge]"
message: >-
Charger is off and we have {{ spare_amps }} spare amps.
Attempting to start charge
- choose:
- conditions:
- condition: state
entity_id: timer.turn_off_car_charger
state: active
sequence:
- service: timer.cancel
target:
entity_id: timer.turn_off_car_charger
data: {}
- service: number.set_value
target:
entity_id: number.tesla_charge_current
data:
value: "{{ spare_amps }}"
- service: switch.turn_on
target:
entity_id: switch.tesla_charge
data: {}
- conditions:
- condition: state
entity_id: switch.tesla_charge
state: "on"
- condition: template
value_template: "{{ spare_amps > 0 }}"
- condition: template
value_template: "{{ current_charging_amps < max_charging_amps }}"
sequence:
- service: logbook.log
data:
name: "[Tesla Smart Charge]"
message: >-
Charger is on and we have {{ spare_amps }} spare amps. Already
at {{ current_charging_amps }} amps. Attempting to increase
charge rate to {{ (current_charging_amps + spare_amps) | int }}
amps
- choose:
- conditions:
- condition: state
entity_id: timer.turn_off_car_charger
state: active
sequence:
- service: timer.cancel
target:
entity_id: timer.turn_off_car_charger
data: {}
- service: number.set_value
target:
entity_id: number.tesla_charge_current
data:
value: "{{ [max_charging_amps, new_charge_amps] | min }}"
- conditions:
- condition: state
entity_id: switch.tesla_charge
state: "on"
- condition: template
value_template: "{{ new_charge_amps < min_charging_amps }}"
sequence:
- service: logbook.log
data:
name: "[Tesla Smart Charge]"
message: >-
Charger is on and we don't have enough juice to even charge at
{{ min_charging_amps }}A. Turning off charger in 5 minutes.
(new_charge:{{ new_charge_amps }}A < min_charging:{{
min_charging_amps }}A) (current_charging:{{
current_charging_amps }}A + spare:{{ spare_amps }}A) (power
out:{{ spare_energy }})
- service: number.set_value
target:
entity_id: number.tesla_charge_current
data:
value: "{{ min_charging_amps }}"
- choose:
- conditions:
- condition: or
conditions:
- condition: state
entity_id: timer.turn_off_car_charger
state: idle
- condition: state
entity_id: timer.turn_off_car_charger
state: paused
sequence:
- service: timer.start
target:
entity_id: timer.turn_off_car_charger
data:
duration: "00:05:02"
- conditions:
- condition: state
entity_id: switch.tesla_charge
state: "on"
- condition: template
value_template: "{{ spare_amps < 0 }}"
sequence:
- service: logbook.log
data:
name: "[Tesla Smart Charge]"
message: >-
Charger is on and we are using {{ spare_amps }} too many amps.
Attempting to decrease charge rate to:{{ [min_charging_amps,
new_charge_amps] | max }}
- choose:
- conditions:
- condition: state
entity_id: timer.turn_off_car_charger
state: active
sequence:
- service: timer.cancel
target:
entity_id: timer.turn_off_car_charger
data: {}
- service: number.set_value
target:
entity_id: number.tesla_charge_current
data:
value: "{{ [min_charging_amps, new_charge_amps] | max }}"
default: null
mode: single
trace:
stored_traces: 30
`
from hass-teslemetry.
This is another example
alias: Tesla set polling time short at sunrise
description: We adjust the Polling Interval down at sunrise
trigger:
- platform: sun
event: sunrise
condition:
- condition: state
entity_id: binary_sensor.tesla_charger
state: "on"
action:
- service: tesla_custom.polling_interval
data:
vin: "{{ state_attr('binary_sensor.tesla_online','vin') }}"
scan_interval: 30
from hass-teslemetry.
A couple others if you need that are failing. All are separate automations but for the same purpose (Charge on solar)
id: '1715219439274'
alias: '[Tesla Smart Charge] Turning off car charger'
description: ''
trigger:
- platform: event
event_type: timer.finished
event_data:
entity_id: timer.turn_off_car_charger
condition: []
action:
- service: switch.turn_off
target:
entity_id: switch.tesla_charge
data: {}
mode: single
Error message through trace
Executed: May 13, 2024 at 4:12:44 PM
Error: Teslemetry command failed, An error occurred while processing the request.
Result:
params:
domain: switch
service: turn_off
service_data: {}
target:
entity_id:
- switch.tesla_charge
running_script: false
from hass-teslemetry.
So right off the bat, turning charging on or off when it's already on or off used to trigger an error. The most recent release I did no longer does this, however there may be other services that need this treatment.
As a general rule if you want an automation to continue when an error has occurred, add continue_on_error: true
to the service calls.
However I'll need to figure out which call is throwing the unknown response error.
from hass-teslemetry.
Related Issues (20)
- Model details for Powerwall HOT 3
- Energy remaining sensor - no statistics found HOT 2
- Device registry firmware version doesn't seem to update HOT 1
- Charge Limit temporarily snaps back to previous value after user input HOT 6
- Call:service switch:turn_on against switch.mycar_charge while it is already on gives error HOT 1
- Using service to set number.mycar_charge_limit to its current value gives error, blocks automation HOT 7
- FR: don't force number entities UI presentation to be "box" HOT 1
- FR/question: Sensor for current driver profile in use? HOT 2
- Service call to navigation_request endpoint gives various errors HOT 3
- Valet Mode switch isn't working HOT 5
- Vent Windows cover isn't working HOT 4
- New (calculated) Sensor: BrickVoltageDelta HOT 1
- Powerwall off_grid_vehicle_charging_reserve_percent not updated in sensor HOT 5
- Storm Mode switch not functional
- Error when sending a command and the car is moving. HOT 3
- Firmware not updated in the integration page HOT 1
- Teslemetry errors in log. Shortly after the errors, Home Assistant crashes HOT 9
- Error starting up with Powerwall only HOT 2
- Setting number.tessy_charge_current complains about number.tessy_charge_limit is outside valid HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hass-teslemetry.