Work with variable_response in automation

Hi,

I’m want to check if a certain day is true as working day.
The workday.check_date gives me a response but i don’t know how to handle it :frowning:

{“binary_sensor.workday_sensor”:{“workday”:true}}

I hoped is was a simple as this

  - action: workday.check_date
    data:
      check_date: "2025-03-18"
    target:
      entity_id: binary_sensor.workday_sensor
    response_variable: check_date
  - if:
      - condition: template
        value_template: "{{ check_date }} "
    then:
      - action: notify.mobile_app_sm_f731b
        metadata: {}
        data:
          message: "It worked"

But just notifying the check_date variable gives me the output from above and there i’m lost on what to do with it.

Thanks!

Do you really need that?
Isn’t the binary sensor on/off depending on the day?

But I believe your template needs to be

{{ check_date.binary_sensor.workday_sensor.workday }}

Template should be something like

check_date["binary_sensor.workday_sensor"]["workday"]

The way to test this is go into developer tools template. Set a variable to the action response and then test the template.

Thanks for the quick response! I googled some array examples but did not manage to understand it needed to be formatted like that

Hello hastaboera,

Unless this is easier for you.

That is what he is using

oops… A bit over helpful I guess.