335 lines
13 KiB
JSON
335 lines
13 KiB
JSON
[
|
|
{
|
|
"id": "Poll Smartcar",
|
|
"automation": "- alias: Poll Smartcar\n description: 'Poll Smartcar for battery state both shortly after arriving at home\n and also every hour when not at home. Additionally, poll for all data once a day\n at 4pm.\n\n '\n mode: single\n triggers:\n - trigger: time_pattern\n hours: '16'\n id: update_all\n - trigger: state\n entity_id:\n - person.akio_toyoda\n to: home\n for:\n hours: 0\n minutes: 10\n seconds: 0\n id: update_battery\n variables:\n condition_precheck: is_daytime\n - trigger: time_pattern\n hours: '*'\n id: update_battery\n variables:\n condition_precheck: not_home\n conditions:\n - condition: template\n value_template: \"{% if condition_precheck == 'is_daytime' %}\\n {{ now().hour\\\n \\ >= 9 and now().hour < 21 }}\\n{% elif condition_precheck == 'not_home' %}\\n\\\n \\ {{ is_state('person.akio_toyoda', 'not_home') }}\\n{% else %}\\n true\\n{%\\\n \\ endif %}\\n\"\n actions:\n - choose:\n - conditions:\n - condition: trigger\n id: update_battery\n sequence:\n - action: homeassistant.update_entity\n data:\n entity_id:\n - sensor.volkswagen_id_4_battery\n - sensor.volkswagen_id_4_range\n - conditions:\n - condition: trigger\n id: update_all\n sequence:\n - action: homeassistant.update_entity\n data:\n entity_id:\n - binary_sensor.volkswagen_id_4_charging_cable_plugged_in\n - device_tracker.volkswagen_id_4_location\n - lock.volkswagen_id_4_door_lock\n - number.volkswagen_id_4_charge_limit\n - sensor.volkswagen_id_4_battery\n - sensor.volkswagen_id_4_battery_capacity\n - sensor.volkswagen_id_4_charging_status\n - sensor.volkswagen_id_4_engine_oil_life\n - sensor.volkswagen_id_4_fuel\n - sensor.volkswagen_id_4_odometer\n - sensor.volkswagen_id_4_range\n - sensor.volkswagen_id_4_tire_pressure_back_left\n - sensor.volkswagen_id_4_tire_pressure_back_right\n - sensor.volkswagen_id_4_tire_pressure_front_left\n - sensor.volkswagen_id_4_tire_pressure_front_right\n - switch.volkswagen_id_4_charging",
|
|
"config": [
|
|
{
|
|
"name": "Akio Toyoda",
|
|
"room": null,
|
|
"type": "person",
|
|
"id": {
|
|
"entity_id": "person.akio_toyoda",
|
|
"device_id": null
|
|
}
|
|
},
|
|
{
|
|
"name": "Volkswagen ID 4 battery",
|
|
"room": null,
|
|
"type": "sensor",
|
|
"id": {
|
|
"entity_id": "sensor.volkswagen_id_4_battery",
|
|
"device_id": null
|
|
}
|
|
},
|
|
{
|
|
"name": "Volkswagen ID 4 range",
|
|
"room": null,
|
|
"type": "sensor",
|
|
"id": {
|
|
"entity_id": "sensor.volkswagen_id_4_range",
|
|
"device_id": null
|
|
}
|
|
},
|
|
{
|
|
"name": "Volkswagen ID 4 charging cable plugged in",
|
|
"room": null,
|
|
"type": "binary_sensor",
|
|
"id": {
|
|
"entity_id": "binary_sensor.volkswagen_id_4_charging_cable_plugged_in",
|
|
"device_id": null
|
|
}
|
|
},
|
|
{
|
|
"name": "Volkswagen ID 4 location",
|
|
"room": null,
|
|
"type": "device_tracker",
|
|
"id": {
|
|
"entity_id": "device_tracker.volkswagen_id_4_location",
|
|
"device_id": null
|
|
}
|
|
},
|
|
{
|
|
"name": "Volkswagen ID 4 door lock",
|
|
"room": null,
|
|
"type": "lock",
|
|
"id": {
|
|
"entity_id": "lock.volkswagen_id_4_door_lock",
|
|
"device_id": null
|
|
}
|
|
},
|
|
{
|
|
"name": "Volkswagen ID 4 charge limit",
|
|
"room": null,
|
|
"type": "number",
|
|
"id": {
|
|
"entity_id": "number.volkswagen_id_4_charge_limit",
|
|
"device_id": null
|
|
}
|
|
},
|
|
{
|
|
"name": "Volkswagen ID 4 battery capacity",
|
|
"room": null,
|
|
"type": "sensor",
|
|
"id": {
|
|
"entity_id": "sensor.volkswagen_id_4_battery_capacity",
|
|
"device_id": null
|
|
}
|
|
},
|
|
{
|
|
"name": "Volkswagen ID 4 charging status",
|
|
"room": null,
|
|
"type": "sensor",
|
|
"id": {
|
|
"entity_id": "sensor.volkswagen_id_4_charging_status",
|
|
"device_id": null
|
|
}
|
|
},
|
|
{
|
|
"name": "Volkswagen ID 4 engine oil life",
|
|
"room": null,
|
|
"type": "sensor",
|
|
"id": {
|
|
"entity_id": "sensor.volkswagen_id_4_engine_oil_life",
|
|
"device_id": null
|
|
}
|
|
},
|
|
{
|
|
"name": "Volkswagen ID 4 fuel",
|
|
"room": null,
|
|
"type": "sensor",
|
|
"id": {
|
|
"entity_id": "sensor.volkswagen_id_4_fuel",
|
|
"device_id": null
|
|
}
|
|
},
|
|
{
|
|
"name": "Volkswagen ID 4 odometer",
|
|
"room": null,
|
|
"type": "sensor",
|
|
"id": {
|
|
"entity_id": "sensor.volkswagen_id_4_odometer",
|
|
"device_id": null
|
|
}
|
|
},
|
|
{
|
|
"name": "Volkswagen ID 4 tire pressure back left",
|
|
"room": null,
|
|
"type": "sensor",
|
|
"id": {
|
|
"entity_id": "sensor.volkswagen_id_4_tire_pressure_back_left",
|
|
"device_id": null
|
|
}
|
|
},
|
|
{
|
|
"name": "Volkswagen ID 4 tire pressure back right",
|
|
"room": null,
|
|
"type": "sensor",
|
|
"id": {
|
|
"entity_id": "sensor.volkswagen_id_4_tire_pressure_back_right",
|
|
"device_id": null
|
|
}
|
|
},
|
|
{
|
|
"name": "Volkswagen ID 4 tire pressure front left",
|
|
"room": null,
|
|
"type": "sensor",
|
|
"id": {
|
|
"entity_id": "sensor.volkswagen_id_4_tire_pressure_front_left",
|
|
"device_id": null
|
|
}
|
|
},
|
|
{
|
|
"name": "Volkswagen ID 4 tire pressure front right",
|
|
"room": null,
|
|
"type": "sensor",
|
|
"id": {
|
|
"entity_id": "sensor.volkswagen_id_4_tire_pressure_front_right",
|
|
"device_id": null
|
|
}
|
|
},
|
|
{
|
|
"name": "Volkswagen ID 4 charging",
|
|
"room": null,
|
|
"type": "switch",
|
|
"id": {
|
|
"entity_id": "switch.volkswagen_id_4_charging",
|
|
"device_id": null
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"id": "Poll Smartcar",
|
|
"automation": "- alias: Poll Smartcar\n description: 'Poll Smartcar from every four hours from 9am to 9pm for most entities\n and every 15 minutes when charging with a reduced set of entities.\n\n This results in 9 API requests every 4 hours during a 12 hour window or 27 API\n requests per day minimum or 830 per month if all entities are enabled.\n\n It could, however, also make 3 API requests every 15 minutes while charging. Assuming\n your car charges for about 2 hours ever day, this is an additional 24 requests\n per day, buut it could be more.\n\n To bring this within the free tier limits, you could:\n\n - Disable entities you do not use - Remove them from the updates being made below\n - Change the frequency of updates\n\n '\n mode: single\n triggers:\n - trigger: time_pattern\n hours: /4\n variables:\n update_if: idle\n update_entities:\n - binary_sensor.volkswagen_id_4_charging_cable_plugged_in\n - device_tracker.volkswagen_id_4_location\n - lock.volkswagen_id_4_door_lock\n - sensor.volkswagen_id_4_battery\n - sensor.volkswagen_id_4_battery_capacity\n - sensor.volkswagen_id_4_charging_status\n - sensor.volkswagen_id_4_engine_oil_life\n - sensor.volkswagen_id_4_fuel\n - sensor.volkswagen_id_4_odometer\n - sensor.volkswagen_id_4_range\n - sensor.volkswagen_id_4_tire_pressure_back_left\n - sensor.volkswagen_id_4_tire_pressure_back_right\n - sensor.volkswagen_id_4_tire_pressure_front_left\n - sensor.volkswagen_id_4_tire_pressure_front_right\n - switch.volkswagen_id_4_charging\n - trigger: time_pattern\n minutes: /15\n variables:\n update_if: charging\n update_entities:\n - binary_sensor.volkswagen_id_4_charging_cable_plugged_in\n - number.volkswagen_id_4_charge_limit\n - sensor.volkswagen_id_4_battery\n - sensor.volkswagen_id_4_charging_status\n - sensor.volkswagen_id_4_range\n - switch.volkswagen_id_4_charging\n conditions:\n - condition: time\n after: 09:00:00\n before: '21:00:00'\n - condition: template\n value_template: \"{% set is_charging = is_state(\\n 'sensor.volkswagen_id_4_charging_status',\\n\\\n \\ 'CHARGING'\\n) %} {{\\n (update_if == 'charging' and is_charging) or\\n (update_if\\\n \\ == 'idle' and not is_charging)\\n}}\\n\"\n actions:\n - action: homeassistant.update_entity\n data:\n entity_id: '{{ update_entities }}'",
|
|
"config": [
|
|
{
|
|
"name": "Volkswagen ID 4 battery",
|
|
"room": null,
|
|
"type": "sensor",
|
|
"id": {
|
|
"entity_id": "sensor.volkswagen_id_4_battery",
|
|
"device_id": null
|
|
}
|
|
},
|
|
{
|
|
"name": "Volkswagen ID 4 range",
|
|
"room": null,
|
|
"type": "sensor",
|
|
"id": {
|
|
"entity_id": "sensor.volkswagen_id_4_range",
|
|
"device_id": null
|
|
}
|
|
},
|
|
{
|
|
"name": "Volkswagen ID 4 charging cable plugged in",
|
|
"room": null,
|
|
"type": "binary_sensor",
|
|
"id": {
|
|
"entity_id": "binary_sensor.volkswagen_id_4_charging_cable_plugged_in",
|
|
"device_id": null
|
|
}
|
|
},
|
|
{
|
|
"name": "Volkswagen ID 4 location",
|
|
"room": null,
|
|
"type": "device_tracker",
|
|
"id": {
|
|
"entity_id": "device_tracker.volkswagen_id_4_location",
|
|
"device_id": null
|
|
}
|
|
},
|
|
{
|
|
"name": "Volkswagen ID 4 door lock",
|
|
"room": null,
|
|
"type": "lock",
|
|
"id": {
|
|
"entity_id": "lock.volkswagen_id_4_door_lock",
|
|
"device_id": null
|
|
}
|
|
},
|
|
{
|
|
"name": "Volkswagen ID 4 charge limit",
|
|
"room": null,
|
|
"type": "number",
|
|
"id": {
|
|
"entity_id": "number.volkswagen_id_4_charge_limit",
|
|
"device_id": null
|
|
}
|
|
},
|
|
{
|
|
"name": "Volkswagen ID 4 battery capacity",
|
|
"room": null,
|
|
"type": "sensor",
|
|
"id": {
|
|
"entity_id": "sensor.volkswagen_id_4_battery_capacity",
|
|
"device_id": null
|
|
}
|
|
},
|
|
{
|
|
"name": "Volkswagen ID 4 charging status",
|
|
"room": null,
|
|
"type": "sensor",
|
|
"id": {
|
|
"entity_id": "sensor.volkswagen_id_4_charging_status",
|
|
"device_id": null
|
|
}
|
|
},
|
|
{
|
|
"name": "Volkswagen ID 4 engine oil life",
|
|
"room": null,
|
|
"type": "sensor",
|
|
"id": {
|
|
"entity_id": "sensor.volkswagen_id_4_engine_oil_life",
|
|
"device_id": null
|
|
}
|
|
},
|
|
{
|
|
"name": "Volkswagen ID 4 fuel",
|
|
"room": null,
|
|
"type": "sensor",
|
|
"id": {
|
|
"entity_id": "sensor.volkswagen_id_4_fuel",
|
|
"device_id": null
|
|
}
|
|
},
|
|
{
|
|
"name": "Volkswagen ID 4 odometer",
|
|
"room": null,
|
|
"type": "sensor",
|
|
"id": {
|
|
"entity_id": "sensor.volkswagen_id_4_odometer",
|
|
"device_id": null
|
|
}
|
|
},
|
|
{
|
|
"name": "Volkswagen ID 4 tire pressure back left",
|
|
"room": null,
|
|
"type": "sensor",
|
|
"id": {
|
|
"entity_id": "sensor.volkswagen_id_4_tire_pressure_back_left",
|
|
"device_id": null
|
|
}
|
|
},
|
|
{
|
|
"name": "Volkswagen ID 4 tire pressure back right",
|
|
"room": null,
|
|
"type": "sensor",
|
|
"id": {
|
|
"entity_id": "sensor.volkswagen_id_4_tire_pressure_back_right",
|
|
"device_id": null
|
|
}
|
|
},
|
|
{
|
|
"name": "Volkswagen ID 4 tire pressure front left",
|
|
"room": null,
|
|
"type": "sensor",
|
|
"id": {
|
|
"entity_id": "sensor.volkswagen_id_4_tire_pressure_front_left",
|
|
"device_id": null
|
|
}
|
|
},
|
|
{
|
|
"name": "Volkswagen ID 4 tire pressure front right",
|
|
"room": null,
|
|
"type": "sensor",
|
|
"id": {
|
|
"entity_id": "sensor.volkswagen_id_4_tire_pressure_front_right",
|
|
"device_id": null
|
|
}
|
|
},
|
|
{
|
|
"name": "Volkswagen ID 4 charging",
|
|
"room": null,
|
|
"type": "switch",
|
|
"id": {
|
|
"entity_id": "switch.volkswagen_id_4_charging",
|
|
"device_id": null
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"id": "Poll Smartcar",
|
|
"automation": "- alias: Poll Smartcar\n description: 'Poll Smartcar every hour from 9am to 9pm for just the battery and\n range.\n\n These sensors are obtained from the same API endpoint, so this results in 12 API\n requests every day or 360 each month.\n\n '\n mode: single\n triggers:\n - trigger: time_pattern\n hours: '*'\n conditions:\n - condition: time\n after: 09:00:00\n before: '21:00:00'\n actions:\n - action: homeassistant.update_entity\n data:\n entity_id:\n - sensor.volkswagen_id_4_battery\n - sensor.volkswagen_id_4_range",
|
|
"config": [
|
|
{
|
|
"name": "Volkswagen ID 4 battery",
|
|
"room": null,
|
|
"type": "sensor",
|
|
"id": {
|
|
"entity_id": "sensor.volkswagen_id_4_battery",
|
|
"device_id": null
|
|
}
|
|
},
|
|
{
|
|
"name": "Volkswagen ID 4 range",
|
|
"room": null,
|
|
"type": "sensor",
|
|
"id": {
|
|
"entity_id": "sensor.volkswagen_id_4_range",
|
|
"device_id": null
|
|
}
|
|
}
|
|
]
|
|
}
|
|
] |