101 lines
3.8 KiB
JSON
101 lines
3.8 KiB
JSON
[
|
|
{
|
|
"id": "Shower - Reset Counters",
|
|
"automation": "- alias: Shower - Reset Counters\n description: Reset session duration and water used to zero when a new shower session\n starts.\n triggers:\n - trigger: state\n entity_id:\n - binary_sensor.shower_active\n from: 'off'\n to: 'on'\n conditions: []\n actions:\n - action: input_number.set_value\n target:\n entity_id: input_number.shower_water_total\n data:\n value: 0\n - action: input_number.set_value\n data:\n value: 0\n target:\n entity_id: input_number.shower_duration\n mode: single",
|
|
"config": [
|
|
{
|
|
"name": "shower active sensor",
|
|
"room": "bathroom",
|
|
"type": "binary_sensor",
|
|
"id": {
|
|
"entity_id": "binary_sensor.shower_active",
|
|
"device_id": null
|
|
}
|
|
},
|
|
{
|
|
"name": "shower water total",
|
|
"room": "bathroom",
|
|
"type": "input_number",
|
|
"id": {
|
|
"entity_id": "input_number.shower_water_total",
|
|
"device_id": null
|
|
}
|
|
},
|
|
{
|
|
"name": "shower duration",
|
|
"room": "bathroom",
|
|
"type": "input_number",
|
|
"id": {
|
|
"entity_id": "input_number.shower_duration",
|
|
"device_id": null
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"id": "Shower - Track Session Length",
|
|
"automation": "- alias: Shower - Track Session Length\n description: ''\n triggers:\n - trigger: time_pattern\n seconds: /1\n conditions:\n - condition: state\n entity_id: binary_sensor.shower_active\n state: 'on'\n actions:\n - action: input_number.increment\n target:\n entity_id: input_number.shower_duration\n data: {}\n mode: single",
|
|
"config": [
|
|
{
|
|
"name": "shower active sensor",
|
|
"room": "bathroom",
|
|
"type": "binary_sensor",
|
|
"id": {
|
|
"entity_id": "binary_sensor.shower_active",
|
|
"device_id": null
|
|
}
|
|
},
|
|
{
|
|
"name": "shower duration",
|
|
"room": "bathroom",
|
|
"type": "input_number",
|
|
"id": {
|
|
"entity_id": "input_number.shower_duration",
|
|
"device_id": null
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"id": "Shower - Track Water",
|
|
"automation": "- alias: Shower - Track Water\n description: Use current flow rate to calculate total water used.\n triggers:\n - trigger: time_pattern\n seconds: /1\n conditions:\n - condition: state\n entity_id: binary_sensor.shower_active\n state: 'on'\n actions:\n - action: input_number.set_value\n target:\n entity_id: input_number.shower_water_total\n data:\n value: \"{{ (\\n states('input_number.shower_water_total') | float \\n\\\n \\ + ((states('sensor.esphome_shower_temp_hot_water_flow') | float\\\n \\ \\n + states('sensor.esphome_shower_temp_cold_water_flow') | float)\\\n \\ / 60)\\n ) | round(2) }}\\n\"\n mode: single",
|
|
"config": [
|
|
{
|
|
"name": "shower active sensor",
|
|
"room": "bathroom",
|
|
"type": "binary_sensor",
|
|
"id": {
|
|
"entity_id": "binary_sensor.shower_active",
|
|
"device_id": null
|
|
}
|
|
},
|
|
{
|
|
"name": "shower water total",
|
|
"room": "bathroom",
|
|
"type": "input_number",
|
|
"id": {
|
|
"entity_id": "input_number.shower_water_total",
|
|
"device_id": null
|
|
}
|
|
},
|
|
{
|
|
"name": "shower hot water flow sensor",
|
|
"room": "bathroom",
|
|
"type": "sensor",
|
|
"id": {
|
|
"entity_id": "sensor.esphome_shower_temp_hot_water_flow",
|
|
"device_id": null
|
|
}
|
|
},
|
|
{
|
|
"name": "shower cold water flow sensor",
|
|
"room": "bathroom",
|
|
"type": "sensor",
|
|
"id": {
|
|
"entity_id": "sensor.esphome_shower_temp_cold_water_flow",
|
|
"device_id": null
|
|
}
|
|
}
|
|
]
|
|
}
|
|
] |