Check for 'null' property

Hi All,

I have an automation which sometimes is triggered by the following object (based on the automation debug from Home Asssitant):

trigger:
  id: '0'
  idx: '0'
  platform: state
  entity_id: light.ds_hauptbad_light2
  from_state: null
  to_state:
    entity_id: light.ds_hauptbad_light2
    state: 'off'
    attributes:
      supported_color_modes:
        - onoff
      friendly_name: Dusche
      supported_features: 0
    last_changed: '2021-07-29T10:01:54.956513+00:00'
    last_updated: '2021-07-29T10:01:54.956513+00:00'
    context:
      id: 6a1c02a658062eae8089bed27fe2a3fa
      parent_id: null
      user_id: null
  for: null
  attribute: null
  description: state of light.ds_hauptbad_light2

as you can see the trigger has the attribute from_state: null
I would like to filter my automation not to process if the form_state is null.
How can I do this? I already tried the following options:

  trigger:
    - platform: state
      entity_id: light.ds_hauptbad_light2
  condition: "{{ trigger.from_state is defined }}"
#  condition: "{{ trigger.from_state != null }}
#  condition: "{{ trigger.from_state != 'null' }}"

Thanks for input :slight_smile:

{{ trigger.from_state is not none }}
2 Likes