cancel
Showing results for 
Search instead for 
Did you mean: 

"The value should be [Condition] but is [Array] instead."

EllieDave
Community Member

I keep getting this error when I try to use conditions in routines, even when I'm following the syntax in examples from the Google Developer Center. I'm happy to post some examples, but can anyone explain in general terms what might be causing this?

 

Thanks!

1 Recommended Answer

In addition to @ir0nm8n's tip about using the "or" type operator, make sure you've got the "- type: " key for each condition you want to check. You can see an example in our help center article - just be sure to double check your indentation and use the Validate button to check that your script is properly formatted.

View Recommended Answer in original post

6 REPLIES 6

ir0nm8n
Community Member

I'm rather new to it myself, but I think it might be in the condition part of your routine. If you can post your example it would be easier to say for certain, but you might be missing a 

type: or
conditions:

value. In the "conditions:" an array (of conditions, listed with "-") is accepted. I think the regular "condition:" takes only one entry.

Hope it helps 🙂

Here's one example (just of the conditions section):

condition:
    - type: time.between
      before: sunrise
      after: sunset
      weekdays:
        - MON
        - TUE
        - WED
        - THU
        - FRI
        - SAT
        - SUN
      device: Light1 - Living Room
      state: on
      is: true

In addition to @ir0nm8n's tip about using the "or" type operator, make sure you've got the "- type: " key for each condition you want to check. You can see an example in our help center article - just be sure to double check your indentation and use the Validate button to check that your script is properly formatted.

It's missing "actions" before "device: Light1..."

Shmageggy
Community Member

Did you ever figure this out? I am having the same issue and can’t find a solution. My syntax seems correct but I get this error!

Shmageggy
Community Member

Never mind! I figured it out. I was using “- type:” but for a single condition (no “s”) you actually use “type:” (no hyphen). I was going insane for a second there!