Write a yaml file that turns on a switch when it is raining outside
- User
Write a yaml file that turns on a switch when it is raining outside
- Assistant
Sorry, as an AI language model, I am not able to access the local weather conditions or switch devices in a real-world scenario. But I can provide a sample YAML file that illustrates the configuration for an automation that triggers a switch when it is raining outside based on the "rain" condition value from a weather forecast integration.
Here's an example YAML configuration:
# automation Raining Night Light alias: Raining Night Light trigger: platform: state entity_id: weather.your_location_here attribute: precipitation_type condition: condition: state entity_id: weather.your_location_here attribute: precipitation_type state: rain action: service: switch.turn_on entity_id: switch.your_switch_hereExplanation: