OpenweatherMap simple automation

Hi,

I have configured OpenweatherMap in configuration.yaml in this way:

sensor:
  - platform: openweathermap
    api_key: <xxxxxxx>
   monitored_conditions:
    - weather
    - temperature
    - wind_speed
    - humidity
    - pressure
    - clouds

Then in automations.yaml I creted a simple automation:

  - alias: 'Check Temperature'
    trigger:
      platform: openweathermap
      entity_id: sensor.temperature
      below: 10
    conditions:
      - condition: time
        after: '8:00'
        before: '20:00'
    action:
       service: system_log.write
       data_template:
          message: 'Temperature changed {{states(sensor.temperature)}}.'
          level: info

When I restart Homeassitant I got this error:

2020-02-18 12:23:47 ERROR (MainThread) [homeassistant.config] Invalid config for [automation]: Invalid platform specified @ data['trigger'][0]. Got None
extra keys not allowed @ data['conditions']. Got None. (See /home/homeassistant/.homeassistant/configuration.yaml, line 13). Please check the docs at https://home-assistant.io/integrations/automation/

If I comment the automation no error is displayed.

Can you help me ?

Thanks & Bye
Mirko

There’s no trigger platform openweathermap.
I think you’re looking for the numeric_state trigger

EDIT: Also conditions should be condition

EDIT 2: :slightly_smiling_face:
And the message template will not work this way.
Should be:

message: "Temperature changed {{states('sensor.temperature')}}."

Thanks it works :slight_smile:

Hi

I have configured an email with the information about the weather

- alias: 'Send mail message at a given time'
    trigger:
      platform: time_pattern 
      hours: "/1" 
    action:
       - service: notify.MailMirko 
       data:
          title: "Homeassistant test mail"
message: "TEST TEST!! \nTemperature {{states('weather.temperature')}} \nWeather {{states('weather.weather')}} \nWind_speed {{states('sensor.wind_speed')}} \nHumidity {{states('sensor.humidity')}} \nPressure {{states('sensor.pressure')}} \nClouds {{states('sensor.clouds')}}."
     - service: system_log.write
       data_template:
         message: "Homeassistant test mail Temperature {{states('sensor.temperature')}}"
         level: info 

But I receive email wihtout data:

TEST TEST!!
Temperature unknown
Weather unknown
Wind_speed unknown
Humidity unknown
Pressure unknown
Clouds unknown.

In the UI I can see all the information correctly.

What is the problem ?

Thanks

Change the first data: to data_template: and correct the indentation.

I have changed data: to data_templete: but nothig.
The mail is sent but with unknown Temperature.

What is the problem of my indentation ?

Thanks

I still can’t get this information visible in my email.

Can someone help me ?

Thanks

Did you ever resolve your problem? Here is a simple one that I did using openweather map to be notified of a High Temp. It works perfectly.

  alias: High Temperature
  description: ''
  trigger:
  - above: '89'
    entity_id: sensor.owm_temperature
    platform: numeric_state
  condition: []
  action:
  - data:
      message: Temp at {{ states.sensor.owm_temperature.state }} degrees.
      title: High Temp
    service: notify.mobile_app_eds_iphonetype or paste code here