How can I call the service "workday.check_date"?

I would like to find out if tomorrow is a workday or not from my AppDaemon app, so I installed the workday binary sensor to HA and I can now do:

is_today_workday = True if self.get_state("binary_sensor.workday_sensor") == "on" else False

I also want to know if tomorrow is a workday and on the workday binary sensor page there is a section about a service that seems to be able to check an arbitrary date.

The problem is that I can’t figure out how to call this service, if I call self.list_services() it says nothing about any workday service…

Do I have to create the service myself somehow?

I’ve still not solved how to call this service… :thinking:

But for now, I have created some additional entities, binary_sensor.workday_tomorrow_sensor and binary_sensor.workday_day_after_tomorrow_sensor with “Days offset” set to 1 and 2 respectively. :upside_down_face:

1 Like

Unfortunately at this time, AD doesn’t know how to handle response data from HA based service calls but the feature should be added relatively soon.

Thanks for letting me know!
Great to hear that this is something that will be available in the future.

I’m looking for exactly the same, I would like to adjust the solar panels inverter depending if tomorrow is workday.

Did you find a solution ?

Thanks

I’m still using the solution hinted at above, installing the workday binary sensor calling it binary_sensor.workday_tomorrow_sensor and setting days_offset to 1.

State attributes (YAML)
workdays:
  - mon
  - tue
  - wed
  - thu
  - fri
excludes:
  - sat
  - sun
  - holiday
days_offset: 1
friendly_name: Workday Tomorrow Sensor

I then use it in my AppDaemon App class as:

    def is_tomorrow_workday(self):
        v = self.get_state("binary_sensor.workday_tomorrow_sensor")
        self.log(f"workday_tomorrow_sensor: {v}")
        return True if v == "on" else False

Hope this helps.