Geekzone: technology news, blogs, forums
Guest
Welcome Guest.
You haven't logged in yet. If you don't have an account you can register now.


shim99

108 posts

Master Geek
+1 received by user: 25

ID Verified

#306581 5-Aug-2023 11:33
Send private message

Hey, 

 

Looking for some help with an automation in homeassistant. We have a tesla that is able to charge at 16a but I would like to reduce that charge to 10a if the outside hotwater is also on. The hotwater is controlled by a shelly1 and we have the Tesla integration in homeassistant. I'm having trouble with the automation and wondering if anyone has pointers. What I have so far is:

 

 

 

alias: Reduce Amps Tesla
description: Reduces charge when outside hot water on
trigger:
  - type: charging
    platform: device
    device_id: XXXX
    entity_id: binary_sensor.pierre_charging
    domain: binary_sensor
    for:
      hours: 0
      minutes: 0
      seconds: 5
condition:
  - condition: device
    type: is_on
    device_id: YYYY
    entity_id: switch.outside_hot_water
    domain: switch
    for:
      hours: 0
      minutes: 0
      seconds: 2
action:
  - condition: state
    entity_id: number.pierre_charging_amps
    attribute: "10"
    state: ""
mode: single

 

I guess it could be that I need to set numeric state but not sure how the minimum and maximum works alongside the value template. 

 

Any help greatly appreciated. 

 

Thx. 


Create new topic
DataBitz
37 posts

Geek
+1 received by user: 14


  #3117967 19-Aug-2023 14:06
Send private message

What does the trace look like?
Which step are you having trouble with?

 

I have something similar but with the condition action that the Tesla is charging.
Also I set the charging amp via the device action, I think that's what you need to change.

 

You may also want to add a condition to the automation, that the Tesla is at Home. So if your charging away from home the rate isn't changed.

 

  - if:
      - condition: state
        entity_id: binary_sensor.tesla_charging
        state: "on"
    then:
      - device_id: xxxxxxxxxxxxxx
        domain: number
        entity_id: number.tesla_charging_amps
        type: set_value
        value: 8
    else: []




shim99

108 posts

Master Geek
+1 received by user: 25

ID Verified

  #3117971 19-Aug-2023 14:58
Send private message

That was really helpful guidance thanks, i've relooked at it and done a similar if/then/else statement that uses the status of the hot water. I've still done it as a time based trigger and it seems to be working well. 

 

alias: Reduce Amps Tesla
description: Reduces charge when outside hot water on
trigger:
  - platform: time
    at: "22:58:00"
condition: []
action:
  - if:
      - condition: state
        entity_id: switch.outside_hot_water
        state: "on"
    then:
      - device_id: XXXX
        domain: number
        entity_id: number.pierre_charging_amps
        type: set_value
        value: 8
    else:
      - device_id: YYYY
        domain: number
        entity_id: number.pierre_charging_amps
        type: set_value
        value: 16
mode: single

 

 


DataBitz
37 posts

Geek
+1 received by user: 14


  #3117999 19-Aug-2023 17:21
Send private message

You should be able to use this trigger, so it starts when the switch is turned on.
Make sure your Shelly is set up to send events to Home Assistant (See Shelly CoIoT settings) though to help ensure it sees the state change quickly.

 

trigger:
  - platform: state
    entity_id:
      - switch.outside_hot_water
    to: "on"




shim99

108 posts

Master Geek
+1 received by user: 25

ID Verified

  #3118017 19-Aug-2023 19:10
Send private message

Thanks, the problem i have is that the feed to the switchboard that the charger, hotwater, laundry and powerpoints is on is only 25a. This is a garage circuit and I only turn the hotwater on when we have guests. So if I wait for the hotwater to come on there is a risk it blows the circuit (if hotwater, heater and dryer is going) before home assistant can step down the amps to the tesla. Under the current setup, I switch the hotwater on at 11pm and home assistant checks whether thats on and if so it will turn the charging down for the Tesla for the night (Tesla charging starts at 11.05pm). It will recheck again the next day. 

 

Again appreciate the help.


Create new topic








Geekzone Live »

Try automatic live updates from Geekzone directly in your browser, without refreshing the page, with Geekzone Live now.



Are you subscribed to our RSS feed? You can download the latest headlines and summaries from our stories directly to your computer or smartphone by using a feed reader.