Invalid state filter when loading notification states from custom var

To allow maximum customization while keeping complexity low I’m trying to move all notification configurations to the host and service objects.
Thus mixing the easy setup through inheritance with custom configurations on a per object basis.

Breaking it down: Host templates look like this:

template Host "root" {
    check_command = "hostalive"
    vars.monitoring_notification_method = [ "email", "jira" ]
    vars.monitoring_notification_states = [ "OK", "Critical", "Warning" ]
    vars.monitoring_notification_timeperiod = "10x5"
    vars.monitoring_notification_types = [ "Problem", "Recovery" ]
    vars.monitoring_notifications_enabled = true
}

The notification looks like this:

apply Notification "Host E-Mail Notification" to Host {
  import "E-Mail Notification" //empty template

  types = host.vars.monitoring_notification_types
  states = host.vars.monitoring_notification_states
  user_groups = host.vars.monitoring_notification_usergroups
  period = host.vars.monitoring_notification_timeperiod

  assign where host.vars.monitoring_notifications_enabled
}

But I’m currently running into the following issue:

[2019-02-19 12:08:59 +0100] critical/config: Error: Validation failed for object 'MSTR 01!Host E-Mail Notification' of type 'Notification'; Attribute 'states': State filter is invalid.
Location: in /etc/icinga2/zones.d/master/notifications.conf: 35:3-35:52
/etc/icinga2/zones.d/master/notifications.conf(33): 
/etc/icinga2/zones.d/master/notifications.conf(34):   types  = host.vars.monitoring_notification_types
/etc/icinga2/zones.d/master/notifications.conf(35):   states  = host.vars.monitoring_notification_states
                                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/etc/icinga2/zones.d/master/notifications.conf(36):   user_groups  = host.vars.monitoring_notification_usergroups
/etc/icinga2/zones.d/master/notifications.conf(37):   period  = host.vars.monitoring_notification_timeperiod

My first thought was that I need to use the Icinga 2 DSL keywords instead of the strings, but it seems they just resolve to a string with the same name anyway:

r# icinga2 console
Icinga 2 (version: r2.10.2-1)
Type $help to view available commands.
<1> => Warning
"Warning"

From my understanding this should work.
What am I missing?

Hi,

Warning is only allowed for Service notification objects, you’re using it in the wrong context for Host notification objects. The latter needs Up and Down.

Cheers,
Michael

Ugh… of course. Thanks.