[ { "id": "turn_tv_on_if_not_already_on", "automation": "- alias: Turn TV on if not already on\n id: turn_tv_on_if_not_already_on\n description: Required to turn the TV on from Home Assistant - sends a wake on lan\n magic packet\n triggers:\n - trigger: webostv.turn_on\n entity_id: media_player.tv\n actions:\n - action: wake_on_lan.send_magic_packet\n data:\n mac: secret tv_mac", "config": [ { "name": "TV", "room": "living_room", "type": "media_player", "id": { "entity_id": "media_player.tv", "device_id": null } } ] }, { "id": "renew_lgtv_developer_mode_session_weekly", "automation": "- alias: Renew LG TV developer mode session weekly\n id: renew_lgtv_developer_mode_session_weekly\n description: Required to use TV app launcher and media state reporter\n actions:\n - action: rest_command.renew_lgtv_developer_mode_session\n triggers:\n - trigger: time\n at: 01:01:01\n conditions:\n - condition: time\n weekday:\n - sun\n mode: single", "config": [] }, { "id": "reset_security_monitoring_start_time", "automation": "- alias: Reset security monitoring start time\n id: reset_security_monitoring_start_time\n triggers:\n trigger: state\n entity_id: sensor.security_monitoring\n condition:\n condition: template\n value_template: '{{ trigger.from_state.state == ''off'' }}'\n actions:\n - action: input_datetime.set_datetime\n target:\n entity_id: input_datetime.security_monitoring_start_time\n data:\n datetime: '{{ now() }}'", "config": [ { "name": "security monitoring", "room": null, "type": "sensor", "id": { "entity_id": "sensor.security_monitoring", "device_id": null } }, { "name": "security monitoring start time", "room": null, "type": "input_datetime", "id": { "entity_id": "input_datetime.security_monitoring_start_time", "device_id": null } } ] }, { "id": "update_device_issue_and_battery_groups", "automation": "- alias: Update device issue and battery groups\n id: update_device_issue_and_battery_groups\n description: Update device issue and battery groups\n mode: single\n max_exceeded: silent\n triggers:\n - trigger: event\n event_type: call_service\n event_data:\n domain: group\n service: reload\n - trigger: time_pattern\n minutes: /5\n actions:\n - action: group.set\n data:\n object_id: unavailable_entities\n entities: \"{% set allowed_entities = [\\n 'sensor.power_meter_relative_self_consumption',\\n\\\n ] + integration_entities('iBeacon Tracker') + integration_entities('netgear')|select('search',\\\n \\ '_ssid$')|list %} {% set unknown_allowed_entities =\\n [\\n states.sensor.extreme_forecast,\\n\\\n \\ ]\\n |selectattr('state', 'eq', 'unknown')\\n |map(attribute='entity_id')|list\\n\\\n %} {% set long_delay_hours = 3 %} {% set long_unknown_allowed_entities =\\n\\\n \\ [\\n states.sensor.rachel_s_phone_detected_activity,\\n states.binary_sensor.rachel_s_phone_still,\\n\\\n \\ ]\\n |selectattr('state', 'eq', 'unknown')\\n |selectattr('last_changed',\\\n \\ 'ge', (now().timestamp() - long_delay_hours*60*60)|as_datetime)\\n |map(attribute='entity_id')|list\\n\\\n %} {% set disabled_entities = state_attr('sensor.disabled_device_entities',\\\n \\ 'entities')\\n |regex_replace(find='\\\\[|\\\\]|\\\\{|\\\\}|\\\\'entity_id\\\\':',\\\n \\ replace='')\\n |map(attribute='entity_id')|list\\n%} {% set delay_minutes\\\n \\ = 5 %} {{ states\\n |rejectattr('entity_id', 'in', allowed_entities +\\\n \\ unknown_allowed_entities + long_unknown_allowed_entities + disabled_entities)\\n\\\n \\ |rejectattr('entity_id', 'has_value')\\n |rejectattr('domain', 'in',\\\n \\ ['button', 'event', 'group', 'image', 'select'])\\n |rejectattr('last_changed',\\\n \\ 'ge', (now().timestamp() - delay_minutes * 60)|as_datetime)\\n |map(attribute='entity_id')|list\\n\\\n }}\\n\"\n - action: group.set\n data:\n object_id: frozen_entities\n entities: \"{% set frozen_entities_10_minute_check_entities =\\n [\\n states.sensor.outside_apparent_temperature,\\n\\\n \\ states.sensor.bedroom_presence_sensor_esp_temperature,\\n states.sensor.kitchen_presence_sensor_esp_temperature,\\n\\\n \\ states.sensor.nursery_presence_sensor_esp_temperature,\\n states.sensor.office_presence_sensor_esp_temperature,\\n\\\n \\ states.sensor.smart_meter_real_power,\\n states.sensor.power_meter_power_load_consumed,\\n\\\n \\ ]\\n |selectattr('entity_id', 'has_value')\\n |selectattr('last_updated',\\\n \\ 'le', (now().timestamp() - 10 * 60)|as_datetime)\\n |map(attribute='entity_id')|list\\n\\\n %} {% set frozen_entities_12_hour_check_entities =\\n (\\n states.sensor|selectattr('entity_id',\\\n \\ 'search', 'r_temperature$|feels_like|voltage$|last_seen')|list +\\n \\\n \\ [\\n states.sensor.nursery_heater_uncalibrated_temperature,\\n \\\n \\ ]\\n )\\n |selectattr('entity_id', 'has_value')\\n |selectattr('last_updated',\\\n \\ 'le', (now().timestamp() - 12 * 60 * 60)|as_datetime)\\n |map(attribute='entity_id')|list\\n\\\n %} {{ frozen_entities_10_minute_check_entities + frozen_entities_12_hour_check_entities\\\n \\ }}\\n\"\n - action: group.set\n data:\n object_id: low_batteries\n entities: '{% set low_battery_threshold = 25 %} {% set entities = states.sensor|selectattr(''entity_id'',\n ''search'', ''battery_level$'')|map(attribute=''entity_id'')|list|sort %}\n {% set battery_levels = entities|map(''states'')|map(''float'', 0)|list %}\n {{ zip(entities, battery_levels)|selectattr(1, ''<='', low_battery_threshold)|map(attribute=0)|list\n }}\n\n '\n - action: group.set\n data:\n object_id: charging_batteries\n entities: '{% set entities = states.sensor|selectattr(''entity_id'', ''search'',\n ''charging_status$|battery_state$'')|map(attribute=''entity_id'')|list|sort\n %} {% set status = entities|map(''states'')|list %} {% set entities = zip(entities,\n status)|selectattr(1, ''in'', [''charging'', ''Charging'', ''full'', ''Full''])|map(attribute=0)|list\n %} {{ entities|map(''replace'', ''battery_state'', ''battery_level'')|map(''replace'',\n ''charging_status'', ''battery_level'')|list }}\n\n '", "config": [ { "name": "power meter relative self consumption", "room": null, "type": "sensor", "id": { "entity_id": "sensor.power_meter_relative_self_consumption", "device_id": null } }, { "name": "extreme forecast", "room": null, "type": "sensor", "id": { "entity_id": "sensor.extreme_forecast", "device_id": null } }, { "name": "rachel's phone detected activity", "room": null, "type": "sensor", "id": { "entity_id": "sensor.rachel_s_phone_detected_activity", "device_id": null } }, { "name": "rachel's phone still", "room": null, "type": "binary_sensor", "id": { "entity_id": "binary_sensor.rachel_s_phone_still", "device_id": null } }, { "name": "disabled device entities", "room": null, "type": "sensor", "id": { "entity_id": "sensor.disabled_device_entities", "device_id": null } }, { "name": "outside apparent temperature", "room": "outside", "type": "sensor", "id": { "entity_id": "sensor.outside_apparent_temperature", "device_id": null } }, { "name": "bedroom presence sensor esp temperature", "room": "bedroom", "type": "sensor", "id": { "entity_id": "sensor.bedroom_presence_sensor_esp_temperature", "device_id": null } }, { "name": "kitchen presence sensor esp temperature", "room": "kitchen", "type": "sensor", "id": { "entity_id": "sensor.kitchen_presence_sensor_esp_temperature", "device_id": null } }, { "name": "nursery presence sensor esp temperature", "room": "nursery", "type": "sensor", "id": { "entity_id": "sensor.nursery_presence_sensor_esp_temperature", "device_id": null } }, { "name": "office presence sensor esp temperature", "room": "office", "type": "sensor", "id": { "entity_id": "sensor.office_presence_sensor_esp_temperature", "device_id": null } }, { "name": "smart meter real power", "room": null, "type": "sensor", "id": { "entity_id": "sensor.smart_meter_real_power", "device_id": null } }, { "name": "power meter power load consumed", "room": null, "type": "sensor", "id": { "entity_id": "sensor.power_meter_power_load_consumed", "device_id": null } }, { "name": "nursery heater uncalibrated temperature", "room": "nursery", "type": "sensor", "id": { "entity_id": "sensor.nursery_heater_uncalibrated_temperature", "device_id": null } } ] }, { "id": "reset_plants_last_watered", "automation": "- alias: Reset plants last watered\n id: reset_plants_last_watered\n triggers:\n trigger: state\n entity_id: sensor.dry_plants\n to: '0'\n not_from:\n - '0'\n - unknown\n - unavaiable\n - none\n actions:\n - action: input_datetime.set_datetime\n target:\n entity_id: input_datetime.plants_last_watered\n data:\n datetime: '{{ now() }}'", "config": [ { "name": "plants last watered", "room": null, "type": "input_datetime", "id": { "entity_id": "input_datetime.plants_last_watered", "device_id": null } }, { "name": "dry plants", "room": null, "type": "sensor", "id": { "entity_id": "sensor.dry_plants", "device_id": null } } ] } ]