Automations sharing/communication variables/state?

This is what I am trying to accomplish:
After the windows is opened and then closed the thermostat should be set to the status (temperature/on/off) state it was from the scheduled automation2.

Automation1:
The bathroom windows sensor (on/off-window closed) triggers the floor heating thermostat to “off” when windows opened. When windows closed the thermostat is turned on.

Automation2.
Day scheduling of the floor thermostat like on 06:00 in the morning (23C), 12:00 off, 17:00 on and 23:59 off (the off state will in wintertime be set to X degrees C.)

Here is the challenge:
I take a shower at 11:40 and the thermostat is on heating with temperature 23C.
After showering I open the window at 12:10 and the thermostat is set to “off”.
Automation2 has from 12:00 set the thermostat to “off”.
I close the window at 12:30 and Atumation1 will then set the thermostat to “on”, - which it should not. It should respect (set the status on/off/temperature) settings from Automation2.

Can I have some Automation variable/trigger variable so the two automations can check the other automation variable status?

Automation1:

alias: 'Thermostat Floor ON/OFF  for Window Sensor: Bathroom '
description: When Windows opens Thermostat turns OFF, when closes Thermostat turn on again
trigger:
  - platform: state
    entity_id:
      - binary_sensor.window_sensor1_access_control
    for:
      hours: 0
      minutes: 0
      seconds: 15
    from: 'off'
    to: 'on'
condition:
  - condition: state
    entity_id: climate.floor_thermostat1
    state: heat
action:
  - service: climate.turn_off
    data: {}
    target:
      device_id: 7719252a76ec7b7f5219b716b5d429f1
  - wait_for_trigger:
      - platform: state
        entity_id:
          - binary_sensor.window_sensor1_access_control
        to: 'off'
  - service: climate.turn_on
    data: {}
    target:
      device_id: 7719252a76ec7b7f5219b716b5d429f1
mode: restart

Automation2:

alias: 'Thermostat Floor Schedules: Bathroom '
description: Set bathroom floor thermostat temperature for night and day
trigger:
  - platform: time
    at: '08:00:00'
    id: Turn_On
  - platform: time
    at: '12:00:00'
    id: Turn_Off
  - platform: time
    at: '17:00:00'
    id: Turn_On
  - platform: time
    at: '23:59:00'
    id: Turn_Off
condition: ()
action:
  - wait_template: '{{ is_state(''binary_sensor.window_sensor1_access_control'', ''off'') }}'
  - choose:
      - conditions:
          - condition: trigger
            id: Turn_On
        sequence:
          - service: climate.turn_on
            data: {}
            target:
              device_id: 7719252a76ec7b7f5219b716b5d429f1
          - delay:
              hours: 0
              minutes: 0
              seconds: 15
              milliseconds: 0
          - service: climate.set_temperature
            data:
              temperature: 23
            target:
              device_id: 7719252a76ec7b7f5219b716b5d429f1
      - conditions:
          - condition: trigger
            id: Turn_Off
        sequence:
          - service: climate.turn_off
            data: {}
            target:
              device_id: 7719252a76ec7b7f5219b716b5d429f1
    default: []
mode: restart

If I was faced with this situation, I would combine the two automations so that the time schedule is shared by both activities. Therefore when a window is open/closed, it can check the common schedule and determine if it should/shouldn’t set the thermostat to on/off.

If you want to keep it as two automations, the window-based one should base its decisions on a duplicate of the time schedule used by the other automation.

I concluded that to make this easy to maintain I did the following:
In stead of turning the thermostat off (in Automation 2 - Schedule) the automations set the temperature to the lowest temperature (in stead of off), and in stead on turning it on I set it to the working temperature. Then Automation 1 turn it on and off, while the thermostat always turns on with the latest temp. it had.

But I would like to know how to use a schedule in a automation. Do you mean for every action to duplicate a test for time schedule?