146 lines
12 KiB
JSON
146 lines
12 KiB
JSON
[
|
|
{
|
|
"id": "Laden - Load balancing",
|
|
"automation": "- alias: Laden - Load balancing\n description: Deze automatisering controleert of je teveel stroom verbruikt op je\n meter en schakeltde laadpaal af indien nodig\n mode: single\n triggers:\n - seconds: '30'\n trigger: time_pattern\n conditions:\n - condition: state\n entity_id: sensor.laadpaal\n state: Charging Normal\n actions:\n - if:\n - condition: numeric_state\n entity_id: sensor.max_stroom_op_fase\n above: 23\n then:\n - target:\n entity_id: number.laadpaal_max_station_current\n data:\n value: '{{ states(''number.laadpaal_max_station_current'') | int - 2 }}'\n alias: verlaag met 1 ampere\n action: number.set_value\n else:\n - condition: numeric_state\n entity_id: sensor.max_stroom_op_fase\n below: 20\n - condition: not\n conditions:\n - condition: state\n entity_id: number.laadpaal_max_station_current\n state: '16'\n alias: Test charge rate is not already at the 16 amp maximum\n - target:\n entity_id: number.laadpaal_max_station_current\n data:\n value: '{{ states(''number.laadpaal_max_station_current'') | int + 1 }}'\n alias: Increase charging rate by 1 amp\n action: number.set_value",
|
|
"config": [
|
|
{
|
|
"name": "laadpaal",
|
|
"room": "garage",
|
|
"type": "sensor",
|
|
"id": {
|
|
"entity_id": "sensor.laadpaal",
|
|
"device_id": null
|
|
}
|
|
},
|
|
{
|
|
"name": "max stroom op fase",
|
|
"room": "electrical",
|
|
"type": "sensor",
|
|
"id": {
|
|
"entity_id": "sensor.max_stroom_op_fase",
|
|
"device_id": null
|
|
}
|
|
},
|
|
{
|
|
"name": "laadpaal max station current",
|
|
"room": "garage",
|
|
"type": "number",
|
|
"id": {
|
|
"entity_id": "number.laadpaal_max_station_current",
|
|
"device_id": null
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"id": "Laden - Periodieke controle",
|
|
"automation": "- alias: Laden - Periodieke controle\n description: Deze automatisering start op elke eerste minuut van een nieuw uur en\n bepaalt of er geladen moet worden of niet\n triggers:\n - trigger: time_pattern\n minutes: '0'\n conditions:\n - condition: or\n conditions:\n - condition: state\n entity_id: sensor.laadpaal\n state: Charging Normal\n - condition: state\n entity_id: sensor.laadpaal\n state: Wait Vehicle Charging\n - condition: state\n entity_id: sensor.laadpaal\n state: Load Balancing Forced Off\n actions:\n - choose:\n - conditions:\n - condition: template\n value_template: \"{% for item in states('input_text.goedkopelaadtijden') |\\\n \\ from_json %}\\n {% if item.hour == now().hour %}\\n {{ True }}\\n {%\\\n \\ endif %}\\n{% endfor %}\"\n sequence:\n - target:\n entity_id: number.laadpaal_max_station_current\n data:\n value: '16'\n alias: Activeer laden\n action: number.set_value\n - action: notify.mobile_app_iphone\n metadata: {}\n data:\n message: De auto gaat nu laden omdat dit uur goedkoop is.\n title: Auto laden\n default:\n - alias: Laden stoppen\n target:\n entity_id: number.laadpaal_max_station_current\n data:\n value: '0'\n action: number.set_value\n mode: single",
|
|
"config": [
|
|
{
|
|
"name": "laadpaal",
|
|
"room": "garage",
|
|
"type": "sensor",
|
|
"id": {
|
|
"entity_id": "sensor.laadpaal",
|
|
"device_id": null
|
|
}
|
|
},
|
|
{
|
|
"name": "laadpaal max station current",
|
|
"room": "garage",
|
|
"type": "number",
|
|
"id": {
|
|
"entity_id": "number.laadpaal_max_station_current",
|
|
"device_id": null
|
|
}
|
|
},
|
|
{
|
|
"name": "goedkope laadtijden",
|
|
"room": "system",
|
|
"type": "input_text",
|
|
"id": {
|
|
"entity_id": "input_text.goedkopelaadtijden",
|
|
"device_id": null
|
|
}
|
|
},
|
|
{
|
|
"name": "mobile app iphone",
|
|
"room": "mobile",
|
|
"type": "notify",
|
|
"id": {
|
|
"entity_id": "notify.mobile_app_iphone",
|
|
"device_id": null
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"id": "Laden - Start bepalen",
|
|
"automation": "- alias: Laden - Start bepalen\n description: Als de laadkabel aangesloten is dan zal met deze automation gevraagd\n worden hoe je wil laden. Hierna zal het laden wel of niet gestart worden afhankelijk\n van de goedkope uren\n triggers:\n - trigger: state\n entity_id:\n - sensor.laadpaal\n from: Available\n to: null\n conditions: []\n actions:\n - alias: Variabelen aanmaken voor de keuzemogelijkheden\n variables:\n action_fast: '{{ ''FAST'' }}'\n action_work: '{{ ''WORK'' }}'\n action_cheap: '{{ ''CHEAP'' }}'\n - alias: Vraag hoe de auto geladen moet worden\n action: notify.mobile_app_iphone\n data:\n message: De auto gaat laden. Hoe wil je de auto laden?\n data:\n actions:\n - action: '{{ action_fast }}'\n title: Zo snel mogelijk\n - action: '{{ action_work }}'\n title: Voor 6 uur\n - action: '{{ action_cheap }}'\n title: Binnen 24 uur\n - alias: Wacht op antwoord vanuit de melding hoe de auto geladen moet worden\n wait_for_trigger:\n - event_type: mobile_app_notification_action\n event_data:\n action: '{{ action_fast }}'\n trigger: event\n - event_type: mobile_app_notification_action\n event_data:\n action: '{{ action_work }}'\n trigger: event\n - event_type: mobile_app_notification_action\n event_data:\n action: '{{ action_cheap }}'\n trigger: event\n timeout:\n hours: 0\n minutes: 5\n seconds: 0\n milliseconds: 0\n - alias: De helper instellen wanneer het laden klaar moet zijn\n choose:\n - conditions:\n - condition: template\n value_template: '{{ wait.trigger.event.data.action == action_work }}'\n sequence:\n - action: input_number.set_value\n target:\n entity_id: input_number.laden_klaar\n data:\n value: 6\n alias: Deze actie zal worden uitgevoerd als er voor 6 uur gekozen is\n - conditions:\n - condition: template\n value_template: '{{ wait.trigger.event.data.action == action_cheap }}'\n sequence:\n - action: input_number.set_value\n target:\n entity_id: input_number.laden_klaar\n data:\n value: '{{ now().hour }}'\n alias: Deze actie zal worden uitgevoerd als er binnen 24 uur gekozen is\n - conditions:\n - condition: template\n value_template: '{{ wait.trigger.event.data.action == action_fast }}'\n sequence:\n - action: input_number.set_value\n target:\n entity_id: input_number.laden_klaar\n data:\n value: -1\n alias: Deze actie zal worden uitgevoerd als er voor zo snel mogelijk gekozen\n is\n - delay:\n hours: 0\n minutes: 0\n seconds: 1\n milliseconds: 0\n - variables:\n autocapacity: 60\n chargercapacity: 11\n kwhladen: '{{ autocapacity * (0.01 * states(''sensor.tesla_battery_level'')\n | int) }}'\n tijdladen: '{{ ((autocapacity - kwhladen) / chargercapacity) | int }}'\n tijdladenafgerond: '{{ ((tijdladen + 1) | round(0, ''ceil'', default)) | int\n }}'\n alias: Bereken het aantal uur dat er nodig is om te laden\n - variables:\n prices_today: '{{ state_attr(''sensor.nordpool_kwh_nl_eur_2_11_031'', ''today'')\n }}'\n prices_today_ns: \"{% set nstoday = namespace(items=[]) %}\\n{% for price in prices_today\\\n \\ %}\\n {% set nstoday.items = nstoday.items + [{'hour': loop.index0, 'price':\\\n \\ price}] %}\\n{% endfor %}\\n{% if states('input_number.laden_klaar') == '-1.0'\\\n \\ %}\\n {% set endtime = (now().hour + tijdladenafgerond) | int %}\\n {{ nstoday.items\\\n \\ | sort(attribute='price') | selectattr('hour','>=', now().hour) | selectattr('hour',\\\n \\ '<', endtime) | list }}\\n{% else %}\\n {{ (nstoday.items | sort(attribute='price')\\\n \\ | selectattr('hour', '>=', now().hour) | list)[:tijdladenafgerond] }}\\n\\\n {% endif %}\\n\"\n prices_tomorrow: '{{ state_attr(''sensor.nordpool_kwh_nl_eur_2_11_031'', ''tomorrow'')\n }}'\n prices_tomorrow_ns: \"{% set nstomorrow = namespace(items=[]) %}\\n{% for price\\\n \\ in prices_tomorrow %}\\n {% set nstomorrow.items = nstomorrow.items + [{'hour':\\\n \\ loop.index0, 'price': price}] %}\\n{% endfor %}\\n{% if (now().hour + tijdladenafgerond)\\\n \\ > 24 %}\\n {% set asap_resthours = 24 - (now().hour + tijdladenafgerond)\\\n \\ %}\\n {{ nstomorrow.items | sort(attribute='price') | selectattr('hour',\\\n \\ '<', asap_resthours | int) | list }}\\n{% else %}\\n {{ (nstomorrow.items\\\n \\ | sort(attribute='price') | selectattr('hour', '<', states('input_number.laden_klaar')\\\n \\ | int) | list)[:tijdladenafgerond] }}\\n{% endif %}\\n\"\n combined_prices: '{{ (prices_today_ns + prices_tomorrow_ns) | sort(attribute=''price'')\n }}'\n alias: Maakt een lijst met de goedkoopste uren om te laden\n - target:\n entity_id: input_text.goedkopelaadtijden\n data:\n value: '{{ combined_prices[:tijdladenafgerond] | tojson}}'\n action: input_text.set_value\n alias: Plaatst de goedkope uren in een helper\n - delay:\n hours: 0\n minutes: 0\n seconds: 2\n milliseconds: 0\n - choose:\n - conditions:\n - condition: template\n value_template: \"{% for item in states('input_text.goedkopelaadtijden') |\\\n \\ from_json %}\\n {% if item.hour == now().hour %}\\n {{ True }}\\n {%\\\n \\ endif %}\\n{% endfor %}\"\n sequence:\n - action: number.set_value\n metadata: {}\n data:\n value: '16'\n target:\n entity_id: number.laadpaal_max_station_current\n - action: notify.mobile_app_iphone\n metadata: {}\n data:\n message: De auto gaat nu laden omdat dit uur goedkoop is.\n title: Auto laden\n default:\n - action: number.set_value\n metadata: {}\n data:\n value: '0'\n target:\n entity_id: number.laadpaal_max_station_current\n - action: notify.mobile_app_iphone\n metadata: {}\n data:\n message: De auto gaat nog niet laden en wacht tot een goedkoop moment.\n title: Auto laden\n alias: Activeer het laden als het nu een goedkoop uur is.\n mode: single",
|
|
"config": [
|
|
{
|
|
"name": "laadpaal",
|
|
"room": "garage",
|
|
"type": "sensor",
|
|
"id": {
|
|
"entity_id": "sensor.laadpaal",
|
|
"device_id": null
|
|
}
|
|
},
|
|
{
|
|
"name": "laadpaal max station current",
|
|
"room": "garage",
|
|
"type": "number",
|
|
"id": {
|
|
"entity_id": "number.laadpaal_max_station_current",
|
|
"device_id": null
|
|
}
|
|
},
|
|
{
|
|
"name": "goedkope laadtijden",
|
|
"room": "system",
|
|
"type": "input_text",
|
|
"id": {
|
|
"entity_id": "input_text.goedkopelaadtijden",
|
|
"device_id": null
|
|
}
|
|
},
|
|
{
|
|
"name": "mobile app iphone",
|
|
"room": "mobile",
|
|
"type": "notify",
|
|
"id": {
|
|
"entity_id": "notify.mobile_app_iphone",
|
|
"device_id": null
|
|
}
|
|
},
|
|
{
|
|
"name": "laden klaar",
|
|
"room": "system",
|
|
"type": "input_number",
|
|
"id": {
|
|
"entity_id": "input_number.laden_klaar",
|
|
"device_id": null
|
|
}
|
|
},
|
|
{
|
|
"name": "tesla battery level",
|
|
"room": "car",
|
|
"type": "sensor",
|
|
"id": {
|
|
"entity_id": "sensor.tesla_battery_level",
|
|
"device_id": null
|
|
}
|
|
},
|
|
{
|
|
"name": "nordpool kwh nl eur",
|
|
"room": "energy",
|
|
"type": "sensor",
|
|
"id": {
|
|
"entity_id": "sensor.nordpool_kwh_nl_eur_2_11_031",
|
|
"device_id": null
|
|
}
|
|
}
|
|
]
|
|
}
|
|
] |