Home automation has now become a reality accessible to everyone thanks to platforms like Home Assistant. This open-source solution allows you to centralize the management of many connected devices and fully customize your home automation experience. Whether for comfort, security or energy savings, Home Assistant offers unparalleled flexibility. However, creating complex scenarios can sometimes seem intimidating, especially for those who are not familiar with programming or scripting languages.
That's where ChatGPTcomes in. This artificial intelligence has been much talked about in the last two years, and it's impossible that you haven't heard of it! This AI can be used for many things, including home automation, to simplify the design of automation scenarios by helping users formulate their ideas, write code, or optimize scenarios already in place. By simply describing your needs, ChatGPT can guide you step by step to transform your intentions into functional scripts, adapted to your environment.
In this guide, we will explore how ChatGPT can assist you in creating Home Assistant scenarios to meet specific objectives: increasing the comfort of your home, strengthening the security of your home and saving energy. Through numerous concrete examples, you will discover how to take full advantage of automation to simplify your daily life and maximize the performance of your home automation system.
With this combination of Home Assistant and ChatGPT, not only will you be able to configure your home intelligently, but you will also be able to adjust and refine your scenarios according to your evolving needs, without having to dive into complex lines of code.
Understand your needs
Before diving into the creation of home automation scenarios, it is essential to clearly identify your needs and objectives. Home Assistant users often have different expectations depending on their priorities: some are looking to optimize comfort, others to improve security or reduce their energy consumption. ChatGPT can play a key role from this first step, by helping you formalize and refine your automation ideas. Because while Home Assistant is very easy to use from the start, by automatically detecting your various connected objects already installed in your home, the task is more complex when it comes to automating your home. The interface has certainly progressed a lot in recent months to facilitate the creation of scenarios, but most novice users simply have no idea what type of scenarios to set up. It’s a bit like writer’s block…
Analyze your habits to define scenarios
The first question to ask yourself is: what recurring actions or habits would you like to automate? For example:
- Do you want your lights to turn on and off automatically based on time or presence?
- Do you want your roller shutters to react based on weather forecasts?
- Do you need to strengthen security with instant notifications as soon as abnormal activity is detected?
ChatGPT can help you with this reflection by asking you targeted questions. Based on your answers, it will be able to suggest scenario ideas and show you how to structure them in Home Assistant. This step is crucial because it ensures that each automation truly meets your needs.
Translate needs into automatic actions
Once your needs are clearly identified, it is time to translate them into automatic actions in Home Assistant. ChatGPT can help you formulate these needs in simple terms and then transform them into actionable sequences of actions. For example:
- If you want to automate your lighting based on presence and time of day, ChatGPT can generate YAML code taking these parameters into account.
- If your goal is to regulate the indoor temperature optimally to save energy, ChatGPT can suggest automations that take into account data from temperature sensors and weather forecasts.
YAML (YAML Ain't Markup Language) is a human-readable data format, primarily used to write configuration files. It stands out for its simplicity, using space indentation to structure data. Unlike JSON or XML, it avoids tags and quotes, making it easier to read and write. In the context of Home Assistant, YAML is used to define automations, scenes, and configurations in a clear and concise way.
Real-world example: Turning on lights at dusk if someone is present
Let's say you want your lights to automatically turn on at dusk if someone is present in the room. Here's how ChatGPT can help you create this scenario:
- You describe the desired behavior: “I would like the lights to turn on after sunset, but only if someone is in the living room.”
- ChatGPT provides you with a YAML script that combines presence detection and sunset time. Here is an example of what ChatGPT could generate:
alias: Turn on lights at sunset if present
trigger:
- platform: sun
event: sunset
condition:
- condition: state
entity_id: binary_sensor.presence_salon
state: 'on'
action:
- service: light.turn_on
target:
entity_id: light.salon
This type of simple automation can be quickly adjusted and adapted to your needs with the help of ChatGPT, whether it is to adjust schedules, conditions or controlled devices.
Then all that remains is to copy it to Home Assistant. To do this:
- Go to Settings > Automations and Scenes.
- Click “Create Automation” at the bottom right to create a new scenario from the UI, then “Create New Automation”.

- Click the three dots at the top right of the automation page.
- Select Edit to YAML. This allows you to directly access the YAML code generated by the UI.
- You can copy the code provided by ChatGPT and modify it directly in the interface if necessary
- After modifying the YAML, save your automation.
- No need to restart Home Assistant, the changes take effect immediately.
Personalized support for each type of automation
Whether you want simple scenarios or complex automations, ChatGPT allows you to efficiently structure your needs and translate them into concrete scenarios. Through discussions, it can guide you to refine the details and make each automation as efficient and precise as possible. This saves you time and avoids configuration errors.
Creating Automation Scenarios with ChatGPT
Once the needs are well identified, the next step is to create the scenarios in Home Assistant. One of the main challenges for users is writing the code needed to automate their connected devices. ChatGPT simplifies this task by directly generating scripts tailored to your needs. We will explore several real-world examples where ChatGPT can be of great help in creating efficient and tailor-made automations.
Real-world example: Automate lighting based on time of day and presence
Let’s say you want the lights in your home to turn on and off automatically based on the presence in a room, but only at certain times of the day, such as in the evening or early in the morning. Here’s how ChatGPT can guide you step by step.
- Scenario Definition :
- You describe your requirement to ChatGPT: “I want my living room lights to automatically turn on in the evening when a presence is detected, but to turn off after a few minutes of inactivity.”
- Code Generation :
- ChatGPT takes this description and generates a corresponding YAML script, taking into account times and motion detection. Here is an example of code that ChatGPT could provide:
alias: Presence and time based lounge lighting
trigger:
- platform: state
entity_id: binary_sensor.presence_salon
to: 'on'
condition:
- condition: time
after: '18:00:00'
before: '23:59:00'
action:
- service: light.turn_on
target:
entity_id: light.salon
mode: single
- This script turns on the lounge light starting at 18:00 if a presence is detected. ChatGPT can also adjust this script based on how long the light should stay on before turning off.
- Script customization :
- If you want to add an automatic turn-off delay after a period of inactivity, you can ask ChatGPT to add this function. For example:
alias: Automatically turn off living room lights
trigger:
- platform: state
entity_id: binary_sensor.presence_salon
to: 'off'
for: '00:05:00' # Lights turn off after 5 minutes of inactivity
action:
- service: light.turn_off
target:
entity_id: light.salon
With a few simple exchanges, ChatGPT helps you create a complete scenario that meets your exact needs, while providing you with a clear explanation of the different sections of the code.
Concrete example: Managing roller shutters according to the weather
Another common example of automation is managing roller shutters according to the weather conditions, in order to regulate the temperature inside the house and save energy.
- Scenario Definition :
- You describe your need: “I would like my roller shutters to close automatically when the outside temperature exceeds 25°C to keep the house cool.”
- Script Generation :
- ChatGPT can generate a YAML script that takes into account the outside temperature measured by a sensor or a weather source. For example:
alias: Automatic closing of shutters in hot weather
trigger:
- platform: numeric_state
entity_id: sensor.temperature_exterieure
above: 25
action:
- service: cover.close_cover
target:
entity_id: cover.volets_salon
- Customization with additional conditions :
- If you want this automation to work only during certain hours (for example, only in the afternoon), you can ask ChatGPT to add this condition:
condition:
- condition: time
after: '12:00:00'
before: '18:00:00'
This example shows how ChatGPT can integrate different parameters (temperature, time, presence) into the same automation, thus offering maximum customization.
Concrete example: Activate a cinema atmosphere
Another type of automation, more oriented towards comfort, consists of creating ambient scenarios. For example, you might want to activate a “cinema” scene when you turn on the television, thus adjusting the lighting and surrounding devices to create an immersive atmosphere.
- Definition of the scenario :
- You describe your need: “I want the lights to dim and the curtains to close when I turn on the television.”
- Generating the script :
- ChatGPT can suggest a scenario that is triggered when the TV is turned on:
alias: Cinema scene
trigger:
- platform: state
entity_id: media_player.television
to: 'on'
action:
- service: light.turn_off
target:
entity_id: light.salon
- service: cover.close_cover
target:
entity_id: cover.rideaux_salon
- Adding variations :
- You can ask ChatGPT to add options, such as dimming the brightness instead of turning the lights off completely, or adjusting the room temperature:
action:
- service: light.turn_on
data:
entity_id: light.salon
brightness_pct: 20 # Light dimmed to 20%
ChatGPT is a valuable ally for translating your ideas into concrete scenarios in Home Assistant. Whether it’s a simple automation, like turning on a light, or a complex scenario involving multiple devices and conditions, ChatGPT simplifies the process by automatically generating the appropriate code.
Of course, ChatGPT provides generic code here. The entities will need to be replaced with your own entities, which you can find in Settings, Devices and Services, Entities tab:

Improve comfort with custom automations
One of the main benefits of automation is improving daily comfort. Home Assistant, combined with the flexibility of ChatGPT, allows you to personalize your home environment to suit your habits and preferences. You can automate lighting, adjust the temperature, or create ambiances adapted to each moment of the day.
Automate the lighting ambiance according to the time of day
Lighting plays a key role in indoor comfort. You can configure Home Assistant to automatically adjust the brightness and color of your lights according to the time of day, to create a warm atmosphere in the evening, for example, or a more dynamic one in the morning.
- Scenario definition :
- You could describe to ChatGPT: “I want my lights to gradually soften from sunset and become completely dimmed at 10 p.m.”
- Script generation :
- ChatGPT generates a script that adjusts the brightness based on sunset and time of day, with a gradual transition:
alias: Evening lights gradual adjustment
trigger:
- platform: sun
event: sunset
action:
- service: light.turn_on
data:
entity_id: light.salon
brightness_pct: 50 # Lights at 50% after sunset
- delay: '01:00:00' # Wait 1 hour
- service: light.turn_on
data:
entity_id: light.salon
brightness_pct: 20 # Lights at 20% after 1h
- Additional customization :
- You can ask ChatGPT to make the automation more complex by adding specific colors, for example switching to a warm tint in the evening:
action:
- service: light.turn_on
data:
entity_id: light.salon
brightness_pct: 50
color_name: warm_white # Warm white light after sunset
Concrete example: Activate a cinema atmosphere
Creating specific moods based on your activities can greatly improve the comfort in your home. For example, when you are watching a movie, you may want to dim the lights, close the curtains, and adjust the temperature. Here is how ChatGPT can help you create such a scenario.
- Scenario Definition :
- You describe your wish: “I want my lights to dim to 10% and my curtains to close when I start a movie on the TV.”
- Script generation :
- ChatGPT offers a scenario that is triggered when the television is turned on:
alias: Cinema atmosphere
trigger:
- platform: state
entity_id: media_player.television
to: 'on'
action:
- service: light.turn_on
data:
entity_id: light.salon
brightness_pct: 10 # Lights dimmed to 10%
- service: cover.close_cover
target:
entity_id: cover.rideaux_salon # Closing the curtains
- Combined scenario :
- You can ask ChatGPT to integrate other actions such as adjusting the temperature with your connected thermostat or triggering a surround sound system:
action:
- service: light.turn_on
data:
entity_id: light.salon
brightness_pct: 10
- service: cover.close_cover
target:
entity_id: cover.dark_room
- service: climate.set_temperature
data:
entity_id: climate.salon
temperature: 22 # Temperature set to 22°C
With the help of ChatGPT, you can adjust the atmosphere in your home according to your activities. Whether it's for reading, dining or watching a movie, automating these elements allows immediate comfort adapted to each moment of the day.
Automate thermal comfort management
Comfort also involves temperature management. Thanks to temperature sensors, connected thermostats and ChatGPT, you can create scenarios that automatically optimize the thermal regulation of your home.
- Scenario definition :
- You describe to ChatGPT: “I want my heating to turn on automatically when the temperature drops below 19°C and turn off when it exceeds 21°C.” Script generation
- : ChatGPT generates a script that takes into account the room temperature and adjusts the heating accordingly:
- alias: Automatic heating regulation
trigger:
- platform: numeric_state
entity_id: sensor.temperature_maison
below: 19
action:
- service: climate.set_hvac_mode
target:
entity_id: climate.chauffage_salon
data:
hvac_mode: heat
Optimized scenario with absence periods
- : ChatGPT can also integrate additional conditions, for example to reduce the temperature if the house is empty:
- condition:
- condition: state
entity_id: group.all_persons
state: 'not_home' # Only if no one is at home
Scheduled scenes for everyday comfort
Another way to improve comfort is to create “scenes” that group several actions at once. For example, you could have a “morning” scene that opens the blinds, turns on the lights, and adjusts the temperature, and an “evening” scene that dims the lights, closes the curtains, and puts the house in energy-saving mode.
Scenario definition
- : “I want a morning scene that opens the blinds, turns on the kitchen light, and sets the temperature to 21°C.”
- Script generation
- : ChatGPT generates the code for a scene that groups these actions:
- alias: Morning scene
sequence:
- service: cover.open_cover
target:
entity_id: cover.shutters_bedroom
- service: light.turn_on
target:
entity_id: light.kitchen
- service: climate.set_temperature
target:
entity_id: climate.home
data:
temperature: 21
Improvement and customization
- : ChatGPT can refine the scene with parameters such as the trigger time or the addition of outdoor light conditions.
- With ChatGPT’s assistance, you can create complex automation scenarios that improve the comfort of your daily life. With a few simple exchanges, you can configure lights, shutters, thermostats and other devices to meet your needs precisely and create a pleasant atmosphere at all times.
Strengthen home security
Security is a priority for many Home Assistant users. With the right configuration, you can transform your home into a connected fortress, capable of detecting anomalies, alerting you in case of danger or even simulating a presence to deter intruders. ChatGPT can assist you in creating automation scenarios to strengthen the security of your home, without requiring in-depth programming knowledge.
Concrete example: Instant alert in case a door is opened in your absence
One of the most basic and effective security scenarios is to receive an instant alert when someone opens a door or window in your absence. Here’s how ChatGPT can help you set up this type of scenario.
Scenario Definition
- : You tell ChatGPT: “I want to be alerted by a notification on my phone if a door opens when I'm not at home.”
- Script Generation
- : ChatGPT can generate a script that monitors the status of a door and sends a notification when the user is away:
- alias: Door open alert while I'm away
trigger:
- platform: state
entity_id: binary_sensor.entry_door
from: 'off'
to: 'on'
condition:
- condition: state
entity_id: group.all_persons
state: 'not_home' # Only if no one is home
action:
- service: notify.mobile_app_my_phone
data:
message: "Alert! The front door has been opened."
Alert Message Customization
- : You can ask ChatGPT to adjust the message sent or trigger multiple simultaneous actions (like turning on a camera or siren):
- action:
- service: camera.record
data:
entity_id: camera.camera_entree
duration: 30 # Record 30 seconds of video
- service: notify.mobile_app_mon_telephone
data:
message: "Alert! The front door has been opened."
This type of scenario can be adapted to different doors, windows or detectors, and allows you to be instantly notified in the event of a potential intrusion. The same type of alert can also be set up for the medicine cabinet or any sensitive room.
Concrete example: Presence simulation to deter intruders
Presence simulation is a technique used to deter burglars by making it appear that someone is at home even when they are not there. ChatGPT can help you set up scenarios where lights, TV, or other devices turn on and off at random times when you're away.
Scenario Definition
- : You tell ChatGPT: “I want my lights to turn on and off randomly in several rooms when I'm away, to simulate being present.”
- Script Generation
- : ChatGPT can create a scenario where lights turn on and off at random intervals while away:
- alias: Presence Simulation
trigger:
- platform: state
entity_id: group.all_persons
to: 'not_home' # Triggers when everyone is away
action:
- service: light.turn_on
target:
entity_id: light.livingroom
- delay:
minutes: '{{ range(10, 30) | random }}' # Random time between 10 and 30 minutes
- service: light.turn_off
target:
entity_id: light.salon
- service: light.turn_on
target:
entity_id: light.cuisine
- delay:
minutes: '{{ range(15, 45) | random }}' # Other random delay
- service: light.turn_off
target:
entity_id: light.cuisine
Adding variations and other devices
- : You can ask ChatGPT to include additional devices like a television or a radio to make the simulation even more realistic:
- action:
- service: light.turn_on
target:
entity_id: light.salon
- service: media_player.turn_on
target:
entity_id: media_player.television
- delay:
minutes: '{{ range(20, 40) | random }}'
- service: light.turn_off
target:
entity_id: light.salon
- service: media_player.turn_off
target:
entity_id: media_player.television
This automation allows you to simulate normal activity in the home, creating the illusion that someone is present, which can discourage potential intruders.
Real-life example: Enable video recording when motion is detected
If you have surveillance cameras, you can automate recording whenever motion is detected. This allows you to capture any suspicious activity, even if you are not home to monitor in real-time.
Scenario definition
- : You describe to ChatGPT: “I want my cameras to automatically record when motion is detected.”
- Script generation
- : ChatGPT can generate a script that activates video recording as soon as a motion sensor detects activity:
- alias: Record on motion detection
trigger:
- platform: state
entity_id: binary_sensor.movement_jardin
to: 'on'
action:
- service: camera.record
target:
entity_id: camera.jardin
data:
duration: 60 # Record 60 seconds of video
Adding a notification and customization
- : You can customize this script to receive a notification when recording starts:
- action:
- service: camera.record
target:
entity_id: camera.jardin
data:
duration: 60
- service: notify.mobile_app_mon_telephone
data:
message: "Motion detected in the garden. Recording in progress."
This automation allows you to remotely monitor everything that happens around your home and keep records in case of an incident.
Secure access and doors
With smart locks, you can also strengthen the security of your doors by automating their locking or monitoring access attempts. For example, ChatGPT can help you create a scenario where the doors automatically lock at a certain time, or when everyone leaves the house.
Scenario definition
- : You tell ChatGPT: “I want my front door to automatically lock at 10 p.m., or when everyone leaves the house.”
- Script Generation
- : ChatGPT generates a script to lock the door based on these criteria:
- alias: Automatic door lock
trigger:
- platform: time
at: '22:00:00'
- platform: state
entity_id: group.all_persons
to: 'not_home' # When no one is home
action:
- service: lock.lock
target:
entity_id: lock.door_entry
This type of scenario enhances security by ensuring that doors are always locked when you are away or at night.
With the help of ChatGPT, you can create sophisticated security scenarios that cover all aspects of protecting your home. Whether it's receiving instant alerts, recording surveillance videos, or simulating a presence when you are away, ChatGPT makes it easy to create these automations by tailoring them precisely to your needs.
Reduced energy consumption
Home automation is not just about improving comfort or security: it can also be a great way to save energy. With Home Assistant and ChatGPT, it is possible to create smart scenarios that optimize the consumption of devices based on various parameters (presence, weather, electricity consumption).
Automate heating and air conditioning based on presence
One of the main sources of energy expenditure in a home is the management of heating and air conditioning. By automating these systems so that they only run when necessary, you can avoid waste.
Scenario definition
- : You could explain to ChatGPT: “I want my heating to turn off automatically when no one is home and turn it back on 30 minutes before I return.”
- Script generation
- : ChatGPT can generate a scenario that takes into account the presence in the house and controls the heating accordingly:
- alias: Heating management according to presence
trigger:
- platform: state
entity_id: group.all_persons
to: 'not_home'
- platform: state
entity_id: group.all_persons
to: 'home'
condition:
- condition: state
entity_id: climate.maison
state: 'heat'
action:
- choose:
- conditions:
- condition: state
entity_id: group.all_persons
state: 'not_home'
sequence:
- service: climate.set_hvac_mode
target:
entity_id: climate.maison
data:
hvac_mode: 'off'
- conditions:
- condition: state
entity_id: group.all_persons
state: 'home'
sequence:
- service: climate.set_hvac_mode
target:
entity_id: climate.maison
data:
hvac_mode: 'heat'
Improvement with a restart delay
- : If you want the heating to turn back on a little before you return, ChatGPT can add a delay:
- action:
- delay: '00:30:00' # The heating restarts 30 minutes before you return
- service: climate.set_hvac_mode
target:
entity_id: climate.maison
data:
hvac_mode: 'heat'
This type of automation allows you to efficiently manage your heating, preventing it from running unnecessarily when you are not at home.
Use temperature sensors for fine-tuning
You can also use temperature sensors to automatically adjust the heating or cooling according to the actual conditions inside the house, and not only according to schedules or presence.
Scenario definition
- : You ask ChatGPT: “I want my heating to turn on automatically when the temperature in the living room drops below 19°C.”
- Script generation
- : ChatGPT offers a script based on the temperature sensors integrated into Home Assistant:
- alias: Automatic heating control
trigger:
- platform: numeric_state
entity_id: sensor.temperature_salon
below: 19
action:
- service: climate.set_hvac_mode
target:
entity_id: climate.salon
data:
hvac_mode: 'heat'
Optimization according to the outdoor weather
- : You can also ask ChatGPT to adjust the heating operation according to the weather forecast:
- condition:
- condition: numeric_state
entity_id: sensor.temperature_exterieure
below: 10 # Heating activated only if the outdoor temperature is below 10°C
This automation allows you to regulate the temperature precisely, according to the indoor and outdoor conditions, which optimizes energy consumption.
Turn off devices on standby to avoid waste
Many devices, such as TVs or chargers, continue to consume electricity when they are on standby. Home Assistant and ChatGPT can help you automate the turning off of these devices at night or when you are not at home.
Scenario definition
- : You could tell ChatGPT: “I want all devices plugged into a smart plug to automatically turn off at night.”
- Script generation
- : ChatGPT can generate a script to turn off these devices at a specific time or based on presence:
- alias: Automatically turn off devices at night
trigger:
- platform: time
at: '23:00:00'
action:
- service: switch.turn_off
target:
entity_id: switch.connected_plugs
Adding a presence condition
- : You can customize this script so that devices turn off only if no one is home or if everyone is asleep:
- condition:
- condition: state
entity_id: group.all_persons
state: 'not_home' # Turn off only if everyone is gone
This helps avoid unnecessary consumption, especially when you are asleep or away. Real-time energy consumption monitoring and optimization
Home Assistant also allows you to monitor energy consumption in real time, using sensors or specific integrations. ChatGPT can help you set up dashboards that show you the consumption of different devices, allowing you to optimize it.
Definition of the need
:
- You could tell ChatGPT: “I want a dashboard in Home Assistant that shows me the consumption of my devices in real time.” Generating the configuration
- :
- ChatGPT generates a YAML code to display this information on a custom dashboard: sensor:
- – platform: template
sensors:
total_consumption:
friendly_name: "Total consumption"
value_template: "{{ states('sensor.device_consumption_1') | float + states('sensor.device_consumption_2') | float }}"
Adding notifications
:
- You can ask ChatGPT to add notifications in case of excessive consumption: automation:
- – alias: High consumption alert
trigger:
- platform: numeric_state
entity_id: sensor.total_consumption
above: 1000 # Triggered if consumption exceeds 1000W
action:
- service: notify.mobile_app_mon_telephone
data:
message: "Alert! Energy consumption exceeds 1000W."
This allows you to keep an eye on your energy consumption and take steps to reduce it if necessary.
By combining the advanced features of Home Assistant and the personalized assistance of ChatGPT, you can automate many aspects of your home's energy management. Whether it's regulating the temperature based on presence, turning off devices on standby, or tracking consumption in real time, these automations can help you reduce your electricity bills while minimizing your impact on the environment.
Create complex and chained scenarios with ChatGPT
Complex scenarios combine multiple factors, such as presence, weather conditions, and times, to dynamically and efficiently manage your connected home. With ChatGPT, you can design automations that take into account multiple parameters and chain several actions together to create a system that is perfectly adapted to your needs.
Concrete example: Complete home management scenario during vacation
A typical example of a complex scenario is managing your home when you go on vacation. This scenario could include automatically closing the shutters, lowering the heating temperature, activating a presence simulation and arming the security systems.
Scenario definition
:
- You could tell ChatGPT: “I want a scenario that manages everything when I go on vacation: closing the shutters, lowering the heating, activating the alarm and simulating a presence with the lights.” Script generation
- :
- ChatGPT generates a scenario that chains several actions together depending on your absence: alias: Vacation scenario
- trigger:
- platform: state
entity_id: input_boolean.mode_vacances
to: 'on'
action:
- service: cover.close_cover
target:
entity_id: cover.volets_maison # Close the shutters
- service: climate.set_temperature
target:
entity_id: climate.maison
data:
temperature: 16 # Reduce the heating
- service: alarm_control_panel.alarm_arm_away
target:
entity_id: alarm_control_panel.maison # Activate the alarm
- service: light.turn_on
target:
entity_id: light.salon
- delay: '01:00:00'
- service: light.turn_off
target:
entity_id: light.salon # Simulate presence with lights
Customize actions
:
- You can adjust schedules or add other specific actions, such as recording videos if there is movement detected during your absence: – service: camera.record
- data:
entity_id: camera.jardin
duration: 120 # 2-minute recording if motion is detected
This type of scenario combines the management of security equipment, energy, and presence, allowing you to leave with peace of mind while optimizing your home's resources.
Concrete example: Automatic comfort management based on weather and presence
Another example of a complex scenario is automatic comfort management based on the weather outside and presence in the house. This type of scenario can adjust the heating or air conditioning, open or close the shutters, and turn on the lights based on several factors.
Scenario definition
:
- You explain to ChatGPT: “I want the heating to be adjusted according to the outside temperature and the shutters to close automatically if it's too hot outside.” Script generation
- :
- ChatGPT creates a scenario that regulates several devices according to the weather and the indoor temperature: alias: Weather-based comfort management
- trigger:
- platform: numeric_state
entity_id: sensor.external_temperature
above: 25 # Triggered if the outside temperature exceeds 25°C
condition:
- condition: state
entity_id: group.all_persons
state: 'home' # Only works if someone is at home
action:
- service: cover.close_cover
target:
entity_id: cover.volets_salon # Close the shutters to keep the room cool
- service: climate.set_temperature
target:
entity_id: climate.salon
data:
temperature: 22 # Set the temperature to 22°C
Adding light management
:
- If you want the lights to also adjust according to the outside brightness, ChatGPT can enrich the scenario: trigger:
- – platform: numeric_state
entity_id: sensor.luminosite_exterieure
below: 200 # Triggered if the outside brightness is low
action:
- service: light.turn_on
target:
entity_id: light.salon # Turn on lights if brightness is too low
This type of scenario allows you to automatically manage multiple aspects of indoor comfort without having to intervene manually, taking into account environmental and presence factors.
Concrete example: Combined security and energy scenario
In an even more advanced scenario, you can combine security and energy automations to optimize home management. For example, you can automatically turn off all unused devices, lock the doors and activate the cameras when you leave the house.
Scenario definition
:
- You tell ChatGPT: “I want all devices to turn off, the door to lock and the cameras to activate as soon as I leave the house.” Script generation
- :
- ChatGPT generates a scenario that chains these actions as soon as the absence is detected: alias: Security and energy scenario
- trigger:
- platform: state
entity_id: group.all_persons
to: 'not_home'
action:
- service: switch.turn_off
target:
entity_id: switch.appareils_maison # Turn off devices
- service: lock.lock
target:
entity_id: lock.porte_entree # Door lock
- service: camera.turn_on
target:
entity_id: camera.maison # Camera activation
Add notifications
:
- You can add a notification to be informed when the scenario is activated: action:
- – service: notify.mobile_app_mon_telephone
data:
message: "All devices are off, the house is secure."
This scenario ensures both optimal management of energy consumption and enhanced security when you are not at home.
Create scenarios based on multiple parameters
Complex scenarios can also be triggered by a combination of parameters such as schedules, weather, presence, or even specific events. ChatGPT can help you build these automations, even when they include multiple conditions.
Scenario Definition
:
- You ask ChatGPT: “I want the lights to turn on at 8pm if the weather forecast predicts rain and if someone is home.” Script Generation
- :
- ChatGPT provides you with a script that takes into account several conditions: alias: Automatic lights according to weather and presence
- trigger:
- platform: time
at: '20:00:00'
condition:
- condition: state
entity_id: weather.maison
state: 'rainy' # Triggered only if the weather forecast predicts rain
- condition: state
entity_id: group.all_persons
state: 'home' # Works only if someone is home
action:
- service: light.turn_on
target:
entity_id: light.salon # Turn on the lights
This type of scenario shows how ChatGPT can help automate your home in a sophisticated way, by combining several parameters to meet specific needs.
Conclusion
With ChatGPT, you can create complex and chained scenarios that manage several aspects of your home based on various factors such as weather, presence, or scheduled events. Whether for security, comfort, or energy savings, ChatGPT simplifies the configuration of these automations and helps you get the most out of Home Assistant. Because having a collection of connected objects is good, but automating your home is better. It is not always easy to have ideas for scenarios to set up, and even less to realize them. In this context, ChatGPT can be a real help, even in its free version. It would therefore be a shame to deprive yourself of it :)
Please remain courteous: a hello and a thank you cost nothing! We're here to exchange ideas in a constructive way. Trolls will be deleted.